Search code examples
encodingffmpegvp9

FFmpeg VP9 - Different Quantisation Parameters but same output files


I want to encode a video with vp9 with different quantisation parameters (qp=[16,20,24,28,32]). Unfortunately the output files have the same data rate after encoding and don't show any quality differences.

This is my code for qp=20:

ffmpeg -s:v 3840x1920 -framerate 30 -i video_3840x1920_30fps_8bit_420_erp.yuv -c:v libvpx-vp9 -qp 20 -f avi out.avi

Many thanks for any pointers you can give me.


Solution

  • -qp only works for internal mpegvideoenc-derived encoders, such as FFmpeg's built-in MPEG-1/2/4 encoders. Libvpx, like x264/5, uses -crf to do this instead. See the Wiki for more details. You can also type ffmpeg -h encoder=libvpx-vp9:

    $ ffmpeg -h encoder=libvpx-vp9
    [..]
      -crf               <int>        E..V.... Select the quality for constant quality mode (from -1 to 63) (default -1)
    

    So for qp=20, you would use ffmpeg -s:v 3840x1920 -framerate 30 -i video_3840x1920_30fps_8bit_420_erp.yuv -c:v libvpx-vp9 -crf 20 -b:v 0 out.avi.