Hey! I have a video file I'd like to restore, which has weird horizontal lines all over it. I think it might be a bad deinterlacing job, but to be honest I'm unsure what it is exactly. This is how the source looks. How would I go about fixing something like this? (I know the aspect ratio is not correct). Sample attached. Thanks!
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 25 of 25
Thread
-
-
It looks like the image has been poorly resized in the vertical direction. Rather than interpolating smoothly from 720p to 480p, I believe two lines have simply been discarded every four lines. To try to undo this, you need to replace those missing rows somehow and then resize the video correctly.
Original, stripey image:
Empty space inserted every four pixels, stair stepping is largely gone:
Missing lines filled in:
And resized back to the original height:
You can achieve this with something like the following in AviSynth
Code:SeparateRows(8) x0 = SelectEvery(8, 0) x1 = SelectEvery(8, 1) x2 = SelectEvery(8, 2) x3 = SelectEvery(8, 3) x4 = SelectEvery(8, 4) x5 = SelectEvery(8, 5) x6 = SelectEvery(8, 6) x7 = SelectEvery(8, 7) # Create filler for missing lines a2 = Merge(x2,x3, 0.33) a3 = Merge(x2,x3, 0.67) a6 = Merge(x6,x7, 0.33) a7 = Merge(x6,x7, 0.67) # Insert filler and put image back together Interleave(x0,x1,x2, a2,a3, x3,x4,x5,x6, a6,a7, x7) WeaveRows(12) # Return image back to original dimensions BilinearResize(width(), 480)
Still, just doing this much removes a lot of the stripey-ness from the video; I've included a clip with the original and fixed side by side. -
It should be fairly straightforward as no external filters are used, except for a source filter of your choosing.
I also realized that the stripe pattern already repeats after four lines - I went with eight while trying to figure out what exactly is missing. This shorter script should perform exactly the same correction:
Code:SeparateRows(4) x0 = SelectEvery(4, 0) x1 = SelectEvery(4, 1) x2 = SelectEvery(4, 2) x3 = SelectEvery(4, 3) # Create filler for missing lines a2 = Merge(x2,x3, 0.33) a3 = Merge(x2,x3, 0.67) # Insert filler and put image back together Interleave(x0,x1,x2, a2,a3, x3) WeaveRows(6) # Return image back to original dimensions BilinearResize(width(), 480)
-
I'm getting this error, even though I installed the only version of Avisynth I can see, which should be 32 bit. What do I need to change?
[Attachment 57770 - Click to enlarge] -
Hmm... well the message certainly seems to indicate that a 64 bit AviSynth is being used - is it possible you have multiple copies installed, perhaps some other package you have installed included AviSynth with it?
The versions I am using are AviSynth+ (64 bit) and the FFmpegSource plugin for loading videos. -
Okay, so I reinstalled Avisynth+, and deleted it with its own uninstaller this time. Now it gives this error:
[Attachment 57772 - Click to enlarge]
Script looks like this:
Code:# DGDecode: LoadPlugin("d:\Data\dgmpgdec2005\dgdecode.dll") MPEG2Source("d:\Data\MattyP\vegas\full.d2v") SeparateRows(4) x0 = SelectEvery(4, 0) x1 = SelectEvery(4, 1) x2 = SelectEvery(4, 2) x3 = SelectEvery(4, 3) # Create filler for missing lines a2 = Merge(x2,x3, 0.33) a3 = Merge(x2,x3, 0.67) # Insert filler and put image back together Interleave(x0,x1,x2, a2,a3, x3) WeaveRows(6) # Return image back to original dimensions Spline64Resize(width(), 480)
-
Open your scripts with VirtualDub2. It should give you a better error message.
One of the main things to watch out for is "bitness". If you use a 32 bit editor/encoder you must have 32 bit AviSynth installed and 32 bit versions of all the 3rd party filters. If you use a 64 bit editor/encoder you need to have 64 bit AviSynth installed and 64 bit versions of all the 3rd party filters.
Note that SeparateRows() and WeaveRows() are not included in AviSynth, only AviSynth+. -
Looks alright to me - does it work if you leave out everything after MPEG2Source()? If yes, it could be the SeparateRows() call, it was added in AviSynth 2.60 so an older version would fail there.
You could also try loading the script in VirtualDub, perhaps it can present a more meaningful error message. -
I remade the d2v file with only one of the VOBs instead of all 3, it now opens the script without error messages in Virtualdub (still gives an error in command prompt). Processing seems to be non-existent though. Does it just not execute filters when they're not available? Because then the problem could be that they're just missing from the install.
-
It should definitely complain "There is no function named --" if an unknown command is used. Can you try the script on the exact same sample you posted here? It's possible that the broken scaling is not constant throughout the full video, and adjustments would be needed.
-
-
It looks like I can't process the exact sample I uploaded here, DGIndex says "Error: No video sequence header found!". I processed the entirety of the first VOB though (where it should've thrown an error for missing plugins), and it ran and finished it. It skipped over the missing plugins, because it did perform the resize (I changed it from 480 to 720) that was the very last command.
-
Hmm, well I don't know what to say. The script runs yet there is no visible difference at all, the jagged edges remain untouched? I mean this method won't get rid of all the aliasing (some information has simply been thrown away in the bad resize), but you should at least see the improvements like in my sample video.
-
Are you saying both ffmepg and VirtualDub both give the exact same message?
-
Are you saying both ffmepg and VirtualDub both give the exact same message?
[Attachment 57775 - Click to enlarge] -
Then you are probably using 32 bit VirtualDub with 32 bit AviSynth, and 64 bit ffmpeg but don't have 64 bit AviSynth installed. Or are trying to load a 32 bit filter into 64 bit AviSynth:
Code:LoadPlugin("d:\Data\dgmpgdec2005\dgdecode.dll")
-
So now that I can I did this through ffmpeg, and it didn't say anything. Here's the script and command I ran:
Code:# DGDecode: # LoadPlugin("d:\Data\dgmpgdec2005\dgdecode.dll") # MPEG2Source("d:\Data\MattyP\vegas\full.d2v") LoadPlugin("c:\Users\Me\Downloads\ffms2-2.40-msvc\ffms2-2.40-msvc\x86\ffms2.dll") FFmpegSource2("d:\Data\MattyP\vegas\vegas08sample.mp4") SeparateRows(4) x0 = SelectEvery(4, 0) x1 = SelectEvery(4, 1) x2 = SelectEvery(4, 2) x3 = SelectEvery(4, 3) # Create filler for missing lines a2 = Merge(x2,x3, 0.33) a3 = Merge(x2,x3, 0.67) # Insert filler and put image back together Interleave(x0,x1,x2, a2,a3, x3) WeaveRows(6) # Return image back to original dimensions Spline64Resize(width(), 720)
Code:ffmpeg -i script.avs -c:v libx264 -preset veryslow -crf 16 "output.264"
-
Are you sure the filters are not being executed? How about if you change the filler lines like this:
Code:# Create filler for missing lines a2 = BlankClip(x0) a3 = BlankClip(x0)
You don't need to encode a long video to check the result - just load the script in VirtualDub and see what it looks like there. -
Thank you for this, yes, you were right, they were being run. I'm doing a full encode of VTS 1 with the original filters to compare with the source.
Similar Threads
-
How would you restore this clip?
By SomeoneNeutral in forum RestorationReplies: 5Last Post: 4th Mar 2021, 09:15 -
What would be the best way to restore this old footage?
By SomeoneNeutral in forum RestorationReplies: 8Last Post: 5th Sep 2019, 05:27 -
Can someone restore this file?
By coco3456 in forum RestorationReplies: 0Last Post: 5th Jan 2019, 01:47 -
Can I come to restore this video?
By ciccioschumacher in forum RestorationReplies: 120Last Post: 10th Apr 2018, 23:53 -
Can someone help me restore this
By Starfx in forum RestorationReplies: 10Last Post: 13th Aug 2017, 12:33