0

I'm using this command to receive a input stream and transcode it to a different resolution and stream it to ustream.

ffmpeg -hide_banner -loglevel info -progress /tmp/ffmpeg.log -i udp://10.0.0.150:8181?listen \
-framerate 30 -video_size 1080x720 -vcodec libx264 -b:v 768k -crf 23 -preset medium -maxrate 800k -bufsize 800k \
-vf "scale=640:-1,format=yuv420p" -g 60 -c:a aac -strict -3 -ar 44100 -ab 32k -f flv rtmp://<ustream url>/<ustream key>

I also want to extract a full quality snapshot every 1 minute. I read here how I can extract a thumbnail from a video periodically and I read this explaining how to send one input stream to different output streams with different video filters.

When I combined the two commands I ended up with this:

ffmpeg -hide_banner -loglevel info -progress /tmp/ffmpeg.log -i udp://10.0.0.150:8181?listen -filter_complex '[0]split=2[in1][in2];[in1]scale=640:-1,format=yuv420p[out1];[in2]fps=1/60[out2]' \
-map '[out1]' -framerate 30 -video_size 1080x720 -vcodec libx264 -b:v 768k -crf 23 -preset medium -maxrate 800k -bufsize 800k -g 60 -c:a aac -strict -3 -ar 44100 -ab 32k -f flv rtmp://<ustream url>/<ustream key> \
-map '[out2]' img%03d.jpg

The command almost works, but the audio is missing on the livestream. The images are created correctly and the video is fine but there is no audio. How can I also get audio in my livestream?

2

Try

ffmpeg -hide_banner -loglevel info -progress /tmp/ffmpeg.log -i udp://10.0.0.150:8181?listen -filter_complex '[0:v]split=2[in1][in2];[in1]scale=640:-1,format=yuv420p[out1];[in2]fps=1/60[out2]' \
-map '[out1]' -map 0:a -framerate 30 -video_size 1080x720 -vcodec libx264 -b:v 768k -crf 23 -preset medium -maxrate 800k -bufsize 800k -g 60 -c:a aac -strict -3 -ar 44100 -ab 32k -f flv rtmp://<ustream url>/<ustream key> \
-map '[out2]' img%03d.jpg
| improve this answer | |
  • "Output with label '0:a' does not exist in any defined filter graph, or was used elsewhere" – Linus Jan 11 '16 at 7:17
  • Try revised command. – Gyan Jan 11 '16 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.