We have a new baby in my house, and that was a good excuse to get a digital camcorder. But I don't want to drag it into the living room every time the family wants to watch home movies, and I want to edit the video to hide my poor camerawork as well. Also, while I'm waiting for DVD burners prices to come down to Earth, I still want to archive the video to a format that won't degrade over time like magnetic tape, and which I can play for the family in the living room. I also may be duping the video off to VHS for the family, so I want a decent quality source.
I'm not satisfied with 352x240 (VCD) format for this purpose. A friend insists VCD is equivalent to VHS, but I've never seen a VHS tape missing a field. Also, it really drives me nuts when the deleted scene extras on a DVD are in this format, because the quality loss is obvious all the way across my living room. miniDVD capable players are still pretty rare, so I didn't really consider that format. SVCDs, on the other hand looked pretty promising, so I bought a DVD player capable of playing SVCDs with that format in mind. But I have been very disappointed with the quality I can get out of the MPEG encoders I've tried. I want the quality to be about the same as DVD encodes, albeit with the lower resolution. Since I will be playing the videos back on my own DVD player, I don't mind straying from the standard a bit, so I tried XSVCDs. It seems my DVD player can deal with about 3.6Mbps, so I've tried that data rate. Obviously the quality improved, but I'm still far from satisfied. I don't want to see ANY MPEG artifacts, especially blockiness and halos.
I did some simple math on this and realized what an uphill battle I was fighting. It seems that DVDs are generally about 5Mbps. But they are normally 24F/s. That's roughly equivalent to 6.25Mbps (5/4 * 5Mbps) for 30F/s, and you will probably have to round up to at least 7Mbps for 60f/s (fields as opposed to Frames).
So obviously, trying to get 2/3 the data (480x480) into 1/3 the bits (2.5Mbps), or even half the bits (3.6Mbps) is probably impossible.
Anyway, while studying the DVD format, I ran across the 352x480 format that DVD supports. On a lark, I tried a 352x480 encode on an XSVCD burn on my DVD player and it worked like a charm! I call it HalfDVD. And even on my 35" Sony TV, the difference in resolution between 480x480 and 352x480 was pretty acceptable.
Alas, the MPEG quality is still not to my liking. But I just can't figure out why it won't work. 352x480 is about half the resolution of 720x480, and my HalfDVD format has about half the bit rate.
I've tried TMPEG (12 through 12h inclusive), LSX, bbMPEG, honestech, and Cinema Craft (both Lite and SP). I've tried hundreds of settings, too. I just can't find an encoder and settings that will give me an encoder without MPEG artifacts. Granted, my sample video is extremely difficult (my daughter's first few moments in the delivery room), but even running it through noise filters internally and externally (AVISynth) hasn't made a significant difference. [Of course, a nice gaussian blur did the trick, but who wants to look at video that looks like it's been shot through Vasoline?]
If anyone has any insight into how to get this process to produce decent quality, please post them.
Xesdeeni
+ Reply to Thread
Results 1 to 7 of 7
-
-
It is indeed possible to create artifact-free MPEG-2 digital video in Half-D1 format (352x480) at 3 Mbps. I don't own a digital camcorder myself, but if I did, this is how I'd approach the problem:
1. Figure out how to convert your camera's output to a minimally compressed AVI file at it's natural resolution (720x480, for example, though I understand some digital cameras have a base resolution higher than this). HUFYUV is a good choice because it's lossless and many programs can handle the color format natively.
2. Load the video into VirtualDub and save as a HUFYUV encoded AVI using these filters:- smart deinterlace [interpolate](1)
- smart deinterlace [blend]
- resize [352x480, precise bilinear](2)
- temporal cleaner [defaults](3)
3. Encode using CCE SP with these parameters:- CBR, 3000 kb/s(4)
- De-select "Upper field first"
- Select "Progressive frames"
- Select "Zigzag scanning order"(5)
- Select "Luminance 16 to 235"
- Select "Close all GOPs"(6)
(1) We want to create progressive frames from interlaced ones. Each method has its advantages, one may work better for some scenes than others. Interpolation doubles the dominant field, de-ghosting the image along the path of motion. Blending averages the changes between frames, and is especially effective with high-motion scenes. I would not ordinarily mix the two types, but I've read the technique was effective for digital camcorder footage so I'm passing that tip along.
(2) While it may be possible to create an AVI at the target frame size in step 1, doing it here (at the post-interlace stage) should produce a somewhat sharper picture thanks to oversampling.
(3) Even slight variations in color between frames can be detected as motion by the encoder, which it would have to waste bits in order to preserve. This filter reduces grain and creates a more film-like look which is easier for the encoder to digest.
(4) In my opinion, VBR is only useful when it is necessary to maximize play time at the expense of slight degradation in picture quality. The encoder frets over each GOP trying to be as stingy with the bits as possible, merrily generating Gibbs artifacts (halos) in return for a few extra minutes of viewing time. But half-D1 at 3 Mbps yields about 35 minutes per CD at a constant quality level, so if you can get by without VBR, you'll achieve better results by doing so.
(5) Zigzag scanning is known to be the most efficient pattern for progressive frames.
(6) By closing the GOPs, you make it possible to create chapter entry points anywhere in the video. Since half-D1 is a DVD-compliant format, you may want to build the infrastructure for random access in advance.
-
Ech! The artifacts from Smart Deinterlace are worse than the MPEG ones! Big sections of the image that seem to hold still while the other video moves holes around showing what's underneath. Perhaps I need some better settings than the defaults.
Anyway, they did show me that there is considerably more noise in the video than I expected for a digital camcorder. I'll probably experiment more with noise reduction. Which noise reduction and settings have you had the most luck with?
Also, can you give me more of your experience with:
- Zigzag scanning order
- Linear quantization scale (this seems to help a bit)
- 16-235/0-255 luminance level (miniDV is supposed to be CCIR 601, so does 16-235 scale the 0-255 range, decreasing contrast,?)
- Quick compression
- Quality precendence (what does "flat" vs. "complex" mean?)
- VBR vs. CBR (you say CBR is fine, but doesn't VBR juggle bits within the GOP as well, equalizing quality among I, P, and B frames?)
Xesdeeni -
I'm sorry, I meant the artifacts from the Temporal Cleaner, not the Smart Deinterlace. There are artifacts from the Smart Deinterlace as well, but I couldn't tell how bad they were because they were overwhelmed by the Temporal Cleaner.
Xesdeeni
-
Deinterlacing is never easy. Techniques that are effective with some scenes are useless with others, so it's sometimes necessary to deinterlace each scene separately. Ben-Rudiak Gould offers a utility called AviSynth which can perform a sophisticated type of deinterlacing known as bob/weave: it extracts each field and line-doubles it into a separate frame, creating a 60fps progressive video which you can frame-decimate back to 30 using VirtualDub. It's very effective technique, and well worth the additional effort.
My hobby is preserving rare and out-of-print television programs (particularly 60s-era British puppet animation) from VHS tape, so coincidentally I do have some experience with noise reduction. Here's an example from a VCD I'm working on. The source clip was captured from VHS at 640x480, the target clip was saved at 352x240 for encoding with Panasonic:
<A HREF="http://home.xnet.com/~linda/joe90-bigfish-b.jpg" TARGET="_blank">
</A>
- deinterlace
- crop frame
- adjust brightness/contrast
- adjust color balance
- resize and letterbox
- temporal cleaner
MPEG uses every trick in the book to achieve compression, combining multiple lossy and lossless techniques simultaneously. Zigzag scanning has the property of maximizing strings of zeroes which are particularly susceptible to reduction via certain algorithms, particularly RLE and Huffman. The alternate scanning pattern is intended to maintain the field separation necessary to perform motion compensation in an interlaced format. See the MPEG-2 FAQ for an excellent treatment of these topics.
"Linear quantizer scale" selects the MPEG-1 quantization table over the default MPEG-2, which may be better suited for progressive frames. "Luminance level" determines the brightness range each pixel can be assigned. 16 to 235 is correct for video which is intended for playback on TV; 0 to 255 is correct for video which is intended for playback on computer. There is some controversy surrounding the implications of that setting, but of course, that's what makes this forum so interesting.
"CCIR-601" is one of six DVD-compatible (and therefore miniDVD-compatible) NTSC resolutions, e.g.
CCIR-601 = 720x480 (MPEG-2)
D1 = 704x480 (MPEG-2)
HALF-D1 = 352x480 (MPEG-2, MPEG-1)
SIF = 352x240 (MPEG-2, MPEG-1)
"Quick Compession" speeds up the encoding about 10% for a small penalty in quality (in other words, it's not worth it). "Quality Precedence" allows you to reduce Gibbs artifacts (Complex) at the possible increase of contouring artifacts (Flat). How much you can get away robbing Peter in order to pay Paul depends on the dynamic range of the material versus the amount of fine detail it contains.
At SVCD/miniDVD bitrates (1 to 3 Mbps), VBR is a joke. It helps you squeeze a few extra minutes onto a CD-ROM, but it doesn't "save up" those unused bits to splurge on fast motion when it needs to -- you can never have more than the maximum bitrate, no matter how frugally those bits are allocated. At DVD bitrates (3 to 9 Mbps) VBR is a different story; in fact, it's actually a requirement because DVD players would have a hell of a time spinning fast enough to sustain CBR at 10 Mbps, not to mention the 8 minutes per layer per side the discs would yield at that bitrate.
<font size=-1>[ This Message was edited by: KoalaBear on 2001-07-24 15:46:33 ]</font> -
I should mention that I have a great deal of video experience, but getting optimum quality from a closed-source MPEG encoder isn't included
I'm not questioning the deinterlacing step. Although there will be some loss in fluidity caused by combining information from two separate instants of time represented by the two fields, I can see where the encoder would do a better job of encoding one 480 line image rather than two 240 line images, because there will be more potential redundancy, and of course less discontinuity between adjacent lines. I still have to experiement to find the best setting, but even the defaults aren't too bad.
It's the Temporal Cleaner I'm having trouble with. I understand the concept very well. In fact, I always wondered why this wasn't explicitly part of the MPEG spec. But the practice just doesn't look right. The results are obvious areas that don't change from frame to frame, surrounded by areas which do change. I'll take a look at your settings file and see if I can get better results.
I'm pretty certain that zigzagging as you describe it is always done on a block level in the post quantization step to align zeros from compression. I don't think this is an option on the block level. So I was asking how this switch applies. Is the zigzagging optional on the macro-block level?
Technically CCIR-601 is the old name of the ITU-R 601 standard for sampling digital video, which includes the sampling rate (13.5MHz) and subsampling of color components (6.25MHz), which gives the resolution (720 x 480), color sampling (4:2:2), and color range (I think 16-235 is for Y and the U and V are slightly different). It has nothing to do with compression. The color range comes from the NTSC television standard IRE levels. The data coming from my digital camcorder is supposed to be limited to the 16-235 range. The question I had was what CCSP does with this data. Since the DCT step doesn't have any explicit range limit, are they adjusting the coefficients so that the result is to spread the 16-235 out to 0-255, or does that happen when you select 16-235?
Xesdeeni
-
In all honesty I get good results from the temporal cleaner's default values; on the rare occasions that it generates snowy-looking color artifacts (the only ones I've seen) there's usually something wrong with my capture. But if you've read the documentation and played with the threshholds and it still doesn't improve anything, skip it. There are other ways to skin a cat.
Zigzag and alternate scanning apply to 8x8 pixel blocks only. Macroblocks are read in raster fashion (slices) to facilitate transmission and error recovery.
As to the question of how CCE quantizes luma internally, your guess is as good as mine. When I capture video from a source I'm fairly sure the luminance varies from 0-255, but even if it doesn't, the act of processing the signal prior to encoding is going to shift some of the luminance values into that range. When you tell CCE to limit luma to IRE, it probably encodes the out-of-range values as 16 or 235, respectively, according to whether the sample in question was under or over the limit.
Similar Threads
-
[Q] Convert MKV Format Profile from High@L5.0 to High@L3.1?
By xIntenso in forum Video ConversionReplies: 5Last Post: 26th Aug 2013, 21:46 -
VirtualDub..cant set custom format or compression???
By jranaudo in forum Capturing and VCRReplies: 4Last Post: 16th Jan 2010, 10:54 -
lower low quality online tv how to high quality :( :x
By gorry563 in forum Video Streaming DownloadingReplies: 1Last Post: 22nd Feb 2009, 06:56 -
&fmt=18 does not give the same quality as playing by "high quality
By arminio in forum Video Streaming DownloadingReplies: 2Last Post: 9th Feb 2009, 18:33 -
Converting from flv to high quality video format
By venus in forum Newbie / General discussionsReplies: 3Last Post: 29th Apr 2008, 13:47