View Full Version : vhs deinterlacing problem
some dude
7th June 2012, 02:34
I'm trying to deinterlace a vhs copy of "A Goofy Movie" but I'm having an issue deinterlacing the chroma for some reason. Here is an unfiltered sample clip.
http://www.mediafire.com/?wn63a6xeu7d8poz
for some reason I still see interlacing artifacts on the chroma even after deinterlacing.
Mounir
7th June 2012, 03:28
Hmm yeah strange artefact are you sure there isn't dropped frames ? qtgmc + tdecimate don't get rid of it so wait for clever answers
For your colors use this:
Ylevels(0, 1.000, 255, 0, 235)
tweak(hue=0.0,sat=1.4,bright=0,cont=1.0,coring=false)
some dude
7th June 2012, 03:38
Well when I was capturing it a total of 17 frames were dropped total form the 77 minute recording, is it possible the chroma and luma are out of sync on the time line? Should I try recapturing? Give me a minute I'll try your script.
some dude
7th June 2012, 03:51
I'm getting an error saying there is no function named ylevels
Mounir
7th June 2012, 04:06
see here for ylevels: http://avisynth.org/mediawiki/Ylevels
some dude
7th June 2012, 15:23
That does make the colors look better. there is still the issue with the chroma deinterlacing though. It reminds me of this picture from the old 100fps.com site
http://100fps.com/chromainterlaced_deinterlaced.jpg
to bad that site never offered a solution to it.
Didée
7th June 2012, 16:30
It's some sort of YUY2 <--> YV12 mistreatment. Not sure if I've ever seen s-th like exactly this, however, it's not difficult to fix.
avisource("clip.avi")
assumetff()
o = last
x = o.separatefields().selecteven().assumeframebased()
Y = o.converttoYV12()
U = x.UtoY().converttoYV12()
V = x.VtoY().converttoYV12()
YtoUV(U,V,Y)
assumetff()
#bob()
return(last)
The Bob() was just for evaluation, the clip is telecined, thus needs IVTC.
some dude
7th June 2012, 20:30
It's some sort of YUY2 <--> YV12 mistreatment. Not sure if I've ever seen s-th like exactly this, however, it's not difficult to fix.
avisource("clip.avi")
assumetff()
o = last
x = o.separatefields().selecteven().assumeframebased()
Y = o.converttoYV12()
U = x.UtoY().converttoYV12()
V = x.VtoY().converttoYV12()
YtoUV(U,V,Y)
assumetff()
#bob()
return(last)
The Bob() was just for evaluation, the clip is telecined, thus needs IVTC.
That solved the problem, thank you.
johnmeyer
8th June 2012, 02:11
I am always fascinated by what Didée comes up with and always try to learn. So, I downloaded the clip, used his script, and then tried understanding what was going on in each line.
I am sure that I am missing something, but it looks like 99.9% of the "fix" happens in this line:
Y = o.converttoYV12()
and that no additional processing is necessary.
In fact, when I substituted a stackhorizontal for the return, to look at the difference between the result of this initial colorspace conversion, and the result of taking all those additional steps, I could not see any difference at all:
stackhorizontal(YtoUV(U,V,Y).assumetff.separatefields(),Y.separatefields())
So, in this particular case, are these other statements really necessary? Just curious ...
Didée
8th June 2012, 03:04
Yes, you are correct. In fact, one coffee after making the post, I thought "waitaminute, isn't all that buzz the same as doing a progressive conversion?!"
And that's just what has happened. The data once was interlaced YV12, then has been converted to YUY2 via progressive sampling. And the posted script is just a convoluted way of doing ConvertToYV12(interlaced=false) on an interlaced YUY2 clip.
/me guilty for thinking too complicated. :o
johnmeyer
8th June 2012, 03:29
Many, many thanks. Reading your stuff is like going to school. I really enjoy it.
Gavino
8th June 2012, 10:14
the posted script is just a convoluted way of doing ConvertToYV12(interlaced=false) on an interlaced YUY2 clip.
Surely that's only true for this particular clip?
It's certainly not the same in general, as the additional steps throw away the chroma of the bottom field.
However, I can see that it will work if the original botched YV12 to YUY2 conversion was done by point resampling of chroma. (I haven't looked at the sample.)
some dude
26th June 2012, 03:28
how would I solve this problem with a source that is already yuv12 though. It appears that my pvr 150 is doing this with mpeg-2 recordings as well.
tried this
DGDecode_mpeg2source("C:\Users\Anthony\Desktop\fgfdgf\1257_20120625214954.track_224.d2v", info=3)
converttoyuy2(interlaced=false)
o = last
x = o.separatefields().selecteven().assumeframebased()
Y = o.converttoYV12()
U = x.UtoY().converttoYV12()
V = x.VtoY().converttoYV12()
YtoUV(U,V,Y)
assumetff()
bob()
return(last)
and I ended up with this
http://img411.imageshack.us/img411/1912/kingk.png
jmac698
26th June 2012, 14:09
It looks like DOCI
http://forum.doom9.org/archive/index.php/t-158230.html
I have the same pvr150. It's blending the chroma in the interlaced frames of the pulldown pattern. It can be exactly fixed.
TheSkiller
26th June 2012, 15:44
I don't know about that particualar PVR but looking at that screenshot there are definitely also luma ghosts, which means that the PVR, if it does the encoding by itself, is most likely also doing some crappy denoising while recording (look at the black hair outline, it's there 3 times).
Whether or not a recording device does encoding or just streaming to hard disk can be easily determined: If there are quality options (like SP, LP and so on), then it for sure does encode (and filter) the recording.
some dude
27th June 2012, 03:12
It looks like DOCI
http://forum.doom9.org/archive/index.php/t-158230.html
I have the same pvr150. It's blending the chroma in the interlaced frames of the pulldown pattern. It can be exactly fixed.
your script looks like what I'm looking for, I saw the test, but how exactly do I call the script? Sorry for such a noob question.
jmac698
27th June 2012, 08:11
mpgsource...
doci
simpleivtc
if it doesn't work, trim a few frames and try again until the patterns line up.
some dude
27th June 2012, 20:38
mpgsource...
doci
simpleivtc
if it doesn't work, trim a few frames and try again until the patterns line up.
I'm using a different source for a different video then my original post. This one is interlaced, not telecined. I tried this
converttoyuy2(interlaced=true)
doci()
bob()
just to see if it worked, I'm planing to use tdeint to deinterlace once I fixed this chroma problem. My final video was a little jittery, the chroma was fixed in some places but not in others. Should I trim a few frames, how many? Are there any other filters that do anything like this? How have other people with wintv pvr-150s got around this problem?
jmac698
28th June 2012, 17:04
Since it's not adaptive, you have to hope that the problem mostly fits a constant pattern. It could be that your pattern is not lined up to the way it's trying to fix it, that it, it's fixing it sometimes at the right spots and wrong spots.
That's why I say trim; this is an easy way to change the relative phase of the pattern.
I don't have time to make it adaptive.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.