Rendering WMV Via Sony Vegas

Blegne wrote on 2/8/2007, 2:47 PM
Hello,

I have some questions regarding outputting short video clips via Sony Vegas as Windows Media Video files. I’ve experimented with lots of different rendering variables within Sony Vegas and I was wandering if someone might be able to give me some feedback on things I might want to try.

I’ll try to be as specific as possible in my outline to give you the best idea on what I’m trying to accomplish here.

I have a bunch of guitar instructional/performance clips that I’m wanting to upload to my Windows streaming media server. The clips are all about 5 minutes in length and I’m trying to keep the overall file size below 15-20 MB per clip. For my template, I’m doing a 480x360 video frame with 128 kbps, 44 kHz audio, 29.97 fps, and either a 400 kbps or 500 kbps bitrate. Typically, most web sites stream videos at 320x240 but for the videos I’m doing, that is just too small a frame to make it worth the time. I chose 480x360 because that is half way between 320x240 and 640x480. 320x240 is just too small and 640x480 just requires too high of a bitrate to keep the video crisp. So the 480x360 frame seems to work fine. Also, I need the audio to stream at a minimum of 128/44 because anything below that threshold just sounds lousy. If these were just videos with voice, I could go lower, but since there is a lot of instrumentation contained within them, you really need the 128/44 to make it worth the effort.

So my main questions are regarding trying to decide between setting the audio and video at CBR (constant bit rates) or VBR (variable bit rates). My understanding is that variable bit rates might help to target a larger viewing audience, but they also create much larger files sizes, and file size is one of the main variables I need to keep in mind with this project. Too much file size = too much bandwidth = too much cost.

Another variable I don’t have any experience with is the keyframe. By default the seconds per keyframe is 3 but I’m wandering if setting this option either higher or lower is going to make much of a difference in the viewing experience?

Also, do you think a 500 kbps overall bitrate is too much to expect the average DSL/cable modem to handle? If the video frame was only 320x240, a 300 kbps bitrate works fine, but again that frame is too small for what I want to do. In my experiments, a 400 kbps bitrate would probably work, but things are a little fuzzy. A 500 kbps bitrate seems pretty good for the quality I’m looking for but I’m wandering if that is going beyond the threshold of what is considered acceptable for a DSL/cable modem setup.

Any feedback or tips anyone could provide would be excellent.

Comments

johnmeyer wrote on 2/8/2007, 3:40 PM
Average bitrate is the only thing that determines file size. VBR will give you better quality, but longer encode. The bitrate you choose will depend on the connection speed. Someone else can comment on 250K vs. 500K. Also depends on the speed of your server connection (i.e., both the speed of your client's connections and the speed of the host connection are important).

The WMV settings I use are Mode: Bit rate VBR (peak); Format: Windows Media Video 9; Image Size: Animation 320x240; Pixel Aspect: 1.000 (square); Frame rate: (I enter the frame rate of the original video). Average bit rate: 250K; Peak bit rate: 1,000K; Peak buffer size (sec): 20
Blegne wrote on 2/8/2007, 4:05 PM
Hello,

Thanks for your feedback. I really appreciate it. Here is another question for you. When choosing the Audio rendering option you are given the option of CBR or Quality VBR. I understand the CBR choices, but I don't get the Quality VBR options. For example, you have an option of VBR Quality 90, 44 kHz, stereo VBR. What does that mean exactly? In other words, what does the number 90 mean? With a CBR, you can choose something like 128 kbps, 44 kHz. What is 90, 44 kHz? Does that mean 90 kbps, 44 kHz?
totally lost wrote on 2/8/2007, 4:09 PM
I realize this is a very generalized question. But what is the average cost of a 5 minute download?

Can anyone give examples of bandwidth costs on sites they have. Does .flv hosting make the best sense.

What are the best flash video hosting options out there? Or wmv for that matter?
David Peterson Harvey wrote on 2/8/2007, 4:30 PM
My personal choice is to use CBR for audio because you get an overall better quality. With speech only, VBR can work fine. However, material with music generally sounds better when using CBR.

I've heard some music that chose a bitrate of 90 and sounded fine. I usually use a bitrate of 128 because it is closer to CD quality. You don't get the options with this because it is a constant bitrate. The quality VBR (variable bit rate) option sets the lowest quality you will allow for less active portions of the audio.

My personal preference with online video is to use 15 fps because it tends to stream better. I typically set up multimedia video at 320x240x15fps with CBR and a bitrate of 128 on audio. The results look really nice whether I render to WMV or incorporate it into a Flash video.

Using these settings, I get good results with my 5 mbps cable modem. I've checked with other users machines that have DSL (I think it's about 1.5 mbps) and there is some stopping while the video buffers but it is still really watchable.

The big trick is to figure out the lowest connection speed of the average user and base the video to play best at that speed while still giving you a good quality viewing experience.

With the new H.264 standard in Windows Media and Quicktime, you can render your video files to scale to the connect speed. I haven't been able to test results on slower systems but it seems to work fine from my cable modem connection.

Just my own preferences. Hope this is helpful to some of you on this thread.

Peace,
David
Rv6tc wrote on 2/8/2007, 5:36 PM
I recently did some test renders in .wmv. I was e-mailing some short video clips, and I found that the 2-pass CBR was the best combination of small file size and quality (sometimes nearly half the file size of similar VBR). Give it a try. I was shocked as I thougth the VBR would be the way to go, but for lower file size, the 2-pass worked great for me.

Keith
jaydeeee wrote on 2/8/2007, 5:50 PM
For video, I would also suggest 2-pass CBR (CBR for audio as well).
I'm not sure why some would say the VBR offers better quality, it's not true in many cases.
Blegne wrote on 2/9/2007, 8:40 AM
What exactly does the 2-pass CBR option do to the file? Most everyone has said to use 2-pass encoding but I can't tell much of a difference in viewing the file when comparing it to 1-pass encoding. There is a slight increase in overall file size, but that is the only thing noticeable to me. Maybe this 2-pass encoding would be noticeable on some clips more so than on others?
mikkie wrote on 2/9/2007, 1:12 PM
2 pass CBR is more or less useless. The purpose of 2 - 4 pass video rendering is to map out the amount of complexity involved in each frame -- the 2nd (or 3rd - 4th) pass then more accurately allocates the available bandwidth or bit rate across the length of the clip, giving more bandwidth where it needs it most. With a constant bit rate there is no need to allocate anything -- every frame has the same compression, so you're not accomplishing anything but giving yourself more time for coffee. ;?P

That's generally speaking for all encoding. When you get into the web formats like wmv etc., very often the minimum bit rate is set too low, giving a poor impression of VBR. However as on most retail DVDs, VBR is the way to go for better quality for a given size whether mp4 or mpg. Audio is the exception however if/when dealing with VBR MP3, which can suffer problems in playback.

If you find that a video looks better at a larger frame size, might want to consider either anamorphic or instructing the embedded player to show the video enlarged. Sometimes you can use a higher bit rate, increasing quality enough on a smaller frame that the result looks better when you rely on the client CPU &/or GPU for up-sizing.

Streaming is another ballgame -- some formats work better streaming with specialized media servers, others do better with the average host on the web. You just have to weigh things like encoder speed, quality, & file streaming vs popularity & availability of the necessary player.

Frame rate (frs) depends on how critical smooth motion is. If you can get away with 12, cool, and 15 is kind of average, especially with all the flash now-days. Best way to compare is by encoding both, or at least tests. Keyframes or I frames are when a full frame worth of picture is stored... In between you have a bunch of partial frames. The closer keyframes are together, the better the video looks, but it's also means bigger files -- you're storing more data. Fewer keyframes cause files to shrink, but can cause playback problems & are lower quality. Adjust it to what works for your video.

AFAIK the average web hosting service is going to charge by the megabytes or gigabytes downloaded, regardless how long it takes. When it comes to different bit rate encodes, some do scaling, others simply use a radio button, still others feel that's useless or too much compromise -- if you want to see the video either use broadband or download & view it off your hdd.

Microsoft has a lot of info on the wmv format available -- briefly CBR is just that, peak VBR allows you to specify bit rates, quality VBR lets you set a % of quality to maintain with less concern over size.
daryl wrote on 2/9/2007, 1:15 PM
Some time ago, someone on this forum posted a method that I've used almost exclusively ever since, it renders very sharp video. Use the 256 or 512 template, but change the video to VBR(Peak), change the frame-rate to 14.985 (half NTSC), average 250, peak 500. It has done a beautiful job for me every time.
johnmeyer wrote on 2/9/2007, 2:28 PM
Some time ago, someone on this forum posted a method that I've used almost exclusively ever since, it renders very sharp video. Use the 256 or 512 template, but change the video to VBR(Peak),

That may or may not have been me. In reading the earlier posts that state that VBR doesn't help much and they get better results with CBR (two pass), I'll have to admit that I haven't test this for awhile. However, back when I first started posting about using VBR (Peak) the real "discovery" were that the other two VBR options ("Quality VBR" and "Bit Rate VBR") didn't really seem to do a very good job. By contrast, the "Bit rate VBR (peak)" seemed to make a big difference.
johnmeyer wrote on 2/9/2007, 2:57 PM
FWIW, I got curious and re-did my test from a long time ago. I started with a 5-second AVI file and then encoded it to each of the WMV templates. I adjusted the framerate to match the source 29.97 and set the resolution to 320x240. I set the encoding quality to maximum, whenever that option was available. Finally, I set a target average bitrate of 250K and a peak (when available) of 1000K.

I found that the VBR encodes did not actually produce the desired average bitrate. Since file size is a function only of bitrate, the fact that these files were smaller showed that they did not match the target bitrate (I'm sure someone will say that resolution also affects file size, but that is not the case). As a result, I went back and did one more encode where I increased the VBR (Peak) bitrate in order to create a file size that matched the CBR encodes.

I then stacked these on the Vegas 7 timeline, looped them, and started looking at the results. I also stopped at various points and looked at still frames. If you look at the writing on the cab, the buttons on the shirt, the blue sky in the background, and the shadow under the building's eaves, you'll get some pretty good indication of which encode you like the best. The "Quality VBR" looks far better, but you have to throw that out because it clearly was encoding at a far different bitrate, since the file size is over 10x the size of the others.

Within those that were comparable, the two-pass CBR, and the VBR (Peak) adjusted upwards to provide the same file size (and thus the same average bitrate) seemed pretty comparable to me.

Of course you need to do a similar comparison on whatever footage you are planning to encode, and at the rates and resolutions you plan to use, in order to get a true indication of what you'll get (your mileage may vary ...).

Here's a link to all the files (good for seven days):

Vegas 7 WMV Encode Test
mikkie wrote on 2/10/2007, 5:03 PM
Generally I think mpg2 is the only popular codec where the minimum bit rate can be super low. With the mpg4 varieties IMHO you'll get much better results keeping the different VBR settings a lot closer together... The max rates aren't enough to really do a great job with such high compression anyway, and the lower rates cause the majority of problems 90% of viewers/users complain about. Myself I try to only allow a slight boost for motion scenes & transitions, for example min of maybe 350 - 400 with 500 max -- but I always run a short test to fine tune.

Bear in mind that the Vegas wmv encoding routine softens the image compared to the stand-a-lone. Also remember that wmv hasn't really been updated for several years -- when you don't have to go wmv, xvid & even Nero do *Much* better re: speed & quality. If you're both going tiny & want to focus on center frame detail, try an intermediate encode to Real using a higher than final bit rate. [you can find tons of info on the background softening in Real - reserves band width for center or foreground subject].

With Winmedia, Quality VBR is good for, perhaps intended for original capture/creation & intermediates. It might not be as horsepower & time friendly as avi or mpg2, but you certainly don't have any color issues, & on less than great sources this can actually help quite a bit.

At any rate, CBR is safe & perfectly fine if/when you don't want to fiddle & adjust VBR settings, or take the extra encode time. VBR ideally works with wmv the same way as on DVD mpg2, giving just enough boost to get you through the higher motion scenes that CBR is guaranteed to mess up. But, again IMHO, the wmencoder9 is kind of dumb by today's standards, and if you have too great a range between bit rates, most of the time you're not going to be happy -- Keep them close enough to give a boost -- not cut file size -- That's what your overall average is for. Since more viewers are using XP, you can also play with anamorphic if you want.

Adding a FWIW ;?P
With so many divx capable DVD players, increasing amounts of web video, & HD compressed to mpg4, doesn't hurt any media folks to work with and get experienced with this stuff.
mikkie wrote on 2/10/2007, 9:15 PM
@John

Downloaded your samples & played around a bit -- if interested can post what I came up with, but not that much to see really.

I don't think your sample was a good demonstration of VBR, & I'd expect you were hard pressed to see the difference. Usually when I've had the most success, could really see the difference, there were low demand scenes, followed by a fast pan, dissolve, or faster action, then maybe a quieter conversation scene, that sort of thing. The sample, while good for basic tuning of a longer clip, didn't really vary that much in scene complexity.

OTOH it was pretty encoder complex because of the tree shadows & the difficult background behind the guy's head. The latter gave me the most problems, & I never completely got away from the flesh colored blur that followed his head across the corner of the building -- 'least not without exceeding my criteria....

With the interlacing effects so visible at the start on the cab door, I used the Vegas interpolate deinterlace to good effect. Also put the clip into full PC colorspace, tried a couple of methods of reducing the fps, and resized it to 320 x 480 before feeding it to the MS wmencoder 9 using the latest advanced profile, 96/48 audio, 1 keyframe per second, & peak vbr.

Usually I think the bandwidth for broadband talking heads is somewhere around 300 -- regular video on hdd around 1 - 1.3 meg using plain jane encoding -- and with post processing (like Nero Digital) somewhere between 700 - 800. In this case I wanted to sit around 300, but to minimize the head blur went to 24 fps in V/Dub using IVT & then resized there (V/Dub is sharper). I got a decent picture, unfortunately some minimal head blur, and came in at 147 kb.

Ironically the fewer fps, the more the blur appeared -- it was a matter of trading higher bit rate for fps -- so it became a judgment call with poorer general image & tree shadow problems vs. amount of head blur. In the end I thought the 24 fps easily won over 29...

In an interesting test I also took the original clip, & cut the fps to 15 in Vegas -- otherwise everything else was the same. The quality and file size were generally comparable with the bit rate raised by 100! What we really need is a tool like the apparently abandoned MS beta that allowed setting the bit rate per scene.
alltheseworlds wrote on 2/11/2007, 4:11 AM
Your chosen bitrate of 500K is so high that I'd use a 2-pass VBR FLV encode, then play it using simple progressive download, but with an adaptive preloader to 'sniff' the users' bandwidth and buffer accordingly... On2 Flix pro is excellent for this.
Stuart W wrote on 2/12/2007, 1:11 PM
"2 pass CBR is more or less useless. The purpose of 2 - 4 pass video rendering is to map out the amount of complexity involved in each frame -- the 2nd (or 3rd - 4th) pass then more accurately allocates the available bandwidth or bit rate across the length of the clip, giving more bandwidth where it needs it most. With a constant bit rate there is no need to allocate anything -- every frame has the same compression, so you're not accomplishing anything but giving yourself more time for coffee"

Not exactly. With CBR, the bandwidth is constant over a "buffer window" of usually a few seconds, but within that buffer the bandwidth can vary as much as it wants. Think of it as small chunks of VBR. So, yes, two pass CBR can improve the quality because it can improve the allocation of the bandwidth within the buffer window.
mikkie wrote on 2/12/2007, 6:48 PM
2 pass cbr might or might not help the compressed clip look better, but it can't be as efficient as vbr. When file size matters, vbr is I think overwhelmingly accepted & preferred,. A quiet conversation is just not going to need as much bandwidth as a rapid pan/transition or a scene with a lot of fast motion, like a cab driving by. If you want the cab to come out, you've got to allow the higher bit rate. If you use cbr, that means overkill during the conversation, & a larger file. There's no way around it, if the complexity of scenes varies, cbr is going to be less efficient and result in a larger file.

So if you compare the results of running multiple passes encoding cbr vs vbr, I don't think the amount of work done for the time spent is really comparable, which is why I still feel it's *more or less* a waste of my time.

But some folks prefer cbr for a final format when there are size constraints, & that's cool, as is running more than one pass if that's how you want to spend *your* time. ;?P