1

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

2 Answers 2

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:

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.

1

According to FFmpeg 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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