Log in

View Full Version : Recommended x264 settings for DV AVI


experttech
22nd December 2006, 18:01
I have been trying to encode DV AVIs with several profiles but all of them result in a video that has artifacts (lots of blockiness) particularly around people's faces and dark areas.

I have tried HQ-Slow, HQ-Slowest modified, just the VFW codec set to 3000 kbps - all videos result in artifacts.

Have tried upto 2 passes.

I am aiming for a near-losless quality. The CQ-Losless is pretty much useless for this purpose as the resulting file is larger than the source DV AVI.

1. What settings do you use to get the best results
2. What kind of noise filter is recommended
3. Do you still notice 'very noticeable' artifacts in the final video?

hpn
22nd December 2006, 20:02
The DV format is notoriously hard to compress because of the inherently noisy nature of its footage when shooting with an unprofessional home camcorder or in low light. You could try some filters (or even combination of more than one) to "smooth" the frames before feeding your video to the encoder. Plus have in mind that for example a DV PAL footage (720 x 576), unless shot in 9/16 mode, has much more pixels to play with than your average DVD PAL with removed black bars, so encoding DV at 3000kbps will produce lower quality that encoding DVD at 3000kbps, and this not including the noise in the equation, so to get close to the original DV quality you'll probably need at least 5500kbps.

experttech
22nd December 2006, 20:11
The DV format is notoriously hard to compress because of the inherently noisy nature of its footage when shooting with an unprofessional home camcorder or in low light. You could try some filters (or even combination of more than one) to "smooth" the frames before feeding your video to the encoder. Plus have in mind that for example a DV PAL footage (720 x 576), unless shot in 9/16 mode, has much more pixels to play with than your average DVD PAL with removed black bars, so encoding DV at 3000kbps will produce lower quality that encoding DVD at 3000kbps, and this not including the noise in the equation, so to get close to the original DV quality you'll probably need at least 5500kbps.

Aah ok, but 5500 kps also means an enormous file size (I think). For example, a DVD (say 7 GB) can be converted to AVI (2 GB) with nearly losless quality.

I was wishing to achieve something like this with DV AVI.

I'll try some encodes with 5500 kbps and use Convoluted3D.

What I do not understand is that a DVD footage where a face appears 'clear' - appears almost the same in the encoded file - however with a DV AVI this is just not the case. Even with a less noisy source the quality of the encoded file is vastly inferior.

Morte66
22nd December 2006, 21:04
(lots of blockiness)

You should look at the other recent threads about blocking in this forum.

For a start, try enabling --no-fast-pskip and using the "M4G Smooth v1" custom matrix in the "Custom Matrices" thread.

Note: denoising is a tricky subject with x264. Denoising tends to reveal blocks that were hidden by noise in the original. And x264 does lots of denoising in itself, perhaps more than Convolution3D. But if you want to try a good strong denoiser, I'm partial to FrFun7; search for the thread about it.

Blue_MiSfit
22nd December 2006, 21:53
Right. I would suggest strong chroma denoising for DV sources. I like fft3dfilter/fft3dgpu at sigma 2 or 3. and plane set to 3 (chroma only).

Also its very important to remember that DV is interlaced, so if you are going to use x264, select interlaced encoding, or deinterlace before you encode. I haven't tried interlaced x264 yet, and don't know how it works with standard BFF interlaced content.

Encoding interlaced is probably preferable to deinterlacing and encoding progressive, because bobbing on playback will give you much better motion. Still, encoding interlaced means that your decoder must support interlacing, and not all of them do IIRC. I think the majors (coreAVC and ffdshow) do support it, however.

~MiSfit

hpn
22nd December 2006, 22:42
Also its very important to remember that DV is interlaced The format itself is neither interlaced nor progressive. But it's true that most camcorders are interlaced, so it's probably the case.

DarkZell666
23rd December 2006, 09:31
I am aiming for a near-losless quality. Why do you want to specify a bitrate then ? It's just so condradictive :)

Use CRF (a.k.a Constant Quality) mode, with a nominal QP=18 (or Quantizer=18, depending on what tool you use exactly).
You'll have an unpredictable filesize, but you'll have your "transparent" quality you're targeting. This is visually equivalent to encoding with XviD@quantizer=2 (but with a generally smaller file). If crf18 isn't enough, try CQP15 (much bigger file but no artifacts, normally).

If you still want to keep your encoded file within a reasonable size, you'll have to choose a tradeoff by yourself. If you really want a 2-pass file @ whatever-kbps, tweak the qcomp value higher (0.8 instead of 0.6 for ex.), this will help with some of the artefacts in high-motion scenes (but this will make the dark areas and the faces worse imho, you'll have to try).

Filtering is a good idea only if the source has noise. If you shot some full daylight material, there shouldn't be any noise, only some shaky motion if you didn't use a stand for your camera (and you can't do too much about that).

Btw, if you still see too much blocks, you might have to resort to encoding with XviD @ Q2, which is kinda more transparent than x264 in some circumstances :)

R3Z
23rd December 2006, 11:33
Why do you want to specify a bitrate then ? It's just so condradictive :)

Use CRF (a.k.a Constant Quality) mode, with a nominal QP=18 (or Quantizer=18, depending on what tool you use exactly).
You'll have an unpredictable filesize, but you'll have your "transparent" quality you're targeting. This is visually equivalent to encoding with XviD@quantizer=2 (but with a generally smaller file). If crf18 isn't enough, try CQP15 (much bigger file but no artifacts, normally).

If you still want to keep your encoded file within a reasonable size, you'll have to choose a tradeoff by yourself. If you really want a 2-pass file @ whatever-kbps, tweak the qcomp value higher (0.8 instead of 0.6 for ex.), this will help with some of the artefacts in high-motion scenes (but this will make the dark areas and the faces worse imho, you'll have to try).

Filtering is a good idea only if the source has noise. If you shot some full daylight material, there shouldn't be any noise, only some shaky motion if you didn't use a stand for your camera (and you can't do too much about that).

Btw, if you still see too much blocks, you might have to resort to encoding with XviD @ Q2, which is kinda more transparent than x264 in some circumstances :)

Even with heavy noise you should be able to hit transparency at around crf20 but its all upto the user right ? :)

My recomendation is that if you actually like noise and grain (like i do) then its easy to denoise a source and get extra compression and apply noise at playback through ffdshow. Its all personal i guess but encoding speed and compression % has got to add up eventually.

hpn
23rd December 2006, 21:30
What I do not understand is that a DVD footage where a face appears 'clear' - appears almost the same in the encoded file - however with a DV AVI this is just not the case. Even with a less noisy source the quality of the encoded file is vastly inferior.

Another possible reason not to get the quality you want at high bitrates is that even shot in daylight with a good camcorder and very little noise, the home DV videos are usually shot by hand (not mounted on a tripod), so they have very few consecutive frames that are similar enough to allow any compression algorithm to work properly, unlike the "talking head, static background" situation in most DVDs. So even noise free, you're basically compressing a video where every frame should be an i-frame (every frame for itself) to get a good looking result and that simply can't happen unless you increase the bitrate to the max.