[MEncoder-users] Backup policies

Michael Rozdoba mroz at ukgateway.net
Sat Nov 17 21:26:11 CET 2007


James Hastings-Trew wrote:
> infernix wrote:
>> This is what I thought first, but 
>> http://forum.doom9.org/showthread.php?p=996195#post996195 and countless 
>> CRF18 x264 encodes later, I'm only using 2pass if i need to squeeze 
>> something in a specific filesize :) 
>>   
> Maybe I don't have all the facts and I am sure someone here will correct 
> me if I am wrong, but whoever is making the claim in that thread that a 
> 2nd pass doesn't need to look any further ahead than 20 frames doesn't 
> understand how the bits are allocated on the second pass. If I have a 
> piece of video and the first half consists of a low motion scene of 
> people talking to each other over a table in a kitchen, and the other 
> half consists of people chasing around in a forest, and these two scenes 
> are more than 20 frames apart from each other, how in the world is a 20 
> frame lookahead going to know that the bits need to be spent mostly in 
> the second half, and not so much in the first half? Constant bitrate 
> will end up with bits being wasted in the low motion scene, or not 
> enough bits going into the high motion scene.

Firstly I initially thought infernix's claim must be wrong or 
misunderstood. Then I looked at the reference. I don't think the post in 
isolation is sufficient, but the thread as a whole is very informative. 
I also realised at best there was an element of misunderstanding here; 
the quoted thread is certainly not wrong, since the main author is 
akupenguin the x264 author, who knows what he's talking about.

After reading the lot I'm left with more questions & less certainty than 
before, but I think I can make a few observations.

We are not comparing 2pass to a 1pass constant bit rate. The comparison 
is between 2pass & 1pass constant quality (ie option -crf <-> constant 
rate factor, certainly not -bitrate <-> constant bitrate or -qp <-> 
constant quantiser). Further, no one is claiming crf is better than 
2pass, but rather that it gets very close & could get extremely close if 
it was able to look ahead about 20 frames.

My immediate intuitive reaction is to say what if one has a video with 
30 minutes of a static scene followed by 30 minutes of noise? 2pass 
surely allocates most bits to the 2nd half while CRF, whatever it does, 
can't allocate different bit distributions in awareness of the 
distinction between 1st & 2nd halves (*).

The idea 2pass only looks 20 frames ahead surely can't be right?

Right, well, by my reading of the doom9 thread, firstly, 20 frames is 
approximate - there's an exponential decay of weighting. One thing 
akupenguin does make clear though is that influence on bitrate 
distribution certainly doesn't extend further ahead than one gop. So 
that still leaves my dilemma (*) above.

I think the only way to figure out what I'm misunderstanding (& others 
it seems) is to understand CRF better. It must already be doing a good 
enough job of bitrate shaping, that in the absence of any average 
bitrate constraints, 2pass doesn't need to do much more.

As I said, it's just left me with more questions :-/

/snip other valid points about why bitrate control is often important in 
practice

-- 
Michael Rozdoba



More information about the MEncoder-users mailing list