Answers.Body: <p>According to <a href="https://trac.ffmpeg.org/wiki/Creating%20multiple%20outputs" rel="nofollow noreferrer">FFmpeg</a> it supports multiple outputs created out of the same input(s) in the same process. The usual way to accomplish this is: </p>
  
  <pre><code>ffmpeg -i input1 -i input2 \
      -acodec … -vcodec … output1 \
      -acodec … -vcodec … output2 \
      -acodec … -vcodec … output3
  </code></pre>
  
  <p>This way ffmpeg can create several different outputs out of the same input(s). </p>
  
  <p>For example, to encode your video in HD, VGA and QVGA resolution, at the same time, you would use something like this:</p>
  
  <pre><code>ffmpeg -i input \
      -s 1280x720 -acodec … -vcodec … output1 \
      -s 640x480  -acodec … -vcodec … output2 \
      -s 320x240  -acodec … -vcodec … output3
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-04T20:56:00.337Z
Answers.LastActivityDate: 2020-01-04T20:56:00.337Z
Answers.UserDisplayName: Suhayb
Answers.Body: <pre><code>ffmpeg -y -i inputStream \
   -row-mt 1 -s 1280x720 -b:v 1024k -minrate 512k -maxrate 1485k  
   -tile-columns 2 -g 240 -threads 8 -quality good -crf 32 -c:v libvpx-vp9 -c:a libvorbis hd \
   -row-mt 1 -s 640x480 -b:v 750k -minrate 375k -maxrate 1088k \
   -tile-columns 1 -g 240 -threads 4 -quality good -crf 33 -c:v libvpx-vp9 -c:a libvorbis fsd \
   -row-mt 1 -s 640x480 -b:v 512k -minrate 256k -maxrate 742k \
   -tile-columns 1 -g 240 -threads 4 -quality good -crf 34 -c:v libvpx-vp9 -c:a libvorbis sd
  </code></pre>
  
  <p>After specifying your input(s), all audio/video/subtitle options are designated for the next output, so you may write different options for different outputs.</p>
  
  <p>From <a href="https://ffmpeg.org/ffmpeg.html#Description" rel="nofollow noreferrer">FFmpeg documentation, Chapter 2 Description</a>:</p>
  
  <blockquote>
    <p>Do not mix input and output files – first specify all input files, then all output files. Also do not mix options which belong to different files. All options apply ONLY to the next input or output file and are reset between files. </p>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-04T22:39:44.703Z
Answers.LastActivityDate: 2020-01-04T22:50:05.693Z
Answers.LastEditDate: 2020-01-04T22:50:05.693Z
Answers.UserDisplayName: MarianD
Body: <p>I am transcoding one input into three different quality output, currently I am producing them by three separate commands, and I am looking to combine them in single one command using map function or something else.</p>
  
  <p>here are the commands I run to produce dash content:</p>
  
  <pre><code>ffmpeg -y -i inputStream -row-mt 1 -s 1280x720 -b:v 1024k -minrate 512k -maxrate 1485k -tile-columns 2 -g 240 -threads 8 -quality good -crf 32 -c:v libvpx-vp9 -c:a libvorbis hd;
  
  ffmpeg -y -i inputStream -row-mt 1 -s 640x480 -b:v 750k -minrate 375k -maxrate 1088k -tile-columns 1 -g 240 -threads 4 -quality good -crf 33 -c:v libvpx-vp9 -c:a libvorbis fsd
  
  ffmpeg -y -i inputStream -row-mt 1 -s 640x480 -b:v 512k -minrate 256k -maxrate 742k -tile-columns 1 -g 240 -threads 4 -quality good -crf 34 -c:v libvpx-vp9 -c:a libvorbis sd
  </code></pre>
  
Tags: <ffmpeg>
Title: How to join these three FFmpeg instances into one command
UserDisplayName: Suhayb
ThreadText: # How to join these three FFmpeg instances into one command
  
  (Asked by: username_0 on 2020-01-04)
  
  I am transcoding one input into three different quality output, currently I am producing them by three separate commands, and I am looking to combine them in single one command using map function or something else.
  
  here are the commands I run to produce dash content:
  
  ```
  ffmpeg -y -i inputStream -row-mt 1 -s 1280x720 -b:v 1024k -minrate 512k -maxrate 1485k -tile-columns 2 -g 240 -threads 8 -quality good -crf 32 -c:v libvpx-vp9 -c:a libvorbis hd;
  
  ffmpeg -y -i inputStream -row-mt 1 -s 640x480 -b:v 750k -minrate 375k -maxrate 1088k -tile-columns 1 -g 240 -threads 4 -quality good -crf 33 -c:v libvpx-vp9 -c:a libvorbis fsd
  
  ffmpeg -y -i inputStream -row-mt 1 -s 640x480 -b:v 512k -minrate 256k -maxrate 742k -tile-columns 1 -g 240 -threads 4 -quality good -crf 34 -c:v libvpx-vp9 -c:a libvorbis sd
  
  ```
  
  **Tags:** ffmpeg
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2020-01-04. Score: 1 | Accepted answer
  
  According to [FFmpeg](https://trac.ffmpeg.org/wiki/Creating%20multiple%20outputs) it supports multiple outputs created out of the same input(s) in the same process. The usual way to accomplish this is:
  
  ```
  ffmpeg -i input1 -i input2 \
      -acodec … -vcodec … output1 \
      -acodec … -vcodec … output2 \
      -acodec … -vcodec … output3
  
  ```
  
  This way ffmpeg can create several different outputs out of the same input(s).
  
  For example, to encode your video in HD, VGA and QVGA resolution, at the same time, you would use something like this:
  
  ```
  ffmpeg -i input \
      -s 1280x720 -acodec … -vcodec … output1 \
      -s 640x480  -acodec … -vcodec … output2 \
      -s 320x240  -acodec … -vcodec … output3
  
  ```
  
  
  ---
  
  ### Answer by username_1 on 2020-01-04. Score: 2
  
  ```
  ffmpeg -y -i inputStream \
   -row-mt 1 -s 1280x720 -b:v 1024k -minrate 512k -maxrate 1485k  
   -tile-columns 2 -g 240 -threads 8 -quality good -crf 32 -c:v libvpx-vp9 -c:a libvorbis hd \
   -row-mt 1 -s 640x480 -b:v 750k -minrate 375k -maxrate 1088k \
   -tile-columns 1 -g 240 -threads 4 -quality good -crf 33 -c:v libvpx-vp9 -c:a libvorbis fsd \
   -row-mt 1 -s 640x480 -b:v 512k -minrate 256k -maxrate 742k \
   -tile-columns 1 -g 240 -threads 4 -quality good -crf 34 -c:v libvpx-vp9 -c:a libvorbis sd
  
  ```
  
  After specifying your input(s), all audio/video/subtitle options are designated for the next output, so you may write different options for different outputs.
  
  From [FFmpeg documentation, Chapter 2 Description](https://ffmpeg.org/ffmpeg.html#Description):
  
  > Do not mix input and output files – first specify all input files, then all output files. Also do not mix options which belong to different files. All options apply ONLY to the next input or output file and are reset between files.
  
  
  ---
  
  