yingx2
25th December 2002, 16:02
Hi, all
Haven't spoken here for a while, but I have sereral questions that I really cannnot find the answers on my own, so I have to ask.
After finishing my 2-pass encoding job, I opened my analyse.log to figure out its quant distribution as usual. All of sudden I realized all of the quants are round numbers(such as 2,3,4,5) -- Non-integral quant values like 2.5 or 3.7 are not used at all
Does this mean that 2-pass encoding method are less flexible in terms of bitrate distribution than we thought? I know I must miss some simple point but I just couldnt figure it out myself, sorry.
And another thing is: In two pass mode, DivX 5.02 tends to save bitrates in early part of a movie using higher quant values, whlle enconding the last 1/10 of the frames at quant 2, whcih brings about "unbalanced quality". If the comp-test value is somewhere between 50%-80%, I would see the last 1/10 of frames all being enconded at quant 2 in the analyse.log, and the last 1/10 part of the movie might just be talking heads, or some less bitrate-demanding scenes, resulting in a "unintelligent bitrate distribution" of this encoding project. I know this has been mentioned before, but again I cannot find the solution.
I'm not talking about how to encode credits seperately. For example, I capture NBA games via MJPEG codec quite often, and later convert them into DivX AVI format. Sometimes the last 1/10 of the frames were extremely static scenes -- Commentators discussing about games. In that case, I would get undersized files since those scenes were so compressible that even if the codec assigned quant 2 to all of those frames, I still could not achieve my desired file size. This kind of encoding job always ends up with an avg quant like 3.12, not 2. This "quant 2 for the late part" tendency makes the codec lose the ability to encode movies intelligently.
Imagine this: A 200,000 frame NBA game consisting of 180,000 bitarte-intense frames in the first part, and 20,000 easy frames in the end. You want to fit it onto 2 CDs, so your bitrate combination is: 128kpbs for audio - 1617kbps for video. You select a proper resolution based on a comp value around 50%-80%. Finally, you end up with a 1,300MB file. So you open your analyze.log, trying to figure out what happened. Yes -- Quant 3, 4, 5 for the main part of the game that you want as good as possible, and quant 2 for trivial talking heads. So getting a undersized file itself becomes an irrelevant issue. The unintelligent bitrate distribution is the one that bothers you. Again, encoding those easy frames seperately is not what I'm looking for. Even if I take this approach, encoding the last 20,000 frames seperately, the codec would still encode the 180,000 frame part in two parts -- quant 2 for the last 18,000 frames, quant 3, 4, 5 for the first 162,000 frames. Any ideans?
I've heard that changing the RC period to half of the number of total frames makes the codec compensate better. However, I've done some tests and the results indicated that tweaking RC period makes practically no differeces to the quant distribution -- Yes, I opened log files to compare quant values line by line. (I tried default value, 1/2 of frames and total frames for RC averaging period) .
And I found an old thread where Acaila wrote : "The RC values are not used with 2-pass mode so you can forget about those". -- This is what I see so far.(http://forum.doom9.org/showthread.php?s=&threadid=22571)
But the people on the official DivX forum treat RC period really seriously, which contradicts all my tests.
http://forums.divx.com/viewtopic.php?topic=44129&forum=6
http://forums.divx.com/viewtopic.php?topic=44413&forum=6
Unfortunely, they did not provide any quant distribution comparison to convince me.
Either I'm or they are idiotic.
It seems they are not, as I'm now about to beilieve that 1-Pass quality-based 100% mode is the smartest VBR encoding method. It takes as much bitrate as" it needs" to maintain perferct quality in high-motion scenes, and it will never use 10,000kbps to encode simple frames like what MPEG2 codec does in constant bitrate mode -- It takes only what it needs to produce best possible picture quality.
I can fit Lord of the Rings onto "only" 4 CDs using 100%qb mode at full resolution, along with AC3 sound. Size unpredictability was a big problem. Here's what I did to make it come out exactly 2800MB:
1. Assume the credits is 30MB in size. (without sound)
2. Extract AC3 sound with DVD2AVI. Lets say it's 500MB in size.
3. Use divx5enc to do a comp test for the main movie. Now you get a predicted maximum file size. Let's say it's 2000MB.
4. Make sure "2800MB(4 CDs) - 30MB(credits) - 500MB(AC3 sound) - interleaving&frame overhead (Let's say it's 20MB) = maximum file size predicted above" It's 2250MB in this case
5. 2250MB doesn't equal to 2000MB. In order to make it 2250MB, you need to try a sharper resize method. The original resize parameter is "BicubicResize (720,304,0.333,0.333)", so you change it to (720,304,0,0.5) and run a comp test again. Do it serveral times until the predicted maximum file size is somewhere near 2250MB. Once it's close enough, you can start to encode it using 1-Pass QB 100% mode. There are several DivX encoding parameters whcih can help you shrink or enlarge a file, but I think changing resize parameter is enough. I only use B-frames and leave everything else as default.
6 The predicted size should be pretty close to the actual size. If the predicted size is not so accurate, and your actual file size is just 2200MB, that's ok. All you have to do is make the credits 80MB. (30+2250-2200). In fact, credits of 80MB isn't OK to me. The acceptable range to me is somewhere between 5MB and 50MB. So I have to try another resize parameter and encode the main movie part again.
Most movies won't require more than 3 CDs with this kind of "maximum quality ripping machanism". If using 2 CDs to backup a DVD movie is acceptable to you, why not use 1 or 2 more CDs to produce the best quality possible? Is it overkill to encode movies this way? Well, it's all about personal taste. People with trained eyes are more likely to see minor compression artifacts we don't see. They need much more bitrate to watch a movie comfortably, so they might be willing to take this approach.
I use it just because I think DivX5's 2-pass mode is not intelligent enough on bitrate allocation. But sometimes I would also ask myself : Is 2GB or 3GB really too large for a movie? I'm sure that 2 years later, I will watch these movies again, and what I will care then is how good they are, not how small they are. Because I'll need something big enough to feed my 1TB HD and my double-layer double sided DVD-R discs.
Don't make me look too bad, please. It's already painful for a non-native English speaker to type so many words in English. I'm not trying to convine anyone of anything. I'm just sharing my ideas, asking questions and expecting your precious opnions. Thanks for taking the time reading this crap, and Merry Christmas to all!!
Oh, my last question: How do you pronounce the word "DivX" ?
Haven't spoken here for a while, but I have sereral questions that I really cannnot find the answers on my own, so I have to ask.
After finishing my 2-pass encoding job, I opened my analyse.log to figure out its quant distribution as usual. All of sudden I realized all of the quants are round numbers(such as 2,3,4,5) -- Non-integral quant values like 2.5 or 3.7 are not used at all
Does this mean that 2-pass encoding method are less flexible in terms of bitrate distribution than we thought? I know I must miss some simple point but I just couldnt figure it out myself, sorry.
And another thing is: In two pass mode, DivX 5.02 tends to save bitrates in early part of a movie using higher quant values, whlle enconding the last 1/10 of the frames at quant 2, whcih brings about "unbalanced quality". If the comp-test value is somewhere between 50%-80%, I would see the last 1/10 of frames all being enconded at quant 2 in the analyse.log, and the last 1/10 part of the movie might just be talking heads, or some less bitrate-demanding scenes, resulting in a "unintelligent bitrate distribution" of this encoding project. I know this has been mentioned before, but again I cannot find the solution.
I'm not talking about how to encode credits seperately. For example, I capture NBA games via MJPEG codec quite often, and later convert them into DivX AVI format. Sometimes the last 1/10 of the frames were extremely static scenes -- Commentators discussing about games. In that case, I would get undersized files since those scenes were so compressible that even if the codec assigned quant 2 to all of those frames, I still could not achieve my desired file size. This kind of encoding job always ends up with an avg quant like 3.12, not 2. This "quant 2 for the late part" tendency makes the codec lose the ability to encode movies intelligently.
Imagine this: A 200,000 frame NBA game consisting of 180,000 bitarte-intense frames in the first part, and 20,000 easy frames in the end. You want to fit it onto 2 CDs, so your bitrate combination is: 128kpbs for audio - 1617kbps for video. You select a proper resolution based on a comp value around 50%-80%. Finally, you end up with a 1,300MB file. So you open your analyze.log, trying to figure out what happened. Yes -- Quant 3, 4, 5 for the main part of the game that you want as good as possible, and quant 2 for trivial talking heads. So getting a undersized file itself becomes an irrelevant issue. The unintelligent bitrate distribution is the one that bothers you. Again, encoding those easy frames seperately is not what I'm looking for. Even if I take this approach, encoding the last 20,000 frames seperately, the codec would still encode the 180,000 frame part in two parts -- quant 2 for the last 18,000 frames, quant 3, 4, 5 for the first 162,000 frames. Any ideans?
I've heard that changing the RC period to half of the number of total frames makes the codec compensate better. However, I've done some tests and the results indicated that tweaking RC period makes practically no differeces to the quant distribution -- Yes, I opened log files to compare quant values line by line. (I tried default value, 1/2 of frames and total frames for RC averaging period) .
And I found an old thread where Acaila wrote : "The RC values are not used with 2-pass mode so you can forget about those". -- This is what I see so far.(http://forum.doom9.org/showthread.php?s=&threadid=22571)
But the people on the official DivX forum treat RC period really seriously, which contradicts all my tests.
http://forums.divx.com/viewtopic.php?topic=44129&forum=6
http://forums.divx.com/viewtopic.php?topic=44413&forum=6
Unfortunely, they did not provide any quant distribution comparison to convince me.
Either I'm or they are idiotic.
It seems they are not, as I'm now about to beilieve that 1-Pass quality-based 100% mode is the smartest VBR encoding method. It takes as much bitrate as" it needs" to maintain perferct quality in high-motion scenes, and it will never use 10,000kbps to encode simple frames like what MPEG2 codec does in constant bitrate mode -- It takes only what it needs to produce best possible picture quality.
I can fit Lord of the Rings onto "only" 4 CDs using 100%qb mode at full resolution, along with AC3 sound. Size unpredictability was a big problem. Here's what I did to make it come out exactly 2800MB:
1. Assume the credits is 30MB in size. (without sound)
2. Extract AC3 sound with DVD2AVI. Lets say it's 500MB in size.
3. Use divx5enc to do a comp test for the main movie. Now you get a predicted maximum file size. Let's say it's 2000MB.
4. Make sure "2800MB(4 CDs) - 30MB(credits) - 500MB(AC3 sound) - interleaving&frame overhead (Let's say it's 20MB) = maximum file size predicted above" It's 2250MB in this case
5. 2250MB doesn't equal to 2000MB. In order to make it 2250MB, you need to try a sharper resize method. The original resize parameter is "BicubicResize (720,304,0.333,0.333)", so you change it to (720,304,0,0.5) and run a comp test again. Do it serveral times until the predicted maximum file size is somewhere near 2250MB. Once it's close enough, you can start to encode it using 1-Pass QB 100% mode. There are several DivX encoding parameters whcih can help you shrink or enlarge a file, but I think changing resize parameter is enough. I only use B-frames and leave everything else as default.
6 The predicted size should be pretty close to the actual size. If the predicted size is not so accurate, and your actual file size is just 2200MB, that's ok. All you have to do is make the credits 80MB. (30+2250-2200). In fact, credits of 80MB isn't OK to me. The acceptable range to me is somewhere between 5MB and 50MB. So I have to try another resize parameter and encode the main movie part again.
Most movies won't require more than 3 CDs with this kind of "maximum quality ripping machanism". If using 2 CDs to backup a DVD movie is acceptable to you, why not use 1 or 2 more CDs to produce the best quality possible? Is it overkill to encode movies this way? Well, it's all about personal taste. People with trained eyes are more likely to see minor compression artifacts we don't see. They need much more bitrate to watch a movie comfortably, so they might be willing to take this approach.
I use it just because I think DivX5's 2-pass mode is not intelligent enough on bitrate allocation. But sometimes I would also ask myself : Is 2GB or 3GB really too large for a movie? I'm sure that 2 years later, I will watch these movies again, and what I will care then is how good they are, not how small they are. Because I'll need something big enough to feed my 1TB HD and my double-layer double sided DVD-R discs.
Don't make me look too bad, please. It's already painful for a non-native English speaker to type so many words in English. I'm not trying to convine anyone of anything. I'm just sharing my ideas, asking questions and expecting your precious opnions. Thanks for taking the time reading this crap, and Merry Christmas to all!!
Oh, my last question: How do you pronounce the word "DivX" ?