I was working on a DVD of mine and I noticed a horizontal white line that goes all the way across the bottom. Some scenes its hard to see, others its very annoying to me and very obvious such as on white areas. Its always in the same place and through the entire movie.
This is a progressive source, so its not being created with IVTC.
I suppose I could simply just crop it off by cropping 2 from the bottom, but I wish to keep the video in it if possible.
Is there any way to remove these?
https://forum.videohelp.com/images/imgfiles/E5ypqLG.png
https://forum.videohelp.com/images/imgfiles/DCKd9bM.png (Zoomed in for easier visibility)
I tried 2 halo removers and it did not get rid of it, just reduced its visibility some at the expense of blurring the video/details a bit. I, in the end was hoping to avoid that.
I noticed really strong denoising like deen() will remove it, but that destroys so much detail.
Anyone have any better alternatives to this?
Is it possible to filter only the bottom 2 horizontal rows of pixels with denoise instead of the entire thing?
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 23 of 23
Thread
-
Last edited by killerteengohan; 7th Mar 2018 at 10:16.
-
Thanks for the idea. I have zero experience using overlay and have never done it before.
Would you mind giving me an example of its usage in the script if I wanted to mask or protect everything but the bottom 2 rows of pixels? -
Something like this:
Code:source=Mpeg2Source("filename.d2v") filtered = source.Deen(...) # or whatever # construct a mask that's black except for two lines at the bottom that are white black = BlankClip(width=source.width, height=source.height-2, color=COLOR_BLACK) white = BlankClip(width=source.width, height=2, color=COLOR_WHITE) mask = StackVertical(black,white).ConvertToYV12(matrix="PC.601") Overlay(source, filtered, mask=mask)
-
-
Yes, I often construct mask like that. If I need a fuzzy boundary I'll Blur() or BilinearResize() down and back up.
-
Jagabo, and what if the blank line(s) is located at the top of the clip, not at bottom? How to set the height in your script?
-
Another good idea. But the photo editor has nice blur filters to handle that. It's just drawing those straight lines that drives me nuts. And then maybe having to redo it if it's too thin or fat. It takes tons of time and your method is way fast and easy.
Jagabo, and what if the blank line(s) is located at the top of the clip, not at bottom? How to set the height in your script?
mask = StackVertical(white,black).ConvertToYV12(matrix="P C.601")
The first one is the top one. -
Thanks for the example. I will play around and adjust it to learn more about it until I fully get the hang of it's usage.
Is this how the mask works?
black = untouched or protected pixels on the video
and
white= filtered pixels that are placed over top of the video?
is it ever the opposite? I'm not sure if the colors are 100% certain or if you just chose those 2 colors at random.
and lastly, should I add this to the bottom of my finished script after all the filtering I want is done, or up near the top of it?Last edited by killerteengohan; 8th Mar 2018 at 05:12.
-
Overlay creates a new video from two source videos. Without a mask the second image is just laid on top of the first (think picture-in-picture). When using a mask, the output is taken from the first video where the mask is black, from the second where the mask is white. For shades of grey in between it is a weighted average of the two sources.
Add the sequence wherever it makes sense in your script. -
-
The conversion to YV12 isn't strictly necessary. Overlay can use an RGB mask (BlankClip produces RGB by default), even when overlaying YUV videos. But I often like to see the mask when I'm tuning a script (sometimes the mask is based on edges, brightness, colors, or other properites of the source video). I'll use a sequence like: Interleave(original, modified, mask) to view the original video, the modified video with the overlay, and the mask. Since the sources are YV12 the mask must also be YV12 to interleave it. ConvertToYV12() uses a rec.601 matrix by default. That puts blacks at Y=16, and whites at Y=235. But Overlay uses the full 0-255 range for the mask. So the PC.601 matrix is used instead, putting blacks at 0, whites at 255.
-
Will this work with vertical rows of pixels as well? I have tried changing the widths but I always get a script error. Usually something about image widths don't match
Code:source=Mpeg2Source("filename.d2v") filtered = source.Deen(...) # or whatever # construct a mask that's black except for two lines at the bottom that are white black = BlankClip(width=source.width-2, height=source.height-2, color=COLOR_BLACK) white = BlankClip(width=2, height=2, color=COLOR_WHITE) mask = StackVertical(black,white).ConvertToYV12(matrix="PC.601") Overlay(source, filtered, mask=mask)
What am I doing wrong and how would I adjust it if I wanted to say only filter the left 2 rows of vertical pixels? -
stackhorizontal, because you want white strip on the left, black on the right . You're not adjusting height this time, so it should be source.height
Code:# construct a mask that's black except for two lines at the LEFT that are white black = BlankClip(width=source.width-2, height=source.height, color=COLOR_BLACK) white = BlankClip(width=2, height=source.height, color=COLOR_WHITE) mask = StackHorizontal(white,black).ConvertToYV12(matrix="PC.601")
-
Would you mind helping me with this overlay mask once more please.
What if I want to filter every pixel except the very top and bottom 2 rows of pixels. So only the top 2 horizontal rows and bottom 2 horizontal rows are being unfiltered?
Those earlier ones showed me how to filter just the the top, bottom, left, or right rows of pixels one at a time. How would I set the mask up if I wanted to do 2 at a time? Say protecting top and bottom.
This time I am wanting them be unfiltered, not filter them. And I want to do 2 sides instead of just one.
Imagine cropping 2 from the top and bottom for a total of 4, then filtering everything, then putting the 4 back on unfiltered. Does what I want make sense? -
So do exactly what you imagined in the last sentence. Crop 2 from top, 2 from bottom on a "white" clip the same characteristics as the 'source'. Add "black" borders back that you just cropped
Code:mask=blankclip(source, color=color_white).crop(0,2,0,-2).addborders(0,2,0,2)
-
actually that's a limited range mask . In YUV when using blankclip, addborders, the "white" is at 235 and "black" is at 16. This means the "black" areas will still be affected and the "white" areas will not quite be 100% affected
To make it full range (0-255) in Y , add coloryuv(levels="tv->pc")
Code:mask=blankclip(source, color=color_white).crop(0,2,0,-2).addborders(0,2,0,2).coloryuv(levels="tv->pc")
Or another way is to filter it, crop and add back the unfiltered borders with stackvertical (ie. don't even use masks or overlay)Last edited by poisondeathray; 22nd Mar 2018 at 23:40.
-
-
Last edited by jagabo; 23rd Mar 2018 at 06:50.
-
Or, somewhat more inefficiently (but maybe more intuitively):
A=Last
B=Filter of choice
B=B.Crop(0,2,0,-2)
Overlay(A,B,0,2)
That's how I do it a lot. -
Yes, there are many ways to do it.
But I remember someone (?gavino) saying there is more overhead with overlay() . It's going to depend on the specific script, filters and bottlenecks, but if you can crop and stack, most of the time it will be faster than overlay . Same with scripts that are able to use mt_merge() instead of overlay() - mt_merge is preferred for speed
A quick test with dvd , and deen() the filter he was using, it's about 20-22% faster in avsmeter. But that only translates to about 6-7% faster actual encoding speed (tested with x264).
The faster the "filter", the larger the difference. For example levels(0,1.2,255,0,255,false) with a gamma shift is about 50% faster in avsmeter
(This was with x86, vanilla avisynth observations)
overlay
Code:a=MPEG2Source() b=a.deen().crop(0,2,0,-2,true) overlay(a,b,0,2)
Code:a=MPEG2Source() b=a.deen().crop(0,2,0,-2,true) stackvertical(stackvertical(a.crop(0,0,0,-478) , b) , a.crop(0,478,0,0,true))
Similar Threads
-
Blurry horizontal line on Video 8.
By digicube in forum CapturingReplies: 2Last Post: 2nd Dec 2016, 14:24 -
Horizontal line in VHS audio
By kodec in forum CapturingReplies: 4Last Post: 8th Nov 2016, 17:33 -
White Horizontal Lines on Video - Hi8 from Sony TR716
By Vid Converter in forum Newbie / General discussionsReplies: 2Last Post: 13th Jun 2016, 06:42 -
Help, horizontal burn in line on TV
By colt4523 in forum DVB / IPTVReplies: 8Last Post: 17th Dec 2015, 01:51 -
black horizontal line
By WHISPERS1944 in forum Newbie / General discussionsReplies: 1Last Post: 24th Sep 2013, 07:34