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
ffmpeg -i "Original File.mov" -vf subtitles=Subtitles.srt -vf scale=1920:1080 \ -crf 12 "Final File".mov
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
I reckon that in case of predefining the file size the -crf 12 paramater will be redundant?
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:
As far as I know, those advanced subtitle optionsare applicable to subtitles presented as a regular input, not via the hardcoding subtitles filter