ffmpeg -i $SRC -ss 4:00 -filter_complex '[0:a:1]pan=2c|c0=c0|c1=c0[l];[0:a:0][l]amerge=inputs=2[a]' -map '0:v:0' -map '[a]' -c:v copy -c:a libvorbis -q:a 10 -ac 2 $DEST
This is what I do for preparing 5 minute ShadowPlay clips for playback in conventional applications.
We start with two audio tracks: first is stereo (game audio), second is stereo (mic) but the right channel is unused.
-i $SRC -ss 4:00
[0:a:1]pan=2c|c0=c0|c1=c0[l]Merge the first and 'l' audio tracks into 'a'.
[0:a:0][l]merge=inputs=2[a]
-map '0:v:0' -map '[a]'Copy the video (do not re-encode), encode the audio with libvorbis (quality 10) with 2 channels.
-c:v copy -c:a libvorbis -q:a 10 -ac 2
iptables -t nat -A PREROUTING --dport $LPORT -j DNAT --to-destination $TARGET_HOST:$RPORT iptables -t nat -A POSTROUTING -j MASQUERADEThis will perform forwarding for requests that originate external from the host. The rule written here will forward requests sent to
$LPORTto
$TARGET_HOST:$RPORT. For this to work, the appropriate kernel modules need to be loaded, and IP forwarding needs to be enabled.
modprobe ip_tables modprobe iptable_nat sysctl net.ipv4.ip_forward=1 # for systemd
-t nat -A PREROUTINGFor requests to port
$LPORT, rewrite the destination field as
$TARGET_HOST:$RPORT. We do this in PREROUTING so that other filters can see the intended destination.
--dport $LPORT -j DNAT --to-destination $TARGET_HOST:$RPORTRewrite the source field as the packet is being transmitted to the target host. This can be done explicitly with
-j SNATif the IP address of the forwarding host is static. For packets returning from the target host, MASQ will look up which client is requesting them and send them back.
-t nat -A POSTROUTING -j MASQUERADE
nc -U $SOCKET << EOF | grep -E "^s.*Exit" -B1 | awk '/^r/ { print $7 }' authenticate "$PASSWORD" getinfo ns/all quit EOFRun tor with
ControlSocket $SOCKET