Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th June 2012, 02:34   #1  |  Link
some dude
Registered User
 
Join Date: Jan 2008
Posts: 30
vhs deinterlacing problem

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.
some dude is offline   Reply With Quote
Old 7th June 2012, 03:28   #2  |  Link
Mounir
Registered User
 
Join Date: Nov 2006
Posts: 711
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)
Mounir is offline   Reply With Quote
Old 7th June 2012, 03:38   #3  |  Link
some dude
Registered User
 
Join Date: Jan 2008
Posts: 30
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.

Last edited by some dude; 7th June 2012 at 03:52.
some dude is offline   Reply With Quote
Old 7th June 2012, 03:51   #4  |  Link
some dude
Registered User
 
Join Date: Jan 2008
Posts: 30
I'm getting an error saying there is no function named ylevels
some dude is offline   Reply With Quote
Old 7th June 2012, 04:06   #5  |  Link
Mounir
Registered User
 
Join Date: Nov 2006
Posts: 711
see here for ylevels: http://avisynth.org/mediawiki/Ylevels
Mounir is offline   Reply With Quote
Old 7th June 2012, 15:23   #6  |  Link
some dude
Registered User
 
Join Date: Jan 2008
Posts: 30
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



to bad that site never offered a solution to it.
some dude is offline   Reply With Quote
Old 7th June 2012, 16:30   #7  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
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.

Code:
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.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 7th June 2012, 20:30   #8  |  Link
some dude
Registered User
 
Join Date: Jan 2008
Posts: 30
Quote:
Originally Posted by Didée View Post
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.

Code:
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.
some dude is offline   Reply With Quote
Old 8th June 2012, 02:11   #9  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 1,987
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:
Code:
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:

Code:
stackhorizontal(YtoUV(U,V,Y).assumetff.separatefields(),Y.separatefields())
So, in this particular case, are these other statements really necessary? Just curious ...
johnmeyer is offline   Reply With Quote
Old 8th June 2012, 03:04   #10  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
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.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 8th June 2012, 03:29   #11  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 1,987
Many, many thanks. Reading your stuff is like going to school. I really enjoy it.
johnmeyer is offline   Reply With Quote
Old 8th June 2012, 10:14   #12  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,380
Quote:
Originally Posted by Didée View Post
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.)
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 26th June 2012, 03:28   #13  |  Link
some dude
Registered User
 
Join Date: Jan 2008
Posts: 30
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

Last edited by some dude; 26th June 2012 at 05:56.
some dude is offline   Reply With Quote
Old 26th June 2012, 14:09   #14  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,860
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.
jmac698 is offline   Reply With Quote
Old 26th June 2012, 15:44   #15  |  Link
TheSkiller
Registered User
 
Join Date: Dec 2007
Location: Germany
Posts: 637
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.
TheSkiller is offline   Reply With Quote
Old 27th June 2012, 03:12   #16  |  Link
some dude
Registered User
 
Join Date: Jan 2008
Posts: 30
Quote:
Originally Posted by jmac698 View Post
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.
some dude is offline   Reply With Quote
Old 27th June 2012, 08:11   #17  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,860
mpgsource...
doci
simpleivtc

if it doesn't work, trim a few frames and try again until the patterns line up.
jmac698 is offline   Reply With Quote
Old 27th June 2012, 20:38   #18  |  Link
some dude
Registered User
 
Join Date: Jan 2008
Posts: 30
Quote:
Originally Posted by jmac698 View Post
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?
some dude is offline   Reply With Quote
Old 28th June 2012, 17:04   #19  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,860
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.
jmac698 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:45.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.