[FFmpeg-devel] Strange qmax behaviour with mpeg2

Joseph Artsimovich joseph at mirriad.com
Tue Sep 11 13:02:14 CEST 2012


Hi,

When encoding IMX 30 content (I-frame only mpeg2 at fixed bitrate) I 
noticed ffmpeg produces lower quality output than other encoders. 
Digging deeper, I found strange behaviour of qmax parameter with 
mpeg2video encoder that I can only explain away as a bug.

Before explaining further, here is my command line:
ffmpeg -i input.mov -vtag mx3p -vcodec mpeg2video -r 25 -pix_fmt yuv422p 
-minrate 30000k -maxrate 30000k -b:v 30000k -intra -flags 
+ildct+low_delay -dc 10 -intra_vlc 1 -non_linear_quant 1 -ps 1 -qmin 1 
-qmax 8 -top 1 -bufsize 1200000 -rc_init_occupancy 1200000 
-rc_buf_aggressivity 0.25 -an out.mov

The value of qmax=8 was taken from 
http://www.itbroadcastanddigitalcinema.com/ffmpeg_howto.html#Encoding_D10
This value guarantees the encoded frame size won't exceed 150000 bytes, 
which is the maximum for IMX 30. If I set it even higher to 12 (the 
maximum -non_linear_quant would allow me), I get a file with identical 
size but lower quality. That seems very wrong. I mean if it fits bitrate 
restrictions at qmax=8, it shouldn't degrate quality just because you 
allow it to.

Thoughts?

-- 
Joseph Artsimovich
Senior C++ Applications Developer
MirriAd Ltd



More information about the ffmpeg-devel mailing list