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

D Richard Felker III dalias at aerifal.cx
Sat Feb 22 22:23:55 CET 2003


On Sat, Feb 22, 2003 at 09:12:24PM +0100, 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 ?

It does!! 0.27 is a fairly large difference in PSNR!!

BTW, you should try with vqscale=2 on the first pass and see if that
works well, rather than vqscale=5. The latter will encode the whole
first pass at very low quality so it probably won't estimate
complexity well.

Rich



More information about the MPlayer-dev-eng mailing list