Codec

ADI2000 wrote on 8/14/2002, 10:47 AM
Hello,

I've yet to d/l the latest version of Vegas as I've heard of some bugs and other issues. Does the latest update contain better codec for rendering files, and are all of the .veg and .avi files that I've created in the "out-of-the-box" version fully compatable with the newest versions?
For whatever reason, the only really satisfactory file format Vegas seems to offer "out-of-the-box" for rendering, is the .MPEG-2. All of my rendered .MPEG-2 files are relatively crisp and clear - all transitions and fades appear clean and fluid as they should. When I render to the more common .MPEG-1 format, my fades and transitions appear pixelated, and the image clarity is poor (seems to have a hazy, grainy appearance) compared to the MPEG-2. Additionally, the .wmv files at 512K and below are even less clear than the MPEG-1 files. I sincerely hope there are better rendering formats available in the updated versions of Vegas. The MPEG-1 file sizes are too large to use for the internet, and the low bitrate wmv. files simply look miserable. Can someone pleeeeeease assist me with this? I'd greatly appreciate some input.

Thanks,

Steve M.

Comments

John_Cline wrote on 8/14/2002, 11:13 AM
The best way to make .WMV files is to use the command-line-based WM8 encoder from Microsoft. It is the only way to do true 2-pass VBR encoding and the results are outstanding. It's kind of a pain to use, but the results are well worth it. However, there are a couple of freeware GUI front-ends available for the encoder that takes some of the hassle out of the process. Of course, you will have to render the files out to a stand-alone AVI file in order to get them into the encoder.

You can get the command-line encoder for free directly from Microsoft. One of the two GUI front-ends that I know of is available here:

http://www.geocities.com/wm8eu/index.html

John
Chienworks wrote on 8/14/2002, 3:47 PM
The one thing that strikes me about your message is that you seem to want high quality with a low bitrate. You may be expecting more than is possible. Low bitrate files look fuzzy because of the low bitrates, and low bitrates exist for web distribution. If you want a sharper, crisper render you'll have to use a higher bitrate and put up with a larger file. There really isn't any way around this; it's a simple physical limitation.
ADI2000 wrote on 8/14/2002, 5:52 PM
John_Cline, Thanks much, I will research your suggestion.

Chenworks,

<< The one thing that strikes me about your message is that you seem to want high quality with a low bitrate.>>

Not entirely. The issue here is that I have thus far been unable to render what I feel is a high-quality file in any format other than MPEG-2 - which by the way is not a widely used video format at this time, and of course .avi. I do find however, when rendering an .avi using the NTSC-DV template, the files don’t look quite right when played independently of Vegas (Win Media Player, etc.), yet they appear unaffected when I add them as pre-rendered segments to a timeline. When I render an MPEG-1 from a .veg file, there are no bitrate choices - at least that I've seen in the “render as” selection window. I find that the MPEG-1 files I've created using either the "default template", or "VCD-NTSC", result in files that are of poor quality. My fades look absolutely awful, and the video overall has an almost mesh-like haze to it. The same holds true for the .wmv files. Now, by no means do I claim to be an authority on DV editing, however I have in the past used a "Dazzle" device, which came bundled with its own acquisition software. The software to which I refer was a simple program to allow PC use of the "Dazzle" hardware. The program permitted one to acquire clips through the “Dazzle” device, and manually set both the input and output bitrates and compression. I created an interactive CD-Rom two years ago, which contained over two dozen MPEG-1 files that were extracted from High-8 tape through the "Dazzle" device and software. When I saved each clip in the program at the highest or near-highest bitrate - the results were quite good. My problem now is that since this first project, I've invested thousands on state-of-the-art cameras, support, lighting, high-end PC, and of course SF “Vegas” for the most critical of tasks...DV editing. Why is it that I cannot render a simple MPEG-1 file that looks as good as the “Dazzle” clips? Something has to be inherently wrong or lacking with the "out-of-the-box" codec bundled with Vegas, or are there new, better codec(s) with more compression/bitrate options other than the "Main Concept" codec I have now in V3?

Thanks,
Steve M.
Shredder wrote on 8/14/2002, 6:14 PM
Steve,

You can customize the codec beyond the presets & create your own.

In the Render As window, click 'Custom' on the lower right.

The VCD format is inherently low quality, so the only way to increase the quality is to change the 'Video type' to MPEG-1 instead of VCD.

Once you do that you can increase the bitrate to somehting higher than the VCD limit of 1,151,929 3Mbps or 5Mbps etc.

However, if you're gonna know up the bitrate, why not use mpeg-2 at that point? The main reason to use mpeg-1 is for VCDs, which will likely not be compatible if you increase the bitrate.

Of course, the resulting mpg file will not conform to the VCD standard, so you may only be able to view it on your PC.

You can look online for info on how to tweak the I-frames, B-frames etc. to suit your purposes.

- Jon
John_Cline wrote on 8/14/2002, 7:21 PM
Actually, Main Concept has an extremely good reputation for writing high quality codecs. It is highly unlikely that this is the cause of your poor looking results. Choosing the VCD template sets both the audio and video codecs to specific parameters as required by the VCD standard.

The reason that video played from within Vegas looks different than that played through Media Player is because DV video is interlaced. Vegas compensates for this during playback on the computer monitor, Media Player does not. I don't believe that Dazzle captures interlaced video to begin with, so it's no wonder you've never seen the artifacts.

Because of your description of seeing a "halo" around things, I suspect that what you may be seeing are indeed interlace artifacts. Full-resolution DV video is interlaced. Interlacing is a method of increasing time ("temporal") resolution at the expense of vertical resolution. In NTSC video, there are 29.97 frames per second, but each frame consists of two fields. For the first half of the frame, the image is scanned by the camera and written to every other horizontal line of the frame, then for the second half of the frame, 1/60th of a second later, another image is captured by the camera and it is "interlaced" in between the lines of the first field. Therefore, at one moment in time, the picture is captured and written to lines 1, 3, 5, 7, 9, etc, then 1/60 of a second later, another image is captured and written to lines 0, 2, 4, 6, 8, 10 etc. So, there are really 60 individual images per second in NTSC video, but they are interlaced into 30 frames per second.

When viewing a single frame consisting of these two fields, if there is a lot of motion in the video, the objects in the scene will have been in slightly different places physically and there will be differences between the fields and you will see some "combing effect" between the two fields. Interlacing allows motion to be smoother than would be the case if it captured the entire 480 lines at once every 1/30 of a second. Televisions know all about interlacing and display the 60 fields per second sequentially. Computer monitors, on the other hand, are progressive displays and will display both fields simultaneously, where you will see the interlacing artifacts. This can look very odd as you have noticed when watching a DV file play back in Media Player.

In order to avoid interlacing artifacts when creating content from DV video files for display exclusively on a computer monitor, you must de-interlace the video. There are a couple of methods to do this, one is to blend the fields, but this creates the "halo" effect, the other way to deinterlace is to throw out one of the fields in each video frame. Since each field is only 240 lines anyway, you can then rescale the video to exactly half of it's original vertical dimension, thus displaying only one field of video every 1/30 of a second. I'm not exactly sure how Vegas handles de-interlacing, since I've never used Vegas for this task.

There is one more issue to contend with, DV video is based on rectangular pixels, they are slightly taller than they are wide. Computer monitors display square pixels. NTSC DV video is 720x480, although it has an aspect ratio of 1.5:1 (720/480=1.5), it actually displays at 1.333:1 (or 4:3) on a television as it should. Therefore, when creating content for display exclusively on a computer monitor, you must rescale the DV video to be 1.333:1. Since we threw out one field of video and now have a total of 240 lines vertically, we multiple 240 x 1.333 and arrive at 320 for the horizontal size. Deinterlace the video, then rescale to 320x240, then compress with the appropriate codec whether it is MPG1, WMV or some Quicktime codec. There are a few other factors which can affect the ultimate quality of the low-bitrate video, any video noise or lots of motion will make it harder to compress with acceptable results.

Personally, I render to a DV AVI file, then use a freeware program called "VirtualDub" to deinterlace and resize, then make an intermediate, uncompressed AVI file to input into Windows Media v8 for WMV files, or TMPGENC to make MPG1 files. The results are always very good.

www.virtualdub.org

www.tmpgenc.net

John
jeffy82 wrote on 8/14/2002, 7:23 PM
**John, you Just beat me to it.****

Steve M.
Regarding thest different settings that you refer to; what seems to be the main difference between them in the setting section? Is it a different bitrate, or does it just use a (Good, Better, Best) Slider? You have me at a loss because I don't own that version of Dazzle.

I have a sneaking suspicion that the better resulting MPEG1 files that the Dazzle creates is just a high bitrate Mpeg1 file. If burned onto a cdrom as a non-compliant VCD, there are referred to as XVCDs. They can fit more time on a cdrom than mpeg2 format, but remember, that's primarily because, MPEG1 is usually 320x240 (half resolution) -- this would result in less detailed picture, but on the computer screen it usually eliminates the interlacing effects.

The other downside is that they can only be played in only certain DVD players. (Ones capable of playing XVCD) Unfortuantely, to get the greatest compatibility the standard VCD with low bitrate must be used. (Sometimes compared to a VHS equivalent in quality) I would guess that SF did not include these alternative templates, so that people wouldn't accidently encode at a noncompliant rate.

Noncompliant rates are really more in tune to advanced users, so I agree with SF's method.

The only other way to get DVD or Near DVD quality video at low bitrates is to use one of the more advanced codecs like Divx 5.02 or WM8 (I don't recommend the later).

jeffy82@aol.com
John_Cline wrote on 8/14/2002, 9:57 PM
Windows Media v8 has gotten an undeserved bad rap. The key to producing high quality WM8 files is to use the free command-line encoder in the 2-pass VBR mode. Using the single-pass WMV export module from within Vegas or the stand-alone Windows Media Encoder v7.1 simply doesn't do justice to the format.

I have recently done extensive testing of the new Quicktime v6 MP4, Sorensen v3, Real Video 9, DivX v5.02 and Windows Media 8.

I used first generation footage taken with a high-end Sony Digital Betacam camcorder, the footage was taken outdoors and had a LOT of motion, extremely low noise and quite a bit of fine detail. This footage was chosen to stress the codecs to their limit. I converted the footage to uncompressed 320x240 29.97fps video along with a 44.1k 16bit stereo audio track. I then encoded it with each codec at a bitrate of 128k stereo audio and 372k video, for a total of 500kbits/sec suitable for broadband web streaming. For those codecs which supported 2-pass VBR, I used it. Otherwise, if there were any settings for speed vs. quality, I chose whatever settings produced the highest quality. I wanted all of them to look as good as they possibly could. I encoded at both 29.97fps and 15fps.

The clear winner in every test was the command-line Windows Media v8 encoder in the 2-pass VBR mode. It was vastly better looking than any of the others and, at higher bitrates, it looked even better. And, at any given bitrate, the audio sounded better using WM8 as well. Plus, WM8 is playable on 96% of the computers out there without having to install another player as is the case with Quicktime or download and install another codec like DivX v5.02. Most everyone running Windows has Media Player and if someone doesn't have the WM8 codec installed, Windows Media Player will automatically go and get it for them. At this point, it's as close to a universal streaming format as there is.

Windows Media 9, code-named "Corona", will be released shortly, I saw a demo of it at the NAB convention last April and it was VERY impressive.

John
Shredder wrote on 8/14/2002, 11:32 PM
John,

Great write-up, I'm assuming you use Donald Graft's Smart De-interlacer. He's such a talented fellow. I worked with him on creating the Smart Resize Plugin for VirtualDub. I had the initial idea, he had the awesome skill to make it a reality... Great combination!

I really wish that VV could use VirtualDub plugins. There are so many good ones. It would save us so much time to process & render once than do the 2-step with Vdub.

One another note, can you post your exact WM8 command line options for those of us who haven't used it before?

- Jon
John_Cline wrote on 8/15/2002, 1:16 AM
Jon,

Yes, I use Donald Graft's filters all the time. I can't imagine life without VirtualDub and all the great freeware filters.

I use Donald's Smart Deinterlacer when I'm making frames that aren't exactly half of the original vertical resolution. For example, when I'm converting 720x480 interlaced to 640x480 progressive for encoding with DivX. If I'm going for 320x240, I just use the built-in deinterlacer and set it to discard one of the fields. This results in a frame that's 720x240 and I use the resize filter next in the chain to resize it to 320x240. (Normally, set to the "Precise Bilinear" filter mode.) Then I use the levels filter and set the gamma to around 1.2 to compensate for the gamma difference between a television and a computer monitor. I might also use Jim Casaburi's "temporal cleaner" before the gamma filter. Since all of these video compression schemes are based on encoding the difference between one frame and the next, any noise in the video will just eat up valuable encoder bandwidth. The best looking, relatively low bitrate files start with noise free video. Of course, this is true for compressing video to Quicktime, Sorensen, MPG1, MPEG2, DivX or any of the other codecs that use "difference frames."

Finally, I use the HuffYUV "lossless" codec to create the intermediate file to feed to the encoder. Since part of my goal is to make the final file as compatible with the widest variety of machines possible, I also resample the 48k audio down to 44.1k in VirtualDub using the "high-quality" mode, because not everyone's sound card can support 48k audio playback.

Anyway, here is the exact command line parameters I used with the WM8 encoder from the tests I mentioned in an earlier message:

-input "input.avi" -output "output.wmv" -v_mode 3 -v_bitrate 372000 -a_setting 128_44_2 -v_width 320 -v_height 240 -v_framerate 29.97

(Obviously, you would replace "input.avi" and "output.wmv" with your own filenames.)

However, the easiest way to do it is get the WM8 GUI front end I mentioned in that earlier message.

John
jeffy82 wrote on 8/15/2002, 1:37 AM
ADI2000,

Before we start arguing about apples and Walmart child abductions, I just want to point out, that alot depends on your purpose of this video format. Is is for archival, webstreaming, editing, burning, etc. Each one can have an entirely different ideal method/technique.

I think alot depends on YOU. What do YOU think looks best. What method is easiest for YOU. Ya, John & I can rave all day about command line, and AVIsynth scripts, but if you prefer GUIs (graphical user interface), and can't stand text only. You've answered some of your own questions.

I'm not disagreeing with any fact John has stated, my resistance is for facts that were left out. Like compatibility as far as importing WMP files, not just playing them.

John, how many applications can open a WMP for editing/filtering etc? I honestly don't know. All I know is that when Virtual dub made it possible to import ASF (WMP) files, Microsoft legal department threatend the author and forced him to remove that feature. Just for that polictical, monopolistic attitude of microsoft, is what I base my resistance on, not the quality of their codecs.

Jeffy82@aol.com
Cheesehole wrote on 8/15/2002, 1:52 AM
I have posted settings but probably different than John's. search on command line encoder.

the command line wm8 encoder gives excellent results. I ran into a bug once with a bright red shirt turning super blocky. I had to use the VV3 encoder which worked fine.

but whenever I render high bitrate WM8 video from Vegas (3-6Mb), I end up with files that don't play on any PC. they start playing, and then turn all choppy and crappy. I render the same footage to the same birate with the wm8 command line encoder and end up with liquid smooth 30fps video.

here are those settings. they were developed for photo-montage footage, so different settings might work better for different situations. I compressed an underwater snorkeling video with these settings and it came out great.

here are my high bitrate presets. the frame rate is determined by the source file. when possible, I use an uncompressed AVI at 30fps as a source.
medium quality 2-pass CBR 1024K preset:
-a_setting 128_44_2
-v_bitrate 1024000
-v_quality 75
-v_buffer 3000
-v_keydist 3
-v_mode 1

high quality 2-pass CBR 4096K preset:
-a_setting 128_44_2
-v_bitrate 4096000
-v_quality 95
-v_buffer 3000
-v_keydist 3
-v_mode 1


btw - these settings are for config files. you have to read the help that comes with the encoder.
John_Cline wrote on 8/15/2002, 12:07 PM
"Is is for archival, webstreaming, editing, burning, etc. Each one can have an entirely different ideal method/technique."

Absolutely. I use WMV as a CD distribution or webstreaming format, I consider both as final distribution formats. If I want to edit it some time in the future, I archive it in DV format.

"I think alot depends on YOU. What do YOU think looks best. What method is easiest for YOU. Ya, John & I can rave all day about command line, and AVIsynth scripts, but if you prefer GUIs (graphical user interface), and can't stand text only. You've answered some of your own questions."

I rarely consider what is easiest, I am only concerned about quality. If I have to take a few extra steps or deal with a command-line program, then that's what I'll do. My clients are concerned about quality and the "universal playability" of the format. Also, I have developed a relatively simple method for measuring and testing lossy codecs by comparing them to the original footage, so it's not entirely what I think looks the best, it's what tests the best. WM8 tests really well.

"John, how many applications can open a WMP for editing/filtering etc?"

Not too many and that's just fine with me. Like I said, I use WMV as a final distribution format and the fact that they can't be imported into many applications just means that they can't be altered or otherwise edited after the fact. I can distribute it to a vast audience, but they can't change it after the fact, so it remains as I intended it to be seen. Works for me (and my clients.)

"All I know is that when Virtual dub made it possible to import ASF (WMP) files, Microsoft legal department threatend the author and forced him to remove that feature. Just for that polictical, monopolistic attitude of microsoft, is what I base my resistance on, not the quality of their codecs."

OK, that's your call. Personally, I'm a big fan of Microsoft. I was around in the very early days of personal computers and I remember when every manufacturer had hardware and software that was incompatible with everyone else. Software and hardware was expensive because there was no economy of scale. We needed a universal OS and Microsoft's OS reached critical mass for whatever reason. How reasonably priced would Vegas be if their market was just a few thousand machines running some specific flavor of Windows (or some other OS?) Windows is THE common OS and I have absolutely no problem with that. If the U.S. government (which is a monopoly itself) has their way, we're all going back to the old system of multiple OS's and incompatible software. I am 100% opposed to that. Been there, hated it.

John
jeffy82 wrote on 8/15/2002, 1:47 PM
John,
I understand and agree with alot of your opinions. I guess I was trying to make the point that not everyone else will.

For example, I will go the long way in doing DVD MPEG2 encoding, by only using Cinemacraft 2.50, yes its picky, and it's a hastle alot of the time, having to segment the video & do a 2 pass, but I demand the best quality, and I have not found a better encoder for DVD MPEG2.

We only have differing personal preferences.

John, now that I think of it, your choice to put the video in a format that doesn't allow changing is probably a smart move, then you can avoid the customer calls inquiring as to "How do I...?" This way you can answer "You Can't." Sometimes it's alot easier answer.

btw, I couldn't help but venture, under what circumstances do you use Divx?

jeffy82@aol.com
John_Cline wrote on 8/15/2002, 3:14 PM
Well, first of all, I fully expect that other people will have different preferences, not everyone has the same requirements or objectives. That's the beauty of it all, while I fully advocate having one common OS, despite the fact that it isn't and will probably never be the "perfect" OS, we are free to choose what we run on that OS. For example, while Media Player is installed with the OS by default, I'm not forced to use it. I have a number of media players, including Winamp v3 (which now plays video) and the DivX player. As far as video editing is concerned, we can choose between Vegas, Premiere, Avid XpressDV, Ulead Media Studio and a bunch of others. Our choices aren't limited by Windows, our choices are virtually unlimited because of Windows. Cool.

As far as DivX is concerned, it looks quite good at 640x480 at moderate bitrates and I use it to deliver short projects to my clients for approval via the Internet. It also saves a little time because I can deinterlace, resize and encode to 2-pass DivX directly from VirtualDub. I have also been doing some stuff recently where I actually deliver a 720x480 29.97fps interlaced finished product via the Internet to an out of town client. The client on the other end uses VirtualDub to convert the DivX file back to DV using the Main Concept DV codec. I encode the DivX file at 10 megabits/sec and the audio at 48k 256Kbits and it holds up really well. Basically, I'm just saving quite a bit of transfer time by sending a 10.25 megabit/sec file instead of a 25 megabit file in DV format. So, essentially, I'm using DivX in a "closed-loop" situation and not for general distribution. DivX hasn't reached "critical mass" (and realistically, it probably won't) whereas Windows Media v8 has.

John