Log in

View Full Version : 2nd Renaissance Pt 1 brought RV9 and XviD to their knees! WMV9 to the rescue!?!


bleo
4th August 2003, 08:26
Firstly I must admit I'm an RV9 addict! 171 min one CD rips, full DVD res anamorphic encodes, RV9 handles everything I throw at it with aplomb! So, after ripping the Animatrix episodes and setting up an RV9 overnight batch encode, I went to bed confident of excellent results the next morning... (avgBitrate 1 Mbps, max 2 Mbps, anamorphic 1024(720)x~432, encodingComplexity very-high 85, maxStartupLatency 60, audio cook28 [96 kbps, custom DPL2 downmix (http://forum.doom9.org/showthread.php?s=&threadid=57988)])

Final Flight of the Osiris: mmm... nice!
2nd Renaissance Pt 1: argh wtf!!! RV9 choked badly on certain scenes! especially the bar scene, and where dog bites waiter's leg. Time to tweak the settings:
- Increase maxBitrate to 10 Mbps: avg 1 Mbps should be within the capabilities of RV9, especially with its growing reputation as THE anime codec, but perhaps it needs a little more than 2 Mbps max for those hard scenes? However 10 Mbps didn't help, RV9 doesn't seem to be going that high or 'varying' enough.
- Drop res to 640x272: still no good, bitrate not variable enough (?) Pre-roll only 4 sec, Avg QI 63, Min 57. I expect constant quality from 2 pass vbr!
- 640x272, vbrQuality 60, max 10 Mbps: total bitrate 1 Mbps, quality ok and constant, but I don't like vbrQuality mode because no size predictability...

Gave XviD a try (to see how much worse it could be :p settings: 640x272, ~900 kbps, H.263, VHQ4, chroma motion, qpel, 2 B frames)
Viewed without post-processing: argh! Severe blocking and ringing! Looks like Lego Man!
With post-processing: where are my glasses?!

Tried WMV9 (no high expectations, just another MPEG-4 codec right? :p settings: 640x272, 900 kbps, 8 sec key frame interval, better quality)
Results: omg! Clearly the best!? Never thought RV9 could be beaten!

***So, questions:***
Q. Is the 2 pass vbr rate control algorithm the bane of RV9? I know that RV9 is a great codec, but the occasional clip like this can always bring it to its knees. Actually, I've always noticed that RV9 isn't very 'variable', but I wasn't pushing the codec and it didn't matter so much. Why, when every other codec is spending so much time tweaking rate control algorithms? (DivX SBC, Manihi, XviD, et al.)

Q. What part of WMV9 makes it shine (or rather, not get screwed) on this clip? Not just another MPEG-4 codec??

ok, I know I could just use vbrQuality mode for better bitrate variability--but a bit of a pain to predict filesize; or tweak the individual Animatrix episode bitrates--side note: Kid's Story is sooo compressible! As demonstrated in 'Crazy bleo's <100 kbps challenge!' (settings: RV9, anamorphic 512(360)x216, 55q, Dup+DropDupe) stream it baby! :D

Sagittaire
4th August 2003, 09:12
WMV9 Anamorphique encoding is possible with Windows Media Encodeur and with wmv container ...

wmv is a compatible format with matroska too ... ;)

SeeMoreDigital
4th August 2003, 12:08
bleo

Although I'm very much aware that WMV9 (VCM) is very capable at encoding at low bitrates.

May I ask why you decided to encode with it at 640x272 (total 174,080) pixels. When your RV9 encode was encoded at 720x432 (total 311,040) pixels or maybe even 1024x432 (total 442,368) pixels?

Why not have another go at encoding with both WMV9 and RM9 using exactly the same settings. ie 720x576 (total 414,720) pixels and do away with the cropping and resizing method!

It's not failed me yet. And if you increase the bitrate of RM9 by 2.6% you can almost exactly match WMV9's video encoded file size.

Cheers

bleo
4th August 2003, 13:20
Don't get me wrong, I still love RV9, and this is not a proper codec comparison. What I wanted to highlight was these points:
- RV9 failed me on this clip. Big surprise!
- XviD also got screwed on this clip. No surprise! since I think it's worse than RV9 :p
- WMV9 didn't get screwed. Big surprise! because I also think it's worse than RV9 :p

So I, being a loyal RV9 fan, attempted to tweak it for better results. My theory was that the codec should steal more bits for the complex scenes. My experiments suggest these points:
- 2 pass vbr mode doesn't give constant quality over the entire clip. The complex scenes are worse quality.
- it steals bits only over a small window of ~4 seconds
- constant quality mode helps

I have 4 clips at 640x272 and 900 kbps (video only) to compare:
- RV9 2 pass vbr
- RV9 60q
- XviD sucked so bad that I shall not discuss further
- WMV9
RV9 60q is a bit better than 2 pass vbr for the complex scenes suggesting that RV9's 2 pass vbr algorithm could use some tweaking. However, the WMV9 clip is better than both! So, rather then join the Microsoft camp, I'm interested in why WMV9 wups ass on this clip, and consequently how should RV9 be improved to be more robust?

ps. I'm doing a 900 kbps 720x436 anamorphic WMV9 encode right now. Should the pixel aspect ratio be 64:45?

iwod
4th August 2003, 18:43
actually i heard Karl ' s partner is working on improving RV9 VBR - 2 pass..........

karl_lillevold
4th August 2003, 19:19
The problem in this clip, is that the codec is too variable in bitrate. Using D-C's RMVB analysis tool, interesting data can be found.
http://forum.doom9.org/showthread.php?s=&threadid=55392

In 2-pass VBR mode, the codec tries to achieve a constant quality, and when the scenes are so variable in complexity (fast high complexity motion, dark bar scene), way too many bits are allocated for the high complexity motion scenes, and too few bits for the easy scenes. In fact, the bitrate can vary as much as from 22 kbps to 4.5 Mbps!

In fact, for this particular clip, I am pretty sure 1-pass (or 2-pass) CBR will work better than VBR. The really high complexity fast motion scenes will suffer a little, but the low motion scenes will look much better.

31 Flavas
4th August 2003, 19:28
Originally posted by karl_lillevold

In fact, for this particular clip, I am pretty sure 1-pass (or 2-pass) CBR will work better than VBR. The really high complexity fast motion scenes will suffer a little, but the low motion scenes will look much better. Isn't the analysis pass useless for CBR? Or is there a difference between 1-pass CBR and 2-pass CBR?

karl_lillevold
4th August 2003, 19:42
There is a difference. For 2-pass CBR, the codec can better select the quality for each scene to avoid overspending bits. For 1-pass CBR, it can sometimes overspend during scenes that become too complex too fast.

This actually means that 1-pass CBR (and VBR) will let you use more of the bit reservoir than 2-pass, and you will end up with a larger total filesize. In some cases, that might be exactly what is needed for unusual and perhaps short clips.

p.s. check that wmv9 does not overspend bits too badly and that you are indeed comparing apples to apples. However, I can easily admit the current RV9 2-pass VBR scheme does very poorly on this particular clip.

bleo
5th August 2003, 08:28
Thank you Dark-Cracker for RMVB Analyser, it is exactly what I need!

It also showed me that my original hypothesis was wrong! As karl said, RV9 is TOO variable, and didn't leave enough bits for the SIMPLE scenes. (Thank you karl for setting me straight! and obviously, thank you for RV9 and your contribution to the doom9 community :)). Unfortunately, I first assumed that RV9 got screwed because it maxed out, when in fact it 'bottomed out'.

So, the scene where the dog bites the waiter's leg (1:24-1:27 PAL version) is actually a simple scene and RV9 used ~150 kbps when it obviously deserved more. Or perhaps it is something about the scene itself like being too 'flat' and dark, and the codec underestimated it or simply cannot handle it well (?)

Anyway, I have a question: what are the Pre-roll, Avg QI and Min QI values that Helix Producer reports?

[/edit]I'm learning :) Pre-roll/StartupLatency appears to be the buffer that the codec uses to exceed the MaxBitrate. So if you put max 2 Mbps, maxStartupLatency 60, the codec can (and does!) still go up to 6+ Mbps. And if you put max 10+ Mbps, Pre-roll gets smaller because it won't exceed that. Now, time to rethink my tweaking...

ps. didn't know about 2-pass CBR or vbrQuality! Perhaps I need to experiment some more! :)

[/edit]Is my understanding correct that in 1-pass CBR, the codec is aiming for the bitrate but still has to 'guess' the level of quantization to achieve it? Hence the use of 2-pass CBR?

[/edit]I took away RV9's 'free reign' by dropping maxBitrate to 2 Mbps and maxStartupLatency to 4. The opening sequence eased off and the bar scene cleared up as expected! I may tweak the settings some more, but, until the 2-pass vbr algo is improved, should we rethink our use of 'liberal' bitrate constraints? (e.g. maxStartupLatency 25-60 sec)