Streaming examples
Note
To stream without audio, replace the -c:a aac -ac 2 -ab 128k sequence by -an.
a) Streaming at 1 Mbit/s in UDP multicast, to 239.255.0.1 on port 12801
MPEConfig->SetCommandLine (L"ffmpegLGPL.exe -threads 8 -i %PIPE% -c:v h264 -profile:v constrained_baseline "
L"-allow_skip_frames 1 -loopfilter 0 -b:v 1M -c:a aac -ac 2 -ab 128k "
L"-f mpegts udp://239.255.0.1:12801?pkt_size=1316");
b) Pushing to YouTube at 2 Mbit/s, with the audio input pin connected
MPEConfig->SetCommandLine (L"ffmpegLGPL.exe -i %PIPE% -c:v h264 -profile:v constrained_baseline "
L"-allow_skip_frames 1 -loopfilter 0 -g 90 -b:v 2M -c:a aac -ab 64k -ac 2 "
L"-f flv rtmps://a.rtmp.youtube.com:443/live2/te42-648f-uj55-fjt9-chz5");
c) Pushing to YouTube at 4 Mbit/s, with the audio input pin not connected
YouTube requires an audio stream, so a silent one is generated:
MPEConfig->SetCommandLine (L"ffmpegLGPL.exe -i %PIPE% -f lavfi -i anullsrc -c:v h264 "
L"-profile:v constrained_baseline -allow_skip_frames 1 -loopfilter 0 -g 90 -b:v 4M "
L"-f flv rtmps://a.rtmp.youtube.com:443/live2/te42-648f-uj55-fjt9-chz5");
d) Pushing to an Ant Media Server
Same syntax as example b), with an output of the form:
-f flv rtmp://192.168.1.199/WebRTCApp/899895991642161748961446
-f flv rtmp://192.168.1.199/LiveApp/722968383194925013459884
For example, to push video without audio:
MPEConfig->SetCommandLine (L"ffmpegLGPL.exe -i %PIPE% -c:v h264 -profile:v constrained_baseline "
L"-allow_skip_frames 1 -loopfilter 0 -g 90 -b:v 2M -an "
L"-f flv rtmp://192.168.1.199/LiveApp/722968383194925013459884");
e) Pushing to a Wowza server
Same syntax as example b), with an output of the form:
-f rtsp rtsp://36197f.entrypoint.cloud.wowza.com/app-bcae
-f flv "rtmp://314f9a.entrypoint.cloud.wowza.com/app-f6de/3ef94773 flashver=FMLE/3.0\20(compatible;\20FMSc/1.0) live=true"
-f flv "rtmp://192.168.1.167:1935/live/myStream flashver=FMLE/3.0\20(compatible;\20FMSc/1.0) live=true pubUser=live pubPasswd=live"
Note
When the destination contains spaces, as in the Wowza examples above, the whole destination must be enclosed in double quotes.
For live streaming, see also the LOWLATENCY keyword.