[FFmpeg-devel] Strange qmax behaviour with mpeg2

Michael Niedermayer michaelni at gmx.at
Thu Sep 13 20:00:35 CEST 2012


On Thu, Sep 13, 2012 at 09:44:56AM +0100, Joseph Artsimovich wrote:
> On 12/09/2012 10:41, Michael Niedermayer wrote:
> >On Wed, Sep 12, 2012 at 09:57:41AM +0100, Joseph Artsimovich wrote:
> >>On 11/09/2012 16:59, Michael Niedermayer wrote:
> >>>On Tue, Sep 11, 2012 at 12:02:14PM +0100, Joseph Artsimovich wrote:
> >>>>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
> >>>should be fixed
> >>I see this behaviour with the latest ffmpeg from git.
> >in that case your input file is needed because the issue is fixed
> >with matrixbench_mpeg2.mpg
> OK, here you go.
> 
> A synthetic .png image to encode [14 KB]:
> http://s17.postimage.org/epzmtwifz/letters.png
> 
> Command line1:
> ffmpeg -i letters.png -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 1 -lmin QP2LAMBDA -top 1 -bufsize 1200000 -rc_init_occupancy
> 1200000 -rc_buf_aggressivity 0.25 -an letters1.mov
> 
> Command line2:
> ffmpeg -i letters.png -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 12 -lmin QP2LAMBDA -top 1 -bufsize 1200000
> -rc_init_occupancy 1200000 -rc_buf_aggressivity 0.25 -an
> letters12.mov
> 
> The two command lines only differ by qmax and output file name. The
> output files are exactly the same size, which indicates even
> qmin=qmax=1 case fits into the specified bitrate. The second file
> has visible compression artifacts, particularly near the bottom.
> -lmin QP2LAMBDA doesn't seem to make any difference.

md5sum disagrees:
2939383798ea9d8deb709aa47dcf9ca7  letters12.mov
2939383798ea9d8deb709aa47dcf9ca7  letters1.mov

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120913/82e23478/attachment.asc>


More information about the ffmpeg-devel mailing list