Answers.Body: <p>Try </p>
  
  <pre><code>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://&lt;ustream url&gt;/&lt;ustream key&gt; \
  -map '[out2]' img%03d.jpg
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-11T07:17:07.273Z
Answers.Text: "Output with label '0:a' does not exist in any defined filter graph, or was used elsewhere"
Answers.UserDisplayName: Linus
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-11T07:39:13.573Z
Answers.Text: Try revised command.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-11T06:16:59.953Z
Answers.LastActivityDate: 2016-01-11T07:38:37.023Z
Answers.LastEditDate: 2016-01-11T07:38:37.023Z
Answers.UserDisplayName: Gyan
Body: <p>I'm using this command to receive a input stream and transcode it to a different resolution and stream it to ustream. </p>
  
  <pre><code>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://&lt;ustream url&gt;/&lt;ustream key&gt;
  </code></pre>
  
  <p>I also want to extract a full quality snapshot every 1 minute. I read <a href="https://trac.ffmpeg.org/wiki/Create%20a%20thumbnail%20image%20every%20X%20seconds%20of%20the%20video" rel="nofollow">here</a> how I can extract a thumbnail from a video periodically and I read <a href="https://trac.ffmpeg.org/wiki/Creating%20multiple%20outputs" rel="nofollow">this</a> explaining how to send one input stream to different output streams with different video filters.</p>
  
  <p>When I combined the two commands I ended up with this:</p>
  
  <pre><code>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://&lt;ustream url&gt;/&lt;ustream key&gt; \
  -map '[out2]' img%03d.jpg
  </code></pre>
  
  <p>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?</p>
  
Tags: <video><ffmpeg><audio><streaming>
Title: ffmpeg streaming to rtmp and extracting image periodically
UserDisplayName: Linus
ThreadText: # ffmpeg streaming to rtmp and extracting image periodically
  
  (Asked by: username_0 on 2016-01-10)
  
  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](https://trac.ffmpeg.org/wiki/Create%20a%20thumbnail%20image%20every%20X%20seconds%20of%20the%20video) how I can extract a thumbnail from a video periodically and I read [this](https://trac.ffmpeg.org/wiki/Creating%20multiple%20outputs) 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?
  
  **Tags:** video, ffmpeg, audio, streaming
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-01-11. Score: 2 | Accepted answer
  
  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
  
  ```
  
  > **Comments:**
  > **username_0**: "Output with label '0:a' does not exist in any defined filter graph, or was used elsewhere"  
  > **username_1**: Try revised command.  
  
  ---
  
  