PDA

View Full Version : Effect of x264's --zones option on the averabe bitrate of the whole video


t3g
7th October 2007, 17:59
Hello,

I'd like to start using --zones to encode credits, but I've got a question about the way x264 will calculate the whole bitrate.

For example, I want the video to be 800Mo - the movie is 1:50'20 without the credits, and 1:54'14 with them.

Since the movie without the credits is 1:50'20, I should use --bitrate 1011, producing a 798Mo+the 2mo used by the credits (at 65kbps).

However, won't x264 apply the 1011 bitrate to the 1:54'14 movie with credits, then since I use --zones to ask for a 65kbps, recalculate a higher bitrate for the movie part?

In other words, if I use --zones, should I calculate the bitrate on the whole movie+credits length (1:54'14 here) so it would produce an 800Mo file without --zones, then set zone and let x264 increase the bitrate on the first 1:50'20 ?

Thanks

foxyshadis
7th October 2007, 22:26
If you use zones, and not concatenation, you don't need to worry about it. It'll probably only work for two-pass, if the end is so drastically different from the main movie. The two-pass rate control will just take the extra 30 megs or whatever you save and give it to the main movie, allowing the final average to be what you specify.

t3g
15th October 2007, 14:42
Thank you. My second pass just finished, and it worked as advertised, the first pass being 770Mo but x264 correcting the bitrate to achieve 800Mo in the second pass.

That's great - that way it's easy to add as many special zones in the movie - beginning, ending, and maybe inside the movie itself for the 1 or 2 scenes I can still see artifacts (not in this encode though, it's anime and the whole movie quality is perfect, not surprising since most of the time only 1 frame out of 3 has something changing :) ), without having to recalculate the bitrate. For 1 pass encoding, one would have to correct the bitrate himself, but since I never use 1-pass...

t3g
15th October 2007, 14:45
Just to sum it up simply if someone is wondering about the answer :
for 2 or 3 pass encoding, just calculate the bitrate on the whole video, then add as many zones as you want, the bitrate will be redistributed, thus achieving the exact size you were aiming for.