View Full Version : different bitrate for last pass
tripex
4th February 2007, 00:28
I encode at very low bitrates around 0.1 bits per pixel. Sometimes however I realize that 10 oder even 20% less should do it. On the other hand (i.e. action movies) it should be better 10 oder 20% more.
As I do always 3 passes by hand with VirtualDubMod I could assess the quality from the second pass to make an adjustment of the bitrate for the final pass, but I don't dare, because I've read, that for best quality (at given size) all passes should be the same bitrate. Rather I start again with all 3 passes. But is this really a big difference compared to the method I don't dare?
In my understanding the quality improvement from pass to pass works with shifting relative bits from slow motion to high motion scenes and should be completely independent from the bitrate. But obviously it's not? Why?
CU
Andy
DigitAl56K
4th February 2007, 02:14
In my understanding the quality improvement from pass to pass works with shifting relative bits from slow motion to high motion scenes and should be completely independent from the bitrate. But obviously it's not? Why?
Because when you change encoding parameters, such as bitrate, you change the way the encoder codes each frame, and over time this causes a cascading effect that can (in some conditions) significantly change the encoders decisions throughout the file. Maybe if the data rate is lower, for example, the motion estimation returns marginally different results for each frame, texture residual is slightly different, and the changes are compound between I frames. Maybe in your original encoding some frames caused the encoder to raise the frame quantizer to prevent buffer underruns (e.g. for playback on CE devices), and at this new bitrate this no longer occurs, or maybe it didn't occur before and does now. The effect of changing the bitrate (to a reasonably degree) between passes is probably minimal for short clips or clips that are typically low motion.
Try this:
Create an AVISynth script using SelectRangeEvery() to create a much shorter clip featuring segments throughout the source video
Switch the encoder to Unconstrained mode, select 1-Pass, Quality Based mode, set up the rest of the encoder options just as you would for your normal encoding, and then enable the feedback window
Start encoding, and adjust the quantizer control at the bottom of the feedback window until you're happy with the quality. Remember at this point you are watching the video with no post-processing (e.g. deblocking).
Once you are happy with the quality, abort the encoding, turn off the feedback window, and set the quantizer you have determined then complete a full encoding (still in Unconstrained/1-Pass quality based mode).
Open the resulting video file, and check the average video bitrate
Encode the full video at this bitrate using 2-pass (or three pass if you like) with a DivX profile enabled (e.g. Home Theater)
An alternative, and simpler method, is to find the quantizer that gives you acceptable quality based on the other encoder options you like to use, then use the 1-Pass, Quality based mode in combination with a DivX encoding profile. Except in "Unconstrained" mode, the quantizer value operates as a target, and the encoder will adjust it temporarily if it needs to do so to guarantee playback performance on certified devices.
tripex
5th February 2007, 01:20
Thanks for the answer and the step by step guide to find the optimal quantizer.
Maybe in your original encoding some frames caused the encoder to raise the frame quantizer to prevent buffer underruns (e.g. for playback on CE devices), and at this new bitrate this no longer occurs, or maybe it didn't occur before and does now.
Does it mean I can use different bitrates between passes, when I use Unconstrained mode or does it eliminate only one problem?
Is it a big quality effect (more than 1%, don't know how to describe it in value else) to change the bitrate at the 3rd pass by 10% or even up to 20% (even for action movies)?
Is it more degrading the quality to increase or decrease the bitrate at the 3rd pass? My rough comparison of 2 files with the same final bitrate shows, that the one with previously higher bitrates looks worse than the one with previously lower bitrates at the first and second pass.
Is it a good idea, when I decide to change the bitrate at the 3rd pass to do an additionally 4th pass with the same new bitrate to almost "get back" the maximum quality? Maybe it's only necessary with action movies or big changes beyond 20%.
What, when I decide to make even a 5th pass with the new bitrate? That would be stupid, because it should give the nearly exact same quality than doing 3 passes with this bitrate, wouldn't it?
CU
Andy
DigitAl56K
5th February 2007, 10:14
Quick note: I should mention that it's very important when using SelectRangeEvery() not to select a very short range, otherwise you'll increase the number of keyframes and thus raise the data rate quite significantly. E.g. try SelectRangeEvery(1200,300), reducing the video length to a quarter.
I'll reply to the rest of your questions tomorrow, it's super late here now :)
tripex
5th February 2007, 20:39
E.g. try SelectRangeEvery(1200,300)
Hmm, I got to use 5000,50. It was just to get the optimum between getting a good approximation of the movie (movement intensity) and still watching the test file to assess the quality. That includes at least 10 scenes. Probably I will double the value to 10000,100 from now on (when I do a test at all).
I'll reply to the rest of your questions tomorrow
Thanks in advance!
tripex
8th February 2007, 03:57
I have an additional question. When it says, 98 or 99% of the maximal reachable quality are reached after 3 passes, how much around are reached already after 2 passes?
CU
Andy
tripex
14th February 2007, 23:40
Hmm, after all no more answers? Hope I haven't done something wrong.
If I only wouldn't be so curious...
CU
Andy
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.