View Full Version : Any way to deinterlace a resized video?
color
11th December 2022, 19:59
I don't know exactly when, but I did record this with a camera that had video input (digital) that could record from regular composite video. I don't know if it downscaled it first or what it did. But I didn't touch the video at all, since it was on the memory card still. (but its 640x480, 24fps, wierd cause its normaly 720x576 and 25 fps here) Anyway...
Sadly the tape does not exist anymore and this is the only copy of it, and the only film I'm in (so this means alot if its possible to somewhat save it).
VIDEO clip:
https://sprend.com/download?C=60026b08a35d4aabbcfd06c4a75d005a
When I try to deinterlace, it looks like this:
https://i.ibb.co/zsrD6Mw/vlcsnap-2022-12-11-19h55m37s864.png
Selur
11th December 2022, 20:30
Throw away half of the horizontal resolution and then go back to the original resolution would be the usual way to approach this.
Spline36Resize(640,240)
Spline36Resize(640,480)
color
11th December 2022, 21:09
Throw away half of the horizontal resolution and then go back to the original resolution would be the usual way to approach this.
Spline36Resize(640,240)
Spline36Resize(640,480)
I will try tomorrow. Thank you.
johnmeyer
11th December 2022, 23:49
Selur's approach will not work because when you resize interlaced video without first deinterlacing, the "teeth" artifacts are more than one field high.
I did "solve" this problem many years ago and, to my knowledge, this is still the only way to improve the look of your video. I never generalized the function, so as I describe on the third page of the thread, you'll have to change the script depending on the number of horizontal lines in each "tooth."
repair bad deinterlacing (https://forum.doom9.org/showthread.php?t=170813)
After some false starts, I begin to make progress in post #15. Post #42 is the code which I think was my final attempt at fixing the problem, although post #37 may be easier to modify.
VoodooFX
12th December 2022, 00:48
VIDEO clip:
https://sprend.com/download?C=60026b08a35d4aabbcfd06c4a75d005a
Can't download, you can use Wetransfer of Google drive.
Max number of downloads for file reached. Please contact the sender if you need to download the file. Sender: Anonymous user (not logged in)
Reel.Deel
12th December 2022, 03:16
Adding to Selur's suggestion:
FFVideoSource("044.mkv")
Spline36Resize(width, height/2)
NNEDI3CL(field=1, dh=true)
QTGMC(Preset="Slower", InputType=1)
https://i.ibb.co/FVWN21p/baddeint.png
Probably the best it's going to get.
Can't download
https://files.videohelp.com/u/223002/044.mkv
Selur
12th December 2022, 04:55
Selur's approach will not work because when you resize interlaced video without first deinterlacing, the "teeth" artifacts are more than one field high
works for this example for me,...
Adding to Selur's suggestion
Yes, using a better upscale and some additional cleaning will improve the result.
The general idea is to downscale the horizontal resolution so much that you lose the combing lines, and then upscale back to the original resolution.
I like the idea of johnmeyer approach, but unless someone can generalize this into a function with parameters, it doesn't really look usable to me. :)
Cu Selur
color
12th December 2022, 09:36
Adding to Selur's suggestion:
FFVideoSource("044.mkv")
Spline36Resize(width, height/2)
NNEDI3CL(field=1, dh=true)
QTGMC(Preset="Slower", InputType=1)
Probably the best it's going to get.[/url]
Is there any difference between NNEDI3 and NNEDI3CL? It seems like its a 64-bit and I only have 32-bit version in avisynth+ plugins installed, so I cant try this right now. But I must say it looks quite good. :)
https://i.ibb.co/7Nw5705/radera.png
there is some blended frames, but its not so often its noticed.
https://i.ibb.co/SXJVLV7/radera1.png
kedautinh12
12th December 2022, 09:57
It's just faster and i think no difference
Dogway
12th December 2022, 10:01
Maybe you can use a descaler to recover original detail.
Reel.Deel
12th December 2022, 10:07
Is there any difference between NNEDI3 and NNEDI3CL? It seems like its a 64-bit and I only have 32-bit version in avisynth+ plugins installed, so I cant try this right now. But I must say it looks quite good. :)
there is some blended frames, but its not so often its noticed.
NNEDI3CL works on the GPU, just replace it with NNEDI3(field=1, dh=true). There's not much you can do about the blended frames since they are "baked" into the video. Similar to when you scale an interlaced video to half the height, you get blended frames. In the sample you provided there is no fast motion but maybe you can try some deblend filters (http://avisynth.nl/index.php/External_filters#Fieldblending_and_Frameblending_removal).
color
12th December 2022, 10:37
NNEDI3CL works on the GPU, just replace it with NNEDI3(field=1, dh=true). There's not much you can do about the blended frames since they are "baked" into the video. Similar to when you scale an interlaced video to half the height, you get blended frames. In the sample you provided there is no fast motion but maybe you can try some deblend filters (http://avisynth.nl/index.php/External_filters#Fieldblending_and_Frameblending_removal).
I will try, but i think its baked in as you write.
Thank you all for the help! Im now able to watch the video again. ☺️
wonkey_monkey
12th December 2022, 11:01
works for this example for me,...
Mostly because the downscale/upscale results in a vertical blur. Just blur(0,1) (or FastBlur(0,1) ;) ) gives a similar result.
color
12th December 2022, 14:24
Mostly because the downscale/upscale results in a vertical blur. Just blur(0,1) (or FastBlur(0,1) ;) ) gives a similar result.
A bit, but I think it looks a bit better with NNEDI3-method, but I agree, It looks a bit similar.
Reel.Deel
12th December 2022, 18:03
For a sharper look you can you use DAA (http://avisynth.nl/index.php/DAA):
FFVideoSource("044.mkv")
daa().Blur(0,.25)
QTGMC(Preset="Slower", InputType=1)
Tweak blur so it gets rid the small interlaced residuals.
kedautinh12
12th December 2022, 18:20
AllInOne Anti-aliasing with contra-sharpening
https://github.com/Dogway/Avisynth-Scripts/blob/88d7dd948b6ce852d3c847c7ead9b0574f9b2c5d/MIX%20mods/LSharpAAF.avsi#L403
Selur
12th December 2022, 20:10
@Reel.Deel: nice, catch using daa() :) adding mClean after daa() also looks nice. :)
kedautinh12
13th December 2022, 00:49
vsmclean with bug fix from mclean
https://forum.doom9.org/showthread.php?p=1953247#post1953247
color
13th December 2022, 08:53
vsmclean with bug fix from mclean
https://forum.doom9.org/showthread.php?p=1953247#post1953247
Tried both, but I do get "mClean does not have a named argument "yy"".
kedautinh12
13th December 2022, 09:00
Tried both, but I do get "mClean does not have a named argument "yy"".
Are you got median filter??
http://avisynth.nl/index.php/Median
color
13th December 2022, 09:00
DAA method and NNEDI method:
https://i.ibb.co/qySzrVy/daa.png https://i.ibb.co/qY1F5vk/nnedi.png
I think NNEDI looks a bit better accouly.
color
13th December 2022, 09:04
Are you got median filter??
http://avisynth.nl/index.php/Median
Yes I am:
LoadCPlugin("C:\Program Files (x86)\AviSynth+\plugins\Median.dll")
EDIT: I see, I was missing "vsTCanny" and "veed" (modPlus). Now it works.
kedautinh12
13th December 2022, 09:12
Sr, my mistake, you need manyplus from V.C.Mohan (different median from above) :D
http://www.avisynth.nl/users/vcmohan/
Reel.Deel
13th December 2022, 09:13
DAA method and NNEDI method:
I think NNEDI looks a bit better accouly.
Yeah, DAA keeps more detail overall but also the artifacts. When I was messing with DAA() I used sbrV() (http://avisynth.nl/index.php/Sbr) twice on the result and got a better looking result while not loosing too much detail. I suppose denoising the DAA result using a downscaled-upscaled clip as a prefilter could yield a decent result.
kedautinh12
13th December 2022, 09:19
Delete modplus (oldver of manyplus) to work correctly. If error about yy still continue, you can try delete median.dll (maybe)
Edit: just read edited. If work correctly, you don't need delete median.dll
color
13th December 2022, 09:21
Yeah, DAA keeps more detail overall but also the artifacts. When I was messing with DAA() I used sbrV() (http://avisynth.nl/index.php/Sbr) twice on the result and got a better looking result while not loosing too much detail. I suppose denoising the DAA result using a downscaled-upscaled clip as a prefilter could yield a decent result.
Yes, that looks good. :)
https://i.ibb.co/pryLYsg/vsmclean.png
kedautinh12
13th December 2022, 09:25
Yes, that looks good. :)
https://i.ibb.co/pryLYsg/vsmclean.png
You can share your scripts you use?? Thanks :D
Edit: scripts not clip, sr
color
13th December 2022, 09:35
You can share your scripts you use?? Thanks :D
Edit: scripts not clip, sr
https://we.tl/t-IvDVk8SpS0
FFMpegSource2("video.avi")
Spline36Resize(width, height/2)
NNEDI3(field=1, dh=true)
QTGMC(Preset="Slower", InputType=1)
VSmClean()
sbrV().sbrV()
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.