FFmpeg command to apply multiple filters and limit the final file size

I'm using ffmpeg command below to convert video to a format of the defined scale and in order to hardcode the subtitles

Original syntax
ffmpeg -i "Original File.mov"  -vf subtitles=Subtitles.srt -vf scale=1920:1080 \
       -crf 12 "Final File".mov

Problem

I would like to expand this command further and:

  • ensure that the produce file is under 2GB
  • I would like to include additional parameters with advanced subtitle options, like setting the canvas size and fixing the potential delay
Side notes

I reckon that in case of predefining the file size the -crf 12 paramater will be redundant?

Answers


You can sort of set an upper limit on file size by defining an average bitrate e.g. -b:v 4000k and maximum bitrate -maxrate 5000k -bufsize 5000k, based on the duration of your video. as explained at FFmpeg wiki. You can use CRF in place of -b:v but you'll need to keep the maxrate and bufsize.

To apply multiple filters, you specify them in one filterchain, separated by commas, so:

-vf subtitles=Subtitles.srt,scale=1920:1080

As far as I know, those advanced subtitle optionsare applicable to subtitles presented as a regular input, not via the hardcoding subtitles filter


Need Your Help

strcmpi integer without a cast error

c++ c strcmp

I'm trying to create a program that removes vowels from a string, add them into a vector and then give the user the possibility of having the original code again.

Best method for handling asynchronous USB data requests?

c# wpf multithreading winforms asynchronous

I currently have a console application written in Visual C# (2013). It opens up a connection to a USB Multimeter and then writes out the value to the console. I would now like to make this into a p...