Log in

View Full Version : [Xvid] Same settings -- different filesize?


Gew
1st August 2010, 01:22
Hi!

I just made an experiment.

ffmpeg.exe -i foo.avs -an -vcodec libxvid -bf 2 -g 300 -qscale 4 -y -aspect 4:3 1.avi

xvid_encraw.exe -i foo.avs -o 2.avi

And the third encode, using Xvid/VFW with default settings (Quantizer 4, 2 BVOP, max GOP 300 etc).

Now, the AviSynth script was a simple 5 second long clip. However, despite the fact that the three encodes above use the same encoder core (XviD 1.2.1) they seem to produce different output.

xvid_encraw encode is 7583kbps.
ffmpeg encode is 9079kbps.
xvid/vfw encode is 7521kbps.

This amazes me. Would anyone care to explain this? ;)

Ty in adv~
Regards~

Guest
1st August 2010, 01:46
What makes you think they have the same settings? Doesn't look that way to me.

Gew
1st August 2010, 01:56
Sorry. I could be wrong. I'm not that advanced. Actually the only params I know for sure is quantizer/bitrate, max no. of consecutive b-frames, and max. I-frame interval. Would be awesome if you could point out the variables that I'm missing, and therefor perhaps knock the blaze of my shoulder, more or less litterally! ^^

I mean, I was pretty sure that xvid_encraw and xvid/vfw used the same default settings, except for that the VfW version has minimum I/P/B quantizer set to 1, whereas xvid_encraw has it set to 2. When it comes to ffmpeg, I'm not really sure how to make it act like "Xvid default" but as of today my current guess is (like I mentioned) "-bf 2 -qscale 4 -g 300". What am I missing out on?

:thanks:

Gew
1st August 2010, 12:36
Okey so now I found another thing that differs. XviD defaults on trellis enabled, whereas ffmpeg has it disabled. Anyhow, the result of a quantizer:4 encode on a clip still differs in size. Anything else that I've overlooked? When feeding the two clips into GSpot, it detects the same I/P/B amount (1/33/66). However, the ffmpeg-encode reports "200.0 avg / 298 max" as for I-frame distance, whereas the xvid_encraw encode gives "200.5 avg / 300 max". Since I encoded a short (16s) clip, I guess the resulting bitrate could bump the ceiling kind of fast. Have I still missed out on some ffmpeg parameter (for -vcodec libxvid) to have it act as Xvid's default settings? Or is it possible that the explanation is that ffmpeg uses a different "I-frame estimator", hence the output result of two examples could never be identic in size/bitrate, even if encoding parameters are set exactly the same..? Just curious.

Ty in adv~
Regards~