View Full Version : Resulting bitrate much lower than requested
I use XviD 1.1.2 (Koepi's binary) to encode PAL video from videocamera and I noticed that that resulting video has significantly lower bitrate than what I requested. When I use 2-pass encoding at 1024 Kbps, I get 670 Kbps! (No audio, I disable the audio stream in VirtualDub) What's wrong?
-mdw
foxyshadis
19th May 2007, 15:16
Did you read the over/undersize sticky in this forum? After that, check out the presets thread as well.
Did you read the over/undersize sticky in this forum? After that, check out the presets thread as well.
Yes, I checked it and I am not sure whether I understand it correctly, but I think it doesn't apply here. And I don't seem to be able to glean much clue from the presets thread, too. At any rate, 1024 Kbps at PAL resolution/framerate has no chance of "saturating" the codec, right?
I think it must be something simple, because my earlier encodes were spot on (1019 Kbps when target was 1024 Kbps...).
-mdw
foxyshadis
19th May 2007, 23:22
If you turn the status window on, or use a tool like DRF analyser, it'll show you how the quants work out. 600 can be enough for q2 even at full PAL resolution, if it's simple enough on the codec and using h263 matrix.
Anything over about 50-100 frames should be plenty for the ratecontrol to correct itself, but there is always some chance something else is going wrong. We'd probably need a sample and test case to help though.
Blue_MiSfit
20th May 2007, 01:19
Indeed.
It's likely that you are saturating the codec.
Do post a sample, but also try switching to MPEG quantization or a high bitrate CQM.
~MiSfit
Indeed.
It's likely that you are saturating the codec.
Do post a sample, but also try switching to MPEG quantization or a high bitrate CQM.
~MiSfit
If I am saturating the codec, how is it that when I set target bitrate, the result is again about one third below target? When I increase bitrate the same happens. Switching to MPEG QM changes nothing. I tried reducing maximum I-frames interval, but the result is even worse then.
What kind of sample would be useful? The original video is huge (300 MB for 20 seconds clip).
-mdw
Blue_MiSfit
20th May 2007, 17:02
Well, you have to understand that the codec doesn't really encode to an arbitrary bitrate.
The encoded size (bitrate) of any given frame is determined by the quantizer that Xvid assigns to that frame. When you get down to using quantizer 2 on every frame (saturating the codec), it's pointless to spend more bits, with that given input and codec configuration
Now, if you have B-frames, those always have higher quantizers because they can get away with it. Exactly how much higher is determined by your B-frame offset and ratio settings.
Setting a higher bitrate does nothing in your case (possibly, we're not sure yet ;)), because those bits aren't needed to reduce the quantizers (improve quality) at your given settings. Using different CQMs, qpel, b-frame settings, and avisynth filters will all have an impact on the resulting bitrate.
I find it hard to believe that using MPEG quantization did not change your bitrate at all versus h263.
What encoding mode are you using? 1pass VBR, CBR, CQ? 2pass?
Do try resetting everything to defaults.
Whatever you do, DON'T enable quantizer 1. It's a silly feature that's designed to make people happy in your case. q1 frames are gigantic, and dont look any better than q2 frames. They exist to pad filesize so that you do hit your target bitrate.
However, its a bloody awful waste of space, that doesn't to jack for image quality. Using a sharper CQM, or AviSynth filtering to sharpen / resize will use those extra bits a lot more than enabling q1.
~MiSfit
Well, you have to understand that the codec doesn't really encode to an arbitrary bitrate.
The encoded size (bitrate) of any given frame is determined by the quantizer that Xvid assigns to that frame. When you get down to using quantizer 2 on every frame (saturating the codec), it's pointless to spend more bits, with that given input and codec configuration
I think I understand that part. My understanding is, that when I use 2-pass (and that's what I am talking about) the encoder varies the quantizer to achieve target bitrate.
Setting a higher bitrate does nothing in your case (possibly, we're not sure yet ;))
I haven't said that. Increasing target bitrate DOES INCREASE the resulting bitrate, but it still remains 1/3 lower than the target. This behaviour is, according to my understanding, is inconsistent with codec saturation.
Anyway, what I will try is to bring my file to work and try encoding here (I encode files for my Palm to watch during commute and there's no problem with that). Maybe my home setup is just messed up :)
-mdw
plugh
22nd May 2007, 12:32
If it's consistently one third low, perhaps there is an error in numframes or framerate for your source video.
targetsize = bitrate/8 * numframes / framerate
Let's see, if reported framerate was 50 but actual framerate was 30, you'd get about 60% of your requested target rate.
Or is that the other way around? whatever...
foxyshadis
23rd May 2007, 01:15
One way to test for that is to enter a filesize, instead of a bitrate, and see what xvid does with that. (Of course looking into your content creation chain might turn up the problem much quicker.)
Blue_MiSfit
23rd May 2007, 06:28
Hmm yeah this doesn't sound like classical saturation.
If you haven't tried it yet, reset everything to defaults, or maybe re-install Xvid :)
~MiSfit
Lenny_Nero
23rd May 2007, 21:59
...or maybe re-install Xvid :)
I think that would be a very good idea, just make sure your doing it the correct way (uninstalling first with a re-boot and a clean up just in case) because the very under size files do also point to this if you cant get much to change it.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.