[FFmpeg-user] What is option -level ?

Lou Logan lou at lrcd.com
Tue Feb 12 22:43:49 EET 2019

On Tue, Feb 12, 2019, at 11:33 AM, Ulf Zibis wrote:
> In another option set of K9copy there is:
> -b $VIDBRk -s $WIDTHx$HEIGHT -vf
> -aspect $ASPECT -codec:v libx264 -level 30 -flags +loop+mv4 -cmp 256
> -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -me_method hex
> -subq 7 -trellis 1 -refs 5 -bf 3 -b-pyramid normal -weightb 1
> -mixed-refs 1 -8x8dct 1 -coder 1 -me_range 16 -g 250 -keyint_min 25
> -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4 -pass $PASS
> -passlogfile $PASSLOGFILE
> Shouldn't it be "-flags pass1" instead "-pass 1"?
> Are there other elements in that option set, which are bad syntax? E.g.
> for -cmp I only see values like 'sad' in the ffmpeg docs, but not '256'.

This looks like a command from 10 years ago.

Use -crf instead of -b. If you must use -b then use -b:v.

Use scale filter instead of -s. If you need to scale.

Do you need to crop?

You don't need -aspect. If you do want to mess with aspect use setsar filter.

You probably don't need -level. Are you encoding for a device that requires level 3? Does your output work with level 3? The console output will let you know if it exceeds the level limits.

Get rid of everything starting from -flags to -qdiff. That's what -preset is for. The presets were made so users don't have to use a million options.

Do you really need to do two passes? Are you targeting a specific output file size? If no, then don't use -pass or -passlogfile, use -crf, and do it all in one pass.

So your command could be simplified to something like:
ffmpeg -i input -c:v libx264 -crf 22 -preset slow -c:a aac output.mp4

More information about the ffmpeg-user mailing list