PDA

View Full Version : How did Doom9 determined what the video bitrate should be for WM9 for his codec test?


Sgt_Strider
5th May 2003, 07:42
I'm sorry if I missed it in the article but since there are no WM9 calculator for calculating 2 pass bitrate, how did doom9 determined the video bitrate? Thx

CaptainCarrot
5th May 2003, 12:22
He probably used simple math?
Like (700MB-(audiosize))/(movie's lenght in sec)*8*1024*1024=Bitrate in bps. Maybe he did an additional overhead correction, but I wouldn't know how to calculate that.

Regards

Doom9
5th May 2003, 13:40
as every other codec, you can set a bitrate in bits/second during codec setup. And GordianKnot does all the overhead calculations for you. I checked that the 1k = 1000 in WMV9 (SBC which is based on an earlier MS product used 1k = 1024), and from that point on you can safely use the GKnot calculations for Divx5.

amirm
5th May 2003, 17:07
BTW, does anyone know who did this test and how to contact them? There are a couple of mistakes in the article I like to correct but couldn't find any contact info of any kind in there (I am sure it is in there and I am too blind to see it :)).

Thanks,
Amir

Doom9
5th May 2003, 18:47
amir: strange that you would mention that.. I sent an email to the address in your forum profile 3 weeks ago asking for encoding advice.. and I never got an answer.
I did everything in and around this article (except for supplying parameters and gabest gave me some pointers for the screenshot taking).
Use the feedback address mentioned here: http://www.doom9.org/contact_info.htm

amirm
6th May 2003, 01:06
Originally posted by Doom9
amir: strange that you would mention that.. I sent an email to the address in your forum profile 3 weeks ago asking for encoding advice.. and I never got an answer.
I did everything in and around this article (except for supplying parameters and gabest gave me some pointers for the screenshot taking).
Use the feedback address mentioned here: http://www.doom9.org/contact_info.htm

Sorry, I was out on vacation and don't frequent this forum enough to get PMs usually :). I just checked btw and there was no message there relating to this.

But thanks for the link. Will follow up on that.

Amir

amirm
6th May 2003, 04:05
Two more thing while we are here.

There has been a lot of discussion in this forum (and in this test) regarding the trade off between detail/resolution in the image and compression artifacts. While we still believe the average user easily trades compression artifacts for resolution, we nevertheless wanted to give you the choice to make that call yourself.

To that end, here is a way to tune the post-filter in WMV9 decoder to get sharper images (but with possibly more compression artifacts). Use regedit to find the following key:

\HKEY_CURRENT_USER\Software\Microsoft\Scrunch\Force Post Process Mode

This is a DWORD value. The valid value is from 0 to 4, 0 being turning off post filter and 4 being the strongest. If the value is outside this range, the decoder will use the automatic mode to decide the post filter strength.

By setting the appropriate value, you should be able to easily trade off the two parameters stated above. Of course, this also changes the equation drastically wrt to observations made in the codec tests.

Second note is about the comment on High Defintion video. The new Terminator 2 movie that is coming out on June 3rd, has the complete movie in High Definition WMV9 on a second DVD. The resolution of the WMV9 clip is 1440x1080 which is the same as professional HDCAM cameras used to shoot most digital films/effects shots. This resolution is well in excess of 720p (1280x720) which is considered high definition in everyone's book (ABC broadcasts in it in US). So the assertion that our High Definition content is not HD is incorrect -- certainly in the case of T2. We also have a number of HD clips on our web site at 720p. You can download them from here (http://windowsmedia.com/9series/DemoCenter/VideoQuality.asp?page=6&lookup=VideoQuality) and see the quality yourself.

Amir
Microsoft

Sirber
6th May 2003, 04:16
We're sorry. This Windows Media 9 Series content is only available to be viewed using Internet Explorer.

Learn more about Internet Explorer.

Bravo Microsoft :devil:

Can't make your web site compatible with other browsers? lol. That's Microsoft spirit.

amirm
6th May 2003, 05:01
I am sorry. I don't know why this message would pop up since clearly the content has no dependency on the browse. I have asked someone to investigate.

Meanwhile, here is the link to the liquid clip (http://download.microsoft.com/download/b/d/2/bd2ef814-9577-4d2e-a79e-35615ac7b13f/liquid_2.exe).

And the confidence trailer (http://download.microsoft.com/download/c/9/c/c9ccbbeb-c131-4877-b5bd-e043cf8af8dd/confidence_trailer.exe).

And for those of you intersted in compressing cartoons and other synthetic content, you may want to see this computer generated animation (http://download.microsoft.com/download/3/1/a/31a2e752-a74c-4935-a85b-3f3143cb53af/indy.exe).

Note that you need a high power machine for above. 2.4Ghz P4 is recommended or equiv (some will play in slower machines).

Amir

Ramirez
6th May 2003, 05:47
Impressive clip, but kind of noisy though,a little bit of convolution3d might be used here.

@Sirber
What's wrong buddy? You're in a bad mood lately, I think I know why but come-on just forget it and move forward.

Oh yeah, and is it really bothers you so much that WMV9 isn't playable under Linux?
Just reviewing your signature.. :rolleyes: :)

amirm
6th May 2003, 07:15
The liquid clip has a ton of film noise. It was shot on grainy 35 mm (high-speed) film. We did this encoding as part of our digital cinema roll out. In these projects, it is essential that the original "film look" with grain and all is preserved. This is the way the producers want it. Many times when you filter film, it gets that clean "video" look which they hate.

We took special pain to make sure at HD data rates and resolution that we preserve every bit of detail, including noise. The clip would have been much easier to encode if we had pre-filtered it. But that would not have been representative of the requirements for that market. Indeed, compared to other modern codecs, we are unique in our ability to do this at HD resolutions.

Amir

trbarry
6th May 2003, 07:41
Amir -

I still believe post processing should always have a built-in producer pleasing grain&noise generator.

And I'm always impressed and amazed at how you can keep a straight face while diplomatically typing how it is worth while to spend 1/3 or so of the video bandwidth preserving grain. ;)

- Tom

CaptainCarrot
6th May 2003, 14:06
Once again back to the thread headline...
I did some wmv-encodes with gknot-calculated bitrates, and they're all abot 2 percent oversized. 2 percent? Hm...
So I took the gknot-bitrate and divided it by 1.024. And guess what? I get the filesize I was aiming at.
My example:
gknot with divx: 941kbit/s, 547 MB
wmv with 941000 bit/s, 560 MB
wmv with 941000/1.024=919000 bit/s, 547 MB
This means that when you tell wmv9 to encode at 919000 bit/s, wmv takes this as 919.000 kbit/s with k=1024.
The tab is crap.
amirm?

EDIT: Btw. this explains the oversized wmv9-files in doom9's codec comparison.

Sirber
6th May 2003, 14:27
Originally posted by Ramirez
@Sirber
What's wrong buddy? You're in a bad mood lately, I think I know why but come-on just forget it and move forward.

Oh yeah, and is it really bothers you so much that WMV9 isn't playable under Linux?
Just reviewing your signature.. :rolleyes: :)

I just hate when I can't view a webpage because I don't use IE. About Linux, it's important because I want to use linux someday, maybe Gentoo. From now, I only use Windows because I have games to play.

ooops!
6th May 2003, 14:50
Amazing! I used to be a DivX nut until I experimented with WM9. I can honestly say that if it wasn’t for the fact it takes such a long time to encode/create a 2pass WM9 file I would encoding with it all the time!

To work out the finished file size, isn’t all that difficult.

Lets say you wanted to encode 137mins worth of audio and video and fit it onto a 700MB CD

137mins = 8,220secs.
8,220secs x 700MB = 5,754,000
5,754,000 / 1024 = 5619.1406
5619.1406 / 8 = 702kbps total

So you now know you’ve got a total of 702kbps to play with. If you decide to use say, 64kbps for the audio that leaves 638kbps for the video – Job done!

I personally would encode the video at around 630kbps just to be sure. However, using this method has never let me down and I’ve encoded over 20 films to 2pass WM9. All of which have different run times and all of which fit onto a 700MB CD.

Now you would think that 137mins of audio and video would look and sound pretty crappy but if you try it for yourself you would become a WM9 covert, just like me and so many other people.

I just use the std WM9 encoder (v9.000.00.2980) and encode the audio and video in separate runs.
I then use the WM Stream Editor to mux the audio and video back together.

As I said before it takes a very long time to encode/create WM9 files. I have a 2.8Ghz P4 with 1024MB of ram and it still takes a long time. The first pass typically encodes/reads at 16-17 fps and the second pass typically encodes at 5-6 fps - Austin Powers ‘Goldmember’ took 9hours 8min and 52secs!

The WM9 High Defintion T2 disc info is very interesting. But I presume like alot of good things, this will only be available in the USA and Canada - right!

amirm
6th May 2003, 15:42
Originally posted by trbarry
Amir -

I still believe post processing should always have a built-in producer pleasing grain&noise generator.

And I'm always impressed and amazed at how you can keep a straight face while diplomatically typing how it is worth while to spend 1/3 or so of the video bandwidth preserving grain. ;)

- Tom

You caught me Tom :). To be honest, I am not a fan of the liquid clip. As a long time 35mm photographer, I have always despised film grain and used to use extremely slow slide film to get around it. I think using high-speed film is cheating your way out of a hard problem (how to properly expose the picture using higher resolution, cleaner film stock).

The real reason why I care about preserving film grain isn't for grain but for preservation of detail which is very important in anything you call HD. Film grain happens to be the pathologically worse case scenario.

Back to topic of file size, I really don't remember which unit we use now but do seem to recall these days. I will check and report back.

Amir

trbarry
6th May 2003, 17:18
The real reason why I care about preserving film grain isn't for grain but for preservation of detail which is very important in anything you call HD. Film grain happens to be the pathologically worse case scenario.

Amir -

I guess the original title question has been long since answered but I still apologize to all for the OT thread hijack. I'll drop the grain comments after this.

But let me just add that, in the presence of strong grain, I think the signal to noise ratio of the higher frequencies rapidly reaches a point of diminishing returns where you can't say you still have that detail anyhow. That is, if filtered, the human eye may notice those frequencies are missing but would not really get much real texture infomation from them if they were still present. So you could maybe just supply post processing noise.

Done now.

- Tom

trbarry
6th May 2003, 17:28
Amazing! I used to be a DivX nut until I experimented with WM9. I can honestly say that if it wasn’t for the fact it takes such a long time to encode/create a 2pass WM9 file I would encoding with it all the time!

You might experiment with that performance slider. It seems you get most of the benefits with it just 1 or 2 notches from the left and yet extreme differences in speed.

- Tom

Doom9
6th May 2003, 18:48
@CaptainCarrot: you're mistaken. I did a quick calculation using 1k = 1024 as basis and with that the matrix clip should've been 703201 KB rather than 716800, in other words: undersized. Furthermore, I tried out the wm9encoder, where you can enter kbit/s amongst other bitrates... and when I entered 1kbit/s guess what the program wrote in another screen regarding the bitrate: 1000bits/s. I did the same calculation for spr and there again.. if you divide the video size by 1.024 you get an undersized file.

@amirm: you should offer those settings via a playback filter so everybody can easily set it ;) As for HD-DVDs.. full HDTV resolution is 1920x1080, and the already released DVD contains a 1024x576 WMV9 stream.

CaptainCarrot
6th May 2003, 23:34
@Doom9
If I take your wmv9-filesize of 727'886KB and divide it by 1.024, that gives me 710'826KB. Still undersized, yes, but not that bad anymore. [\EDIT] I forgot to substract the audio before dividing, if you do that, you end up with 713'737KB, a little better even if you take the overhead into account that has not been substracted[EDIT]
And I'd not be too sure that wm9encoder calculates that correctly. But just took make my point clear: I'm basicly just guessing wildly, maybe wm9 is just doing oversized files all the time, and it happens to be roughly 2 percent.
Fact is that for the last two movies I did wm9 with (DivX-Bitrate in kbit/s)*1000/1.024 gave the roughly the same size (same MB) as DivX with the Bitrate used for the above calculation. But as I said, it may all be coincidence. Maybe amirm can shine some light on this.
And just for the usability of the codec: If I try to put a movie on a CD, 6MB less than calculated is something I can live with, 10MB too much won't fit on the CD. But I'll do some further testing.

Doom9
6th May 2003, 23:57
you're making a mistake departing from the complete filesize.. you must not multiply overhead and audio file by the correction factor.. only the size of the video ;)

CaptainCarrot
7th May 2003, 00:13
@Doom9: Just found out about that error (See EDIT), but the result is actually getting better ;)

EDIT: I just calculated it for spr, with overhead:
(1'460'384-157455-11948)/1.024+157455+11948=1'430'013
This would be 3.5MB undersized

Sgt_Strider
7th May 2003, 06:14
Originally posted by ooops!
Amazing! I used to be a DivX nut until I experimented with WM9. I can honestly say that if it wasn’t for the fact it takes such a long time to encode/create a 2pass WM9 file I would encoding with it all the time!

To work out the finished file size, isn’t all that difficult.

Lets say you wanted to encode 137mins worth of audio and video and fit it onto a 700MB CD

137mins = 8,220secs.
8,220secs x 700MB = 5,754,000
5,754,000 / 1024 = 5619.1406
5619.1406 / 8 = 702kbps total

So you now know you’ve got a total of 702kbps to play with. If you decide to use say, 64kbps for the audio that leaves 638kbps for the video – Job done!

I personally would encode the video at around 630kbps just to be sure. However, using this method has never let me down and I’ve encoded over 20 films to 2pass WM9. All of which have different run times and all of which fit onto a 700MB CD.

Now you would think that 137mins of audio and video would look and sound pretty crappy but if you try it for yourself you would become a WM9 covert, just like me and so many other people.

I just use the std WM9 encoder (v9.000.00.2980) and encode the audio and video in separate runs.
I then use the WM Stream Editor to mux the audio and video back together.

As I said before it takes a very long time to encode/create WM9 files. I have a 2.8Ghz P4 with 1024MB of ram and it still takes a long time. The first pass typically encodes/reads at 16-17 fps and the second pass typically encodes at 5-6 fps - Austin Powers ‘Goldmember’ took 9hours 8min and 52secs!

The WM9 High Defintion T2 disc info is very interesting. But I presume like alot of good things, this will only be available in the USA and Canada - right!

STD Wm9 encoder dude? What's that?

amirm
7th May 2003, 07:15
Originally posted by Doom9

@amirm: As for HD-DVDs.. full HDTV resolution is 1920x1080, and the already released DVD contains a 1024x576 WMV9 stream.

I have never heard the term "full HDTV." Are you saying ABC broadcast network in US is lying when they say they are broadcasting in HD because they do so in 720p instead of 1080? If so, I think the rest of the world would disagree with you :).

Note that we would have been more than happy to encode the Shadows DVD at 1080p but there were not enough space on the second DVD to do so (they wanted to have a ton of other bonus material there). The space that we were given allowed a data rate of roughly 4Mbit/sec -- almost 50% less than the standard resolution MPEG-2. We managed to get 70% more pixels despite such a low data rate. Most people are quite impressed by this.

As I mentioned, T2 will be at 1440x816 anomorphic meaning that decode will be at 1920x816, compliant with one of the 1080p profiles (HDCAM). Since most people don’t even have displays with such a high resolution, I would say our resolution is as “full” as one would want right now :).

At the end, I am not sure what point you wanted to make here. If the point was that our technology can't do true HD, then the trailers our our web site and T2 are proof that that assertion is not correct.

Amir
Microsoft

Atamido
7th May 2003, 07:59
Originally posted by amirm
I have never heard the term "full HDTV." Are you saying ABC broadcast network in US is lying when they say they are broadcasting in HD because they do so in 720p instead of 1080? If so, I think the rest of the world would disagree with you :). I think he would be speaking about the maximum defined resolution for HDTV/DVB as there are many. I think refering to it as Full would probably be accurate, though even 704x480@30P is also 'HDTV'. For everyone's benefit I'll just copy this from the HDTV/DVB forum FAQ. (http://forum.doom9.org/showthread.php?s=&threadid=41588)
Vertical Aspect
lines Pixels ratio Picture rate
1080 1920 16:9 60I, 30P, 24P
720 1280 16:9 60P, 30P, 24P
480 704 16:9,4:3 60P, 60I, 30P, 24P
480 640 4:3 60P, 60I, 30P, 24PThe space that we were given allowed a data rate of roughly 4Mbit/sec -- almost 50% less than the standard resolution MPEG-2. We managed to get 70% more pixels despite such a low data rate. Most people are quite impressed by this. That is not quite correct. Most DVD's have an average video bitrate of 3.5mbps, and only specialy encoded DVD's, such as the SuperBit ones will ever come close to reaching the maximum 9.8mbps rate. Check the DVD FAQ (http://www.dvddemystified.com/dvdfaq.html#3.4) for more information.

It should also be noted that doubling the video resolution does not necessarily double the required bitrate. In fact, as you increase resolution, the required bits/pixel begins to drop off rapidly. I am to tired at the moment to explain the science of it, but I'm sure someone has spoken about it before.As I mentioned, T2 will be at 1440x816 anomorphic meaning that decode will be at 1920x816, No, this means that the decode will be at 1440x816. If you display it on a display running 1920x1080 with square pixels, then it will indeed stretch out the the video to 1920x816, but this is not the same thing.Since most people don’t even have displays with such a high resolution, I would say our resolution is as “full” as one would want right now :).This is definately true. I am sitting here looking at my 21" Trinitron monitor, and it only has a native resolution of 1600x1200, nowhere near the required resolution for displaying the full 1920x1080 HDTV image. Of course, it will be able to fully display the WM9 content on T2 encoded at 1440x816, and I will be looking forward to that.

I firmly believe that the BlueRay group made a mistake in going with MPEG-2 for their new high resolution disks. I'm not saying that WM9 would have been the right choice, but it would have been a better one. I look forward to seeing more movies encoded at such a high resolution, and I hope that my poor CPU can handle the strain.

Atamido
7th May 2003, 08:28
Reading back over my post I realized that people may get the wrong impression. WM9 is a very advanced codec and I can't wait to see how it was able to with T2 at such an admittadly low average bitrate.

I am not personally a fan of the idea of a proprietary codec becoming the standard for HDTV encoding, but I will take what I can get. And if MS is the one delivering, then hook me up to the IV.

ooops!
7th May 2003, 11:57
> Sgt_Strider

The std WM9 encoder (v9.000.00.2980) is a Microsofts 'stand alone' encoder. They've made variations of the encoder for years.

The main problem with the earlier encoders were that they were not much good. As there were better codecs with simpler interfaces out there.

The WM9 encoder is different however, although it's still not the easiest to use. For WinXP/2000 users it is available here: -

http://www.microsoft.com/windows/windowsmedia/9series/encoder/default.aspx

If you require a simpler approach, you could try Microsofts new, but unsupported WM9 encoder. Which after installation should be accessible from within your favourite/most used DivX or Xvid encoder applications. It's available here: -

http://www.microsoft.com/windows/windowsmedia/9series/codecs/vcm.aspx

Hope this helps

ooops!
7th May 2003, 12:48
Also, what you have to remember. All TV resolutions have to be a compromise....

Just as with all DVD’s marked ‘wide screen’, HD TV is broadcast using a 16:9 (1.77:1) background. This is so all owners of wide screen TV’s are able to see the received image at it’s best.

Owners of 4:3 (1.33:1) TV’s are compromised because they have to reconfigure their set top boxes (DVD players and/or HD receivers) to tell it, that it’s connected to a 4:3 TV.

Therefore if you are an owner of a wide screen (1.77:1) TV and you view a DVD, which is also 1.77:1. The picture will fill the screen and use all the vertical lines available 576(PAL). However, if the same DVD is viewed on a 4:3 TV, the viewer will also see black bars at the top and bottom of the screen and the ‘image’ will now only have 416(PAL) vertical lines.

And the wider the aspect ratio gets (1.85:1, 2.35:1 etc), the less vertical lines will be available on a 4:3 TV screen.

Sad but true, but I don't know if it helps much!

PS: I really want a copy of the T2 WM9 encoded DVD please....... Remember it's always better to give than to recieve!

trbarry
7th May 2003, 16:21
No, this means that the decode will be at 1440x816. If you display it on a display running 1920x1080 with square pixels, then it will indeed stretch out the the video to 1920x816, but this is not the same thing.

I think this is only partially true. ATSC HDTV 1080i resolution transmit the full height of 1080 (actually 1088) lines in the 1080i mode, even when the aspect ratio is wider like the 2.35:1 ratio used in T2. But this means space is wasted sending black bars.

But Microsoft is not required to do this on a WM9 DVD, and didn't. So while the height is only 816 it is still vertically equivalent to 1080 since it is easy to put the black bars on. No vertical resolution is lost here, just bytes saved. The vertical resolution is not stretched, just padded.

The horizontal resolution is stretched but I frankly don't believe current telecine practices garner any effective horizontal resolution of more than 1440 from film based movies anyway. They certainly don't seem to on any OTA HDTV movies I've seen.

This is easy to test on any OTA HDTV capture. Just use LanczosResize to resize the width to 1440 and then immediately resize it back to 1920. Compare the results with the original either by eyeball or PSNR and see if anything is noticeably lost.

It never is.

- Tom

edit: just remembered I already posted a side by side screen shot demoing this from another post. This is from CBS Master's Golf which is already much crisper than the average HDTV film based movie. It shows both the original and the results of resizing to 1440 and back. Scroll & zoom as needed. See:

www.trbarry.com/Detail_1440x1080_0.18_Masters_Golf.jpg

Doom9
7th May 2003, 18:57
@amir: we're debating technicalities here. I revised my statement a bit and put in the actual resolutions of both WMV9 DVDs. But I won't give you the full HDTV bit. A DVD can be valid containing a VCD sized video stream compressed using MPEG-2 but would you call that a DVD? Most people here automatically assume DVDs are 720x480/576 despite the specs also allowing for lower resolutions.
But it would be nice if you could send me an email where I can contact you, to the address I gave above. If I ever include WMV9 in a test again I'd like to be able to get in touch before I actually start encoding, and not only after the article has been published.

Sgt_Strider
12th May 2003, 08:31
Originally posted by CaptainCarrot
@Doom9: Just found out about that error (See EDIT), but the result is actually getting better ;)

EDIT: I just calculated it for spr, with overhead:
(1'460'384-157455-11948)/1.024+157455+11948=1'430'013
This would be 3.5MB undersized

So have you figure it out yet? I know you're getting closer but since you had a bit of time, I'm wondering have you figure it out yet? Thx

Sgt_Strider
19th May 2003, 08:55
Uh maybe one of the microsoft representative can come here and explain the formula? Its funny that amirm has posted in this thread but didn't bother correcting anyone in here. I think it'll be best if either amirm or mingcl reply with the proper calculations. Thx

CaptainCarrot
19th May 2003, 09:08
@Sgt_Strider: The last tests I did (didn't have much time lately) with the bitrate divided by 1.024 came out a little bit undersized, so I guess the encoding engine is just a little bit unprecise and I was lucky with my first movies. However, when aiming for 1 CD the files where never undersized by more than ~3MB, and never oversized either, so taking the gknot-bitrate and dividing it by 1.024 doesn't seem to be the worst idea if you want to be sure to fit the movie on your CD. I haven't done any tests for 2 or 3-CD rips, maybe with a higher bitrate it's a diffrent story again.