Hello,
Need help writing a script - say I only want to deinterlace 2-4 specific lines, is there a way to do this?
+ Reply to Thread
Results 1 to 15 of 15
-
-
Yes. Crop everything away from those 4 lines and run them through a deinterlacer. Let's call that clip A. Then create a clip B where you only crop away those 4 lines, i.e. you get all other lines. Then StackVertical() clip A and B to make a combined clip. If the lines are not at the very top or bottom you need three clips. Beware that there are limits on cropping interlaced content depending on colorspace (mod4 should be safe) and that the resulting fps should be the same. You'd probably use singe-rate interlacing.
Without a sample of your clip it is difficult to give good advice. Never saw it necessary to deinterlace only 4 lines. -
Here's one way (assuming I understand what you're asking):
Deint=(Deinterlacer here)
Deint=Deint.Crop(0,200,0,-200)###Crop down to place needing deinterlacing
Overlay(Last,Deint,0,200) -
https://drive.google.com/open?id=0B8es6v9TRPiOakh4YlFZS3RsSXc
I have a recurring line through the captures inserted by the VCR in the same place - I was thinking I could potentially deinterlace it out. When I tried Bob or Weave (don't remember) it disappeared, but I don't want to deinterlace the entire video if it isn't necessary. Would those methods fit the bill?
Thanks for the help!Last edited by premiumcapture; 11th Sep 2016 at 20:40.
-
There's a zillion places you could have uploaded it (including here) and you chose DigitalFAQ? I don't remember my name and password there.
-
My mistake, it had already been uploaded so I thought it was shareable but was wrong. Below is Google Drive. I also updated the prior link as well.
https://drive.google.com/open?id=0B8es6v9TRPiOakh4YlFZS3RsSXc
-
It's not just a few lines that show comb artifacts. It's normal telecined film -- two out of every five frames has comb artifacts. Just use TFM() and TDecimate():
Code:AviSource("Line noise.avi") TFM() TDecimate()
-
Thanks, though I realize I was not being specific enough:
I tried to highlight it the best I could but it's so high in the image it may be hard to see - it's like the second or third line down. The issue is not so much the interlacing but the colored lined that shows up at the top of the image, which is consistent through any SP played tape. Watching the video it is visible throughout. I figured I could use hard deinterlacing to get rid of the issue itself unless there's a better solution.
Thanks for the help so far.
-
Copy chroma from line 1 over line 2 after TFM and TDecimate:
Code:AviSource("C:\Users\John\Desktop\Line noise.avi") TFM() TDecimate() line=Crop(0,1,-0,1) Overlay(last, line, mode="chroma", x=0, y=2)
Code:bot=Crop(0,height-12,-0,6).FlipVertical() Overlay(last, bot, mode="chroma", x=0, y=height-6)
Last edited by jagabo; 12th Sep 2016 at 08:15.
-
-
You could get slightly better results by using the average chroma of lines 1 and 3 to replace line 2:
Code:line1 = Crop(0,1,-0,1) line3 = Crop(0,3,-0,1) line2 = Merge(line1, line3) Overlay(last, line2, mode="chroma", x=0, y=2)
-
I will try it out. Thanks for the advice.
As a follow up, how would I alter the script for straight 60i sources? Would I just remove the portions that detelecine or does something else need to replace it?
Also, if I get some vertical jitter and the frame gets shifted up for a frame or so, would I be required to split the source into sections and apply seperately and then rejoin?
Thanks again! -
You would remove the TFM().TDecimate(), then copy the chroma from two lines above or two lines below. Or interpolate between two lines above and two lines below. That is, the copied chroma should come from the same field.
Yes. Or you could create two versions of the video one with one line patched, one with the other line patched. Then use ReplaceFramesSimple() to manually specify which of the two patched versions are used when. Or you might just always patch both lines. It won't be very noticeable.
A more ambitious method would be to use the runtime functions to select the frames automatically based on the chroma values of the bad line. But that might run into problems if the normal frames start having greens and purples (the "bad" colors in line 2) there. -
That makes a lot of sense. Since this is interlaced and the issue is on line 2 most of the time, what would I do to copy 2 above? Should I try to average 1 and 4 or would that get messy?
I will check it out - ReplaceFramesSimple() looks like the most straightforward way to go with a clean source. -
Similar Threads
-
AviSynth: Weird deinterlacing issue causing 'big' interlace lines to appear
By SMGJohn in forum RestorationReplies: 15Last Post: 9th Jul 2016, 08:42 -
[avisynth] what is the deinterlace method that use less CPU?
By marcorocchini in forum Newbie / General discussionsReplies: 5Last Post: 9th Nov 2015, 18:55 -
Is this deinterlace avisynth script wrong?
By brassplyer in forum EditingReplies: 4Last Post: 27th Apr 2014, 03:40 -
How to remove horizontal white lines in VirtualDub/AVISynth
By FrankDrebin in forum RestorationReplies: 11Last Post: 18th Aug 2013, 15:32 -
high quality deinterlace, resize and denoise in AviSynth
By codemaster in forum Video ConversionReplies: 4Last Post: 21st Jun 2012, 17:04