Need your advise, AVI vs MPEG

Galeng wrote on 11/15/2004, 12:37 PM
I have some friends over in the Pinnacle Studio forum that raise questions about capturing and editing MPEG files. I've learned from this forum that it's a very bad idea. That, our editing really should take place with AVI files then the final output goes to MPEG.

But, since I don't really know that much about it, what should be said to these folks? Not real in depth, but more than "you shouldn't do that."

Thanks for your help!

Galen

Comments

Former user wrote on 11/15/2004, 12:38 PM
Just say "NO".

Why start out with the worst quality you can get. Better to start with the best.

Dave T2
Chienworks wrote on 11/15/2004, 12:46 PM
There are two main reasons that come to mind.

1) MPEG is generally much more compressed than DV .avi. More compression means more quality is thrown away. Each time the video is rerendered more of the data is thrown away. When you start with MPEG you lose quality faster with each generation.

2) MPEG also uses temporal compression, which means that frames are built up using data from comparisons with previous frames rather than containing all the data necessary for that frame. This means that it can take a lot longer for the editing software to regenerate the frames when displaying and editing.
Jay Gladwell wrote on 11/15/2004, 12:55 PM
Dave and Kelly have already said it all.

The folks in the other forum are, when it is all said and done, simply showing their lack of knowledge and/or understanding. A little knowledge can be a dangerous thing!

Jay
JohnnyRoy wrote on 11/15/2004, 1:18 PM
Just to back up Chienworks two reasons and add two more:

1. MPEG is compressed 25:1 while DV is only compressed 5:1 and lossy compression means data loss. 5 times as much data loss for MPEG.

2. With DV each frame is a full frame of information. At 30 fps = 30 full frames. With MPEG every 15th frame is a full frame of information. At 30 fps = 2 full frames. That means every second of MPEG is 28 frames of guess work, averaging, fiddling with deltas, etc.

3. Another reason is when you edit MPEG and add information, the entire clip has to be re-encoded because you’ve just messed up the Group Of Picture (GOP) that must be in the correct order. Add a few frames to an AVI file and only those few frames will be encoded. Add a few frames to an MPEG file and the WHOLE FILE must be re-encoded to recalculate the GOP. (re-encoding means more data loss)

4. One last reason is that Pentium 4 3.0Ghz computers are still incapable of producing high quality MPEG encoding at 29.97 fps in real time. My P4 3.0Ghz PC takes about 1.5x real-time to encode an MPEG file. How then, do you capture MPEG in real-time? You cheat. You don’t use as good an encoding algorithm because you can’t afford to. So the MPEG that the Pinnacle Studio folks are capturing is inferior to the MPEG that Vegas produces from an AVI file.

So poor encoding, high compression, total re-enode when editing, and a lossy storage format are three good reasons why capturing in AVI is higher quality than MPEG. But you can’t tell the Pinnacle Studio folks that because they wouldn’t listen.

MPEG is a final output format, not an editing format (unless you have all I-Frame MPEGs which Pinnacle Studio does not have)

~jr
Galeng wrote on 11/15/2004, 1:30 PM
Man...you guys are smart!! Thanks for the information. I'll jump over to the Studio forum and pretend like I know all this stuff.............Er, no better not.

But, will pass the information along. And thanks for helping me understand it better too!

Galen
riredale wrote on 11/15/2004, 10:04 PM
JohnnyRoy:

My only quibble with your otherwise excellent points is that the encoding rate all depends on the encoder. I am lucky enough to use CinemaCraft, which is generally regarded as something of a miracle: not only is the encode quality excellent, but it also is blindingly fast--a decent newish PC can encode at a framerate of 1.5 times real-time or even faster (my AMD 1.67GHz cpu encodes at about 1.1 realtime). So it can be done.

Note that the new HDV format is MPEG2, and no one is complaining about image quality there...
cbrillow wrote on 11/16/2004, 6:56 AM
Well, yeah --- this is all very good advice that you've been given, but there are several things to consider in addition:

1) On the Pinnacle forum, there are users of capture devices which only create mpeg files. For them, there is no choice. And if you want to talk about something really ridiculous, for some of these poor suckers to get Studio 9 to work right, they have to take these mpeg captures, render them to DV, and then back to mpeg-2 to make a DVD. The word "waste" comes to mind. Waste of time and system resources...

2) For some video sources, a carefully thought-out mpeg capture strategy can produce acceptible results. Particularly important is to set capture parameters such that the material can be burned to DVD without re-encoding, which is where the greatest quality hit takes place.

3) There are some decent mpeg editors and tools available, some of which will permit simple cuts and writing to a new mpeg file without encoding. For chopping commercials out of a TV program, where you're making cuts primarliy in areas of video black, this works quite well, even in Studio.

I agree 100% that DV AVI is the most desirable editing format for a number of reasons, but mpeg can be appropriate for certain applications.
JohnnyRoy wrote on 11/16/2004, 9:17 PM
> a decent newish PC can encode at a framerate of 1.5 times real-time or even faster

I guess I should look into the CinemaCraft encoder then. ;-) The Pinnacle encoder is no were near this fast and yes, I was making some generalizations.

Which version of the CinemaCraft encoder do you use?

> Note that the new HDV format is MPEG2, and no one is complaining about image quality there...

Yea, but I assume the MPEG2 encoding is not as lossless as we used for DVD’s.

~jr
Chienworks wrote on 11/17/2004, 6:04 AM
HDV uses a bitrate nearly as high as DV, in the 15 to 20Mbps range. Most DVDs are encoded in the 5 to 8Mbps range.

Also, i have to register a slight technical objection/quibble to the 25:1 MPEG compression mentioned above. Uncompressed 720x480 video is about 237Mbps. 720x480 MPEG can be anywhere from 15Mbps down to 0.2Mbps (not that you'd want to watch it at this rate, but, it is possible). This gives a ratio range of 16:1 to 1200:1. It all depends on what bitrate is used. It may be 25:1 if 9.5Mpbs is used, but it can be a lot of other ratios too.

DV is about 29Mbps since it uses a fixed bitrate. This means that DV is compressed about 8:1, not 5:1. Where do people keep coming up with the 5:1 figure? Can't anyone else besides me do simple math? <g>
Former user wrote on 11/17/2004, 7:12 AM
I did a search for an answer to your math question.

Everything I read said DV is 25Mbps. According to the same articles it is a 5:1 ratio.

If you do a search on Google for DV compression ratio, you will see the same thing. It looks like the 29Mbps is incorrect. This is why it is called DV25.

Maybe the overhead Mbps is audio passing, although as I understand the audio is PCM uncompressed.


Dave T2
Chienworks wrote on 11/17/2004, 7:42 AM
Well, looking at 1 minute of DV captured to my hard drive, the file is 228,122,624 bytes. One second of this would then be about 3,802,044 bytes. 1 second of PCM audio is 192,000 bytes, so the video (plus some small bit of overhead) takes up 3,610,044 bytes, or 28,880,352 bits, or 27.54Mb. So, we're about halfway between 25 and 30. Even if the figure is 25 then the DV compression ratio would be about 9.5:1, which is even farther away from 5:1.

What goes on here? It's not even the difference between mega being 1000x1000 or 1024x1024. Even with that taken into account 9.5:1 becomes about 9:1. That's still not even close to 5:1. *shrug* Assuming that some of the data in the file is overhead instead of video data makes the discrepancy even worse.

So, does anyone know why it's commonly stated as 5:1?
John_Cline wrote on 11/17/2004, 9:02 AM
DV video information is carried in a nominal 25 megabit per second (Mbps) data stream. Once you add in audio, subcode (including timecode), Insert and Track Information (ITI), and error correction, the total data stream come to about 36 Mbps.

Let's consider the recording format for video, audio, and subcode data for a single frame of NTSC video as recorded on DV tape. A frame of compressed video data consists of 10 tracks of 138 data blocks containing 76 bytes of actual video data and a 1-byte header. Multiplying 10 tracks * 138 blocks * 76 bytes * 8 bits/byte * 29.97 frames/sec results in a video data rate of 25.146 Mbps (Megabits per second), which corresponds to the nominal 25 Mbps video data rate ascribed to the DV format. The theoretical data rate of 8-bit ITU-R BT.601 (formerly CCIR-601) with non-standard 4:1:1 decoding (720 active video samples per line, 8 luminance bits and 4 average chrominance bits per sample, 485 active lines, 29.97 frames/sec) is 125.5 Mbps. 125.5/25.146 gives the 5:1 compression ratio generally attributed to DV, which encodes 480 active lines per frame. If the compression ratio is based on BT.601's standard 4:2:2 decoding, the compression ratio is about 167.5/25.146 or about 6.6:1. Because of the adaptive quantizing process that results in lower compression for frames of relatively low motion content, the overall compression ratio, compared to BT.601 can be considered between 5:1 and 6:1.

Audio data consists of 9 blocks of 76 bytes, giving a maximum audio data rate of 10 tracks/frame * 9 blocks/track * 76 bytes/block * 8 bits/byte * 29.97 frames/sec = 1.64 Mbps. Four 32-kHz, 12-bit channels require a data rate of 4 channels * 32/1000 MHz * 12 bits = 1.536 Mbps, the maximum digital audio data rate. (Two 48-kHz, 16-bit channels also need 2 * 48/1000 * 16 = 1.536 Mbps.) The aggregate recording rate, including parity but less the ITI (Insert and Track Information) sector, is about 10 * ((90 * 163) + (12 * 12)) * 8 * 29.97 = 35.5 Mbps. Thus about 35.5 - 25.15 - 1.64 = 8.7 Mbps or about 25 percent of the recorded data is devoted to subcode data, error detection, and error correction.
Chienworks wrote on 11/17/2004, 9:12 AM
John, so, in other words, when i capture uncompressed NTSC and get a file that is about 240Mpbs, it has already been compressed with 4:1:1 and only a little over half of the file contains actual video data? That seems very wasteful and inefficient.
John_Cline wrote on 11/17/2004, 9:42 AM
Well, no. In 4:1:1 video, each pixel has been sampled for luminance, but only every fouth pixel has been sampled for chroma. Nevertheless, even though the chroma value may be the same as the pixel next to it, the luminance value will most likely be different and when the luminance and chroma have been combined to derive an RGB value, the RGB value will be different for each pixel. so there is actual video data.

In a data storage sense, uncompressed is certainly less efficient, but not necessarily wasteful.

John