[MPlayer-dev-eng] 2 pass encoding - need explanation

Michael Niedermayer michaelni at gmx.at
Sun Feb 23 01:12:26 CET 2003


Hi

On Saturday 22 February 2003 21:12, Attila Kinali wrote:
> Heyo,
>
> I recently had a discussion with Jonas about the usage of
> vqscale in the first pass of a two pass encoding.
> So i wanted to test it and got following results:
>
> Source:
> VIDEO:  [MP43]  320x240  24bpp  23.98 fps  615.4 kbps (75.1 kbyte/s)
>
> ---
> 1.pass: vbitrate=615 / 2.pass: vbitrate=615:
>
> 1.pass:  -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vpass=1:vbitrate=615
> 2.pass:  -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vpass=2:vbitrate=615
>
> Video stream:  615.120 kbit/s  (76889 bps)  size: 381096793 bytes  4956.394
> secs  118836 frames Audio stream:  128.000 kbit/s  (15999 bps)  size:
> 79295296 bytes  4955.956 secs PSNR: Y:44.30, Cb:47.20, Cr:47.93, All:45.14
> ---
> ---
> 1.pass: vqscale=5 / 2.pass: vbitrate=615
>
> 1.pass: -oac copy -ovc lavc -lavcopts
> vcodec=mpeg4:vpass=1:vbitrate=615:vqscale=5 2.pass: -oac copy -ovc lavc
> -lavcopts vcodec=mpeg4:vpass=1:vbitrate=615
>
> Video stream:  615.094 kbit/s  (76886 bps)  size: 381080897 bytes  4956.394
> secs  118836 frames Audio stream:  128.000 kbit/s  (15999 bps)  size:
> 79295296 bytes  4955.956 secs PSNR: Y:44.02, Cb:46.98, Cr:47.74, All:44.87
> ---
>
> Now, the two results seem to be pretty much the same from size and PSNR,
> but a analysis plotpsnr.pl shows, that the second test (with vqscale)
> has the quantisizer size most time at 4 and less (just a few times at
> the beginning at 5 and 6) while the first test has it at 5 and less.
>
> If i'm not mistaken, then the file size and the quality of an encoding
> is mostly dictated by the used quantisizer values (assuming that the
> same MVs are choosen)
>
> But why is there so less difference in the file size (beside the
> file with the lower quantisizer is smaller!) and why doesnt the
> PSNR differ at all ?
>
> Can anyone explain that ?
the quant/psnr/size relation is very complex ...
for example encoding one frame with quant=3 and one with quant=5 is sometimes 
better, sometimes worse then encoding both with quant=4, for example very low 
motion scenes need only slightly more bits at lower quants, but look much 
better, while high motion scenes will need much more bits at lower quantizers 
...
and the quant/psnr/size relation of frame n will significantly depend upon the 
quality of frame n-1, as its used for motion compensation

[...]

Michael


More information about the MPlayer-dev-eng mailing list