View Full Version : Degrain DV PAL video
bairradino
25th August 2008, 13:01
I made a search and found some solutions for this purpose but all of them need YV12 colorspace.
The native Pal DV is YUY2 colorspace and I think it's better to avoid colorspace converts.
So, what is a good solution for this?
martino
25th August 2008, 13:45
The native Pal DV is YUY2 colorspace and I think it's better to avoid colorspace converts.
Why? IIRC YUY2 -> YV12 is a lossless colorspace conversion...
Or is the conversion speed the problem? In which case you might want to forget about denoising it at all...
thetoof
25th August 2008, 14:27
If you're encoding to DVD (mpeg-2), you'll have to convert to yv12 anyways.
IIRC YUY2 -> YV12 is a lossless colorspace conversion...
Hmmm maybe... If you consider losing half of your chroma samples lossless :p (yuy2 = 1 chroma for 2 pixels / yv12 = 1 chroma for a 2x2 pixel block)
Gavino
25th August 2008, 15:15
The native Pal DV is YUY2 colorspace and I think it's better to avoid colorspace converts.
PAL DV is 4:2:0, and although the chroma sampling positions are slightly different from MPEG YV12, it is a lossless conversion between them.
The Cedocida DV codec will deliver YV12.
Wilbert
25th August 2008, 17:44
PAL DV is 4:2:0, and although the chroma sampling positions are slightly different from MPEG YV12, it is a lossless conversion between them.
If you don't alter the chroma, then yes, the conversion is lossless. I think that Cedocida DV codec blurs the chroma a bit when doing this conversion (adjusting for the difference in chroma sampling positions), but you need to check that.
2Bdecided
26th August 2008, 10:50
How can DV YV12 to MPEG-2 interlaced YV12 ever be lossless - unless you use the exact same pixels, and ignore the fact that they're in slightly the wrong position?!
Cheers,
David.
Gavino
26th August 2008, 11:22
How can DV YV12 to MPEG-2 interlaced YV12 ever be lossless - unless you use the exact same pixels, and ignore the fact that they're in slightly the wrong position?!
You're right, of course - I was being sloppy, it's not strictly lossless. Basically, I meant that the same number of samples is used, unlike YUY2->YV12.
However, if your target output is to write back to DV, then Cedocida can also deliver straight DV YV12 which obviously is lossless. Though you would have to be careful not to use any filters that assume MPEG sampling position (eg colorspace conversion, resizers, ...).
bairradino
26th August 2008, 12:03
So, what could be a good solution for this purpose?
UDegrain?
MVTools?
yup
26th August 2008, 12:20
bairradino!
Start from MVDegrainX (X=1,2,3) internal function MVTools plugin. You can make in YUY2 or YV12 colorspace. Read doc, exist example MVDegrain2i for interlaced source.
yup.
Adub
26th August 2008, 16:36
Well, honestly, if he is a little new to the whole Avisynth thing, then some good scripts to play with would be MC_Spuds and Udegrain. Maybe TemporalDegrain as well, if he has the patience.
That way, he can deal with one function, and one function only, instead of going through and having to read the MVTools manual.
bairradino
26th August 2008, 18:12
Thankyou guys.
In fact I'm not an expert as most of you, but I have the patience to try to learn...
Now I'm trying the following scriptSetMemoryMax(256)
function MVDegrain2i(clip "source", int "overlap", int "dct", int "idx")
{
overlap=default(overlap,0) # overlap value (0 to 4 for blksize=8)
dct=default(dct,0) # use dct=1 for clip with light flicker
idx=default(idx,1) # use various idx for different sources in same script
fields=source.SeparateFields() # separate by fields
backward_vec2 = fields.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=overlap, idx = idx,dct=dct)
forward_vec2 = fields.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=overlap, idx = idx,dct=dct)
backward_vec4 = fields.MVAnalyse(isb = true, delta = 4, pel = 2, overlap=overlap, idx = idx,dct=dct)
forward_vec4 = fields.MVAnalyse(isb = false, delta = 4, pel = 2, overlap=overlap, idx = idx,dct=dct)
fields.MVDegrain2(backward_vec2,forward_vec2,backward_vec4,forward_vec4,thSAD=400,idx=idx)
Weave()
}
#source=MPEG2Source("c:\temp\x.d2v", cpu=0)
source=AviSource("C:\video\matançaporco\x.avi")
mvdegrain2i(source,overlap=4,dct=0,idx=1)
and it's working.
Let me see the final result.
Adub
26th August 2008, 18:35
Just to be sure, you are dealing with interlaced video, correct?
henryho_hk
27th August 2008, 03:28
bairradino, what is your target format? DV->denoise->DV, DV->denoise->DVD, etc? They are completely different processes.
bairradino
27th August 2008, 10:29
DV > Denoise > DVD, and yes, it's interlaced PAL captured with my Panasonic DV camera.
henryho_hk
28th August 2008, 07:50
Install Cedocida codec (http://forum.doom9.org/showthread.php?t=94458); in decoding options, force output format as "YV12" and YV12 chroma sampling as "MPEG2 interlaced".
After that, in your AVISource() call, add the option pixel_type="YV12". If your avs script continues to work, then very probably Cedocida is taking up the DV decoding since most commercial DV codecs deliver YUY2 or RGB only.
I agree to the use of mvdegrain2i() or even mvdegrain3i() because most DV recordings are rather grainy... much worse than commercial DVDs.
Try a short portion of your footage. Remember to set BFF (bottom/odd field first) in your DVD encoding software. Then burn it on a DVD-RW and play it in your TV. If the motion is fluid, encode the whole footage. If it does not, you need to convert your video to TFF (top/even field first) in avisynth, encode it as TFF in DVD encoding software, and view it in TV again.
bairradino
29th August 2008, 18:11
I'm using "DebuMode Frameserver" for frameserving the mpeg2 encoder from Adobe Premiere.
As much as I know Premiere uses MicrosoftDV codec and I can't see how to tell Premiere for using Cedocida codec.
I think that MicrosoftDV outputs YUY2.
Comatose
30th August 2008, 02:03
Then export it so you can filter it in YV12 in Avisynth - and I don't think the chroma thing matters since you're going to convert it to YV12 eventually anyway.
DV -> edit in Premiere -> export -> filter in Avisynth -> lossless -> feed to MPEG2 encoder
henryho_hk
30th August 2008, 04:07
The YV12 chroma output setting in Cedocida matters A LOT. It is not merely blurring of color. It is having something like color swapping of each pair of horizontal lines!
Comatose
30th August 2008, 07:49
Well, okay, yeah, I forgot about the chroma being positioned slightly differently :X
But I was just saying that earlier in the thread, you didn't want to convert to YV12 because you didn't want to half the chroma information... but then it wouldn't matter since you're going to lose it eventually anyway.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.