Log in

View Full Version : Quick Deinterlacing Question...


LeoH
10th July 2009, 23:05
Well, I think it's quick anyway :)

Basically I've got a PAL DV file which was dubbed from a PAL BetaSP which came from a film source. The original film was shot at 24fps but I'm assuming they did the 4% speed-up when doing the telecine at 25fps. Anyway I'm trying to deinterlace this sucker the best way possible. Once I get to real 25p I'll convert it back down to 24p.

Here is a frame from the source:

http://img44.imageshack.us/img44/2193/frame1j.jpg

My first try in VDub was with the filter "deinterlace - PAL movie v1.1 (normal)" and it seems to be doing the right thing. Here is the same frame after filtering:

http://img44.imageshack.us/img44/9900/frame2h.jpg

My question is, why am I still getting (albeit minor) comb artifacts on the edges? My paranoia says that I must be doing something wrong - or is this "normal" when deinterlacing, to have some minor artifacts still? Am I approaching this in the right way or should I be doing something else?

Here's a short clip of the material:
http://rapidshare.com/files/254364852/Clip1.rar.html

Many thanks in advance for any help! :D

Leo

LoRd_MuldeR
10th July 2009, 23:17
Obviously the deinterlace filter you used didn't catch all combing artifacts. If that filter has options, try to tweak the parameters.

If you can't get acceptable results with that filter, I highly recommend you give Yadif or TDeint a try ;)

BTW: Most deinterlace filters leave a few artifacts here and there. But the question is: Are they visible at normal playback speed?

Guest
10th July 2009, 23:22
Post a link to an unprocessed sample of your source material to get a definitive answer.

horrormaster34
10th July 2009, 23:23
Yadif is godly in my opinion when it comes to deinterlacing. It can take the most horribly interlaced video and make it appear progressive like no other.

LeoH
10th July 2009, 23:25
Thanks for the fast reply! Well, this particular filter has no options except for "swap fields first" which didn't seem to help. It actually does a pretty good job with the whole film - aside from the minor comb artifacts on the edges. But since this material is from film, shouldn't the fields simply fit back together into one seamless frame? I don't want to use any filters that interpolate or are destructive to the original source if possible. Thanks again!

Guest
10th July 2009, 23:28
Post a sample!

I think that filter is a field matcher and doesn't deinterlace per se. The minor residue can be due to field distortions. But to tell you for sure we need a sample.

LeoH
11th July 2009, 00:15
OK, here's a short unprocessed clip of the material:

http://rapidshare.com/files/254364852/Clip1.rar.html

I think a field matcher sounds like the right ticket possibly, but feel free to let me know what you think of the clip.

Many thanks!! :D

LoRd_MuldeR
11th July 2009, 00:43
This is not only field shift, it also has additional distortions. Like that weird color ghosting between the fields:

http://img9.imageshack.us/img9/3963/clip1r.png

But "decomb telecide" to fix the field shift followed by Yadif to clean-up the remaining combing artifacts seems to give reasonable results:
http://www.mediafire.com/?yaykindhzeq

LeoH
11th July 2009, 01:28
Thanks Mulder

Yeah the video has other problems, but I was trying to focus on just getting it back into progressive frames first. Decomb telecide and Yadif do seem to work nicely! What script did you use? I've tried this with just the Decomb filter:

AssumeBFF()
Telecide(guide=2,post=2,vthresh=50)

Seemed to produce reasonable results but maybe I should try Yadif for the "post" part.

Thanks again!

LoRd_MuldeR
11th July 2009, 12:06
I simply used "Decomb Telecide" (in "PAL/SECAM" mode) followed by Yadif (in Non-Bob mode). This was done in Avidemux.

But I think you can simply append Yadif(mode=0,order=0) to your script and see whether that does help or not ;)

http://avisynth.org.ru/yadif/yadif.html

LeoH
11th July 2009, 21:59
I've tried Yadif after Decomb Telecide and it does produce nice results. There were still a few very minor comb artifacts on certain rounded edges, so I tried running "field bob" in VDub in conjunction with the AviSynth script of Decomb Telecide and Yadif. That seemed to take care of all the jagged edges and I don't think the quality suffered. Of course now I'm noticing all the other weird problems with the video - like the frequent wobble across the middle of the screen. :(

One thing at a time for now... :)

LoRd_MuldeR
11th July 2009, 22:18
I think if you use "Field Bob" in VirtualDub, which basically throws away one field (half of the lines) and then interpolates the missing field, you can drop Yadif.

LeoH
11th July 2009, 22:42
I think if you use "Field Bob" in VirtualDub, which basically throws away one field (half of the lines) and then interpolates the missing field, you can drop Yadif.

I didn't realize "Field Bob" was throwing away one of the fields :scared: I was trying to avoid interpolating. Maybe I'll check some other plugins to clean the edges after Decomb Telecide.

LoRd_MuldeR
11th July 2009, 22:53
I didn't realize "Field Bob" was throwing away one of the fields :scared: I was trying to avoid interpolating.

Any deinterlacer does interpolate ;)

Only "smart" (motion adaptive) deinterlacers don't blindly interpolate all the pixles of one field, but try to keep as many pixels as possible.
This is possible because in areas where there's no motion, we can simply weave the fields with no visible combing.

As far as I understand, Yadif does not work like that. In interpolates all pixels of one filed, but uses a very smart method (http://trac.handbrake.fr/wiki/yadif) to do that.

LeoH
12th July 2009, 01:53
Any deinterlacer does interpolate ;)

But "smart" (motion adaptive) deinterlacers don't blindly interpolate all the pixles of one fields, but try to keep as many pixels as possible.
This is possible because in areas where there's no motion, we can simply weave the pixels without visible combing.

As far as I understand, Yadif does not work like that. In interpolates all pixels of one filed, but uses a very "smart" method to do that.

Hmm, so what's the advantage to using Yadif along with Decomb Telecide if it's throwing out the fields that Decomb Telecide is matching? I may as well just use Yadif alone right? Sorry if I'm missing something obvious, I'm a little rusty with this kind of stuff. :)

LoRd_MuldeR
12th July 2009, 02:03
Hmm, so what's the advantage to using Yadif along with Decomb Telecide if it's throwing out the fields that Decomb Telecide is matching? I may as well just use Yadif alone right? Sorry if I'm missing something obvious, I'm a little rusty with this kind of stuff. :)

Decomb Telecide doesn't deinterlace. It just re-orders the fields to undo Telecine or to fix field-shifted streams.
After that process we (ideally) get the original progressive frames back. No interpolation does happen.
Of course Decomb Telecide only works with Telecined or filed-shifted material. It does not work on "true" interlaced video at all!

In your case the video appears to be field-shifted and Decomb Telecide does restore the video pretty well.
Unfortunately there are some filed distortions, which cause these minor combing artifacts shown in your screenshot.
Putting a deinterlacer (e.g. Yadif) behind Decomb Telecide removes those artifacts.

Of course you could skip the Decomb Telecide filter and only use Yadif. This should remove the combing too.
But you probably get better quality, if the deinterlacer bases its decisions on the "fixed" stream instead of the field-shifted one.
The same way we could simply deinterlace a Telecined stream, but we certainly shouldn't do that!

BTW: Maybe one of the Avisynth gurus could write a script to fix your field distortions in a smarter way ;)
Appending Yadif is the quick and dirty solution to clean-up the remaining combing...

LeoH
12th July 2009, 03:18
Decomb Telecide doesn't deinterlace. It just re-orders the fields to undo Telecine or to fix field-shifted streams.
After that process we (ideally) get the original progressive frames back. No interpolation does happen.
Of course Decomb Telecide only works with Telecined or filed-shifted material. It does not work on "true" interlaced video at all!

In your case the video appears to be field-shifted and Decomb Telecide does restore the video pretty well.
Unfortunately there are some filed distortions, which cause these minor combing artifacts shown in your screenshot.
Putting a deinterlacer (e.g. Yadif) behind Decomb Telecide removes those artifacts.

Of course you could skip the Decomb Telecide filter and only use Yadif. This should remove the combing too.
But you probably get better quality, if the deinterlacer bases its decisions on the "fixed" stream instead of the field-shifted one.
The same way we could simply deinterlace a Telecined stream, but we certainly shouldn't do that!

BTW: Maybe one of the Avisynth gurus could write a script to fix your field distortions in a smarter way ;)
Appending Yadif is the quick and dirty solution to clean-up the remaining combing...

OK, I think I understand. I guess the problem is I'm not really sure how Yadif is working on the material. I suppose it doesn't matter too much as long as it does the job! :rolleyes: It seems my main problem is this field distortion issue. I've tried searching for some filters to address it, but haven't found anything yet. This must be a common problem though - especially with old telecine tapes? Which gurus should I appeal to? :D

:thanks:

UPDATE:

I think I've found the perfect solution! It's an AviSynth plug called "Vinverse" - the description reads "An effective Function against (residual) combing, by Didée. Useful after deinterlaceing." Well, I've tried it and it seems to work like a charm. My residual combing problems appear to be gone and edges are smooth!

Guest
12th July 2009, 04:54
Decomb Telecide doesn't deinterlace Wrong. It has a post processor that catches combed frames that slip through the field matching process. That is enabled by default.

The post processor in Telecide() will test if the frame has combing and apply deinterlacing only to the combed frames. Yadif will act on all frames, whether combed or not. That is not good.

Your post is borderline FUD.

LeoH
12th July 2009, 05:23
Wrong. It has a post processor that catches combed frames that slip through the field matching process. That is enabled by default.

The post processor in Telecide() will test if the frame has combing and apply deinterlacing only to the combed frames. Yadif will act on all frames, whether combed or not. That is not good.

Your post is borderline FUD.

I'm not trying to start any disagreements, i think he was just trying to help out. :) After running a couple of tests I believe my results are better turning off the post processor in Decomb Telecide and using the Vinverse plugin to clean up the minor combing bits left. With the post processing on in Telecide I was still getting a little combing on edges (especially hi-con curved edges). Anyway I'm pretty happy with the Decomb Telecide & Vinverse combo for now.

LoRd_MuldeR
12th July 2009, 12:21
Wrong. It has a post processor that catches combed frames that slip through the field matching process. That is enabled by default.

Well, sorry. I didn't realize that "post processing" feature. Now I noticed that post-processing is off by default in Avidemux.

But basically the idea of an Inverse Telecine filter is to restore full frames by merging fields in the correct order/pattern, instead of interpolating.

If there's an (additional) post processor in Decomb Telecide to catch remaining combing artifacts, good. Will try to keep that in mind ;)


The post processor in Telecide() will test if the frame has combing and apply deinterlacing only to the combed frames. Yadif will act on all frames, whether combed or not. That is not good.

Yeah, that's why I said that appending Yadif (as yet another post-processor) is the "quick and dirty" solution.

If you know a better one (maybe Decomb Telecide's post filter can be tweaked to give better results on LeoH's source), I think it would be welcome :)

(BTW: TDeint has a similar option to only process "combed" frames, so it can act as a post-processor too)


It seems my main problem is this field distortion issue. I've tried searching for some filters to address it, but haven't found anything yet. This must be a common problem though - especially with old telecine tapes?

I think the problem is that "wobble" effect in your source :scared:

Even if the fields are merged in the correct pattern, they don't fit perfectly together, because of these distortions.

Maybe the "correct" solution would be to shift each odd (even) line horizontally until it fits...

Guest
12th July 2009, 15:09
But basically the idea of an Inverse Telecine filter is to restore full frames by merging fields in the correct order/pattern, instead of interpolating. That's an arbitrary limitation. Why would you not want to have useful functionality included?

If there's an (additional) post processor in Decomb Telecide to catch remaining combing artifacts, good. If?! What are you talking about? I just told you there is one and you acknowledged it in your post.

If you know a better one (maybe Decomb Telecide's post filter can be tweaked to give better results on LeoH's source), I think it would be welcome This looks very good to me on the sample:

telecide(vthresh=30)

BTW: TDeint has a similar option to only process "combed" frames, so it can act as a post-processor too Yes, but Decomb was first. :)

LoRd_MuldeR
12th July 2009, 15:38
That's an arbitrary limitation. Why would you not want to have useful functionality included?

I just explained how IVTC works by definition:

Instead of interpolating one field (as a deinterlacer would do) it re-orders the fields according to a pattern in order to reconstruct the original progressive frames.

Everything that goes beyond that is post-processing, not plain IVTC. But I never doubted that such post-processing is useful ;)

If?! What are you talking about? I just told you there is one and you acknowledged it in your post.

If you quote me, please don't pick out fragments and put them in the wrong context.

In my previous post I already admitted that I had missed the post-poressing part of Decomb Telecide before. And I made clear that I now understand it is there (for a good reason).

It should have been clear that the "if" statement in my post evaluates to TRUE. No need to nag around on this any further ;)

Guest
12th July 2009, 16:15
If you quote me, please don't pick out fragments and put them in the wrong context. I didn't do any such thing. Why would you say "if" when you already knew it was true? Some strange psychology? Decomb has been around for over half a decade; its functionality is well known. Why would you try to obfuscate this?

LoRd_MuldeR
12th July 2009, 16:20
As my statement was pretty clear in the original context, I won't further comment on this. We all know what was meant now ;)

Back to topic:
telecide(vthresh=30) seems to give much better results. But I'm not sure whether I prefer that over the Yadif version...

smok3
12th July 2009, 16:21
I think the problem is that "wobble" effect in your source :scared:

Even if the fields are merged in the correct pattern, they don't fit perfectly together, because of these distortions.

Maybe the "correct" solution would be to shift each odd (even) line horizontally until it fits...

i believe somebody wrote a TBC (time base corrector) like function once (never tested it thought) and i'am not sure if it would really help here.

EasyRider_
12th July 2009, 20:26
http://img9.imageshack.us/img9/3963/clip1r.png


http://www.mediafire.com/?yaykindhzeq




WOW..!! Great job! respect..!! http://i29.tinypic.com/2bqgev.gif

LoRd_MuldeR
12th July 2009, 21:02
WOW..!! Great job! respect..!!

The screenshot was intended to show the color ghosting that is present in the source clip :rolleyes:

LeoH
12th July 2009, 22:25
I'm pretty satisfied with the results of combining Decomb Telecide with Vinverse. The post processor in DT doesn't seem to quite catch all the combing leftovers on it's own, so I turned it off and just used Vinverse for cleanup.

AssumeBFF()
Telecide(guide=2,post=0,vthresh=30,show=false)
loadplugin("vinverse.dll")
vinverse()

Here's a resulting frame:
http://img34.imageshack.us/img34/117/frame2j.jpg

Now when I tried only using Telecide and it's post processing, the results weren't as good (IMHO). Notice around the edge of the glasses...

AssumeBFF()
Telecide(vthresh=30)

http://img196.imageshack.us/img196/4264/frame1v.jpg

If there was some filter to fix the field "wobble" or distortion, so that they lined up nice and even, I would gladly try it rather than use Vinverse (which I understand is simply a blur/sharpen routine). So far this is the best I've found.

Hope everyone's having a great Sunday - and thanks for the help and suggestions. :)

EasyRider_
13th July 2009, 14:09
The screenshot was intended to show the color ghosting that is present in the source clip :rolleyes:


Ok.. but i also see the deinterlacing result.. ;) :D

http://www.mediafire.com/?yaykindhzeq

SuperLumberjack
23rd October 2019, 14:57
Hello everybody :)

I'm looking for a specific kind of deinterlacing method.

In fact, I want an adaptative method which is mixing the Bob and the Weave method.

Here it's explained :

https://www.100fps.com/

Analyzing the two fields and deinterlace only parts which need to. The main difference to "Area based" is that it gives you a 50fps movie instead of a 25fps movie, thus leaving you with perfect fluidity of motions. To say it more academically: High temporal and vertical resolution.

This is my method of choice. You can achieve this with freeware. Read the advantages and drawbacks on this site.

Something like the Framemeister XRGB-mini does (I don't know if it's the same method) is interesting me too :

https://shmups.system11.org/viewtopic.php?f=6&t=33450&start=10200

The Framemeister by default will do a per-pixel motion adaptive deinterlace, which basically means that when stuff isn't in motion it does a weave de-interlace, and when stuff is in motion it does an interpolation-based deinterlace. This preserves both the smoothness of moving objects and the sharp detail of non-moving objects. The framemeister also supports an OSSC-like bob deinterlacer in certain modes.

I precise that I'm not looking for something like Nnedi3 or Eedi3 ;)

I just want to test these kind of specific methods.


Thanks for your help ! :thanks:

SuperLumberjack
24th October 2019, 03:10
Here we can see the very good deinterlacing method of the XRGB-mini Framemeister with 480i content :

https://youtu.be/nbCt9_87hBo

Compared to the Bob method of the OSSC :

https://youtu.be/ZMdRZCMBI-k

I really think that the method of the Framemeister is impressive ! :o

Is there a way to get a similar method with AviSynth or a VirtualDub filter ?

Thanks for your help ! ;)

videoh
24th October 2019, 14:43
Is there a way to get a similar method with AviSynth or a VirtualDub filter ? You have been describing adaptive deinterlacing. There are already many adaptive deinterlacers for Avisynth. If you want the gold standard, go with QTGMC.

SuperLumberjack
24th October 2019, 20:24
OK. Thanks for your answer ! ;)

SuperLumberjack
26th October 2019, 11:36
The QTGMC looks very impressive ! :)

But a bit complicated and slow. Yadif isn't bad with double framerate either and less complicated :p

I tested another surprising deinterlacer called "Smooth Deinterlacer". We can find it here :

https://www.guthspot.se/video/AVSPorts/SmoothDeinterlacer/

So we can use this function for the best :

SmoothDeinterlace(tff=false, doublerate=true)

or

SmoothDeinterlace(tff=true, doublerate=true)

It's a mix between bob and weave deinterlacing.

Groucho2004
26th October 2019, 11:46
The QTGMC looks very impressive ! :)

But a bit complicated and slow. Yadif isn't bad with double framerate either and less complicated :p
QTGMC may be a bit slow but this reputation is largely based on users who think "placebo" presets are necessary. "Medium" preset already produces decent results and is reasonably fast.
Also, quality-wise, TGMC/QTGMC blows everything else out of the water, see this (http://www.mediafire.com/file/yb57rgd41b4clxu/Bobbing_Nvidia_TGMC_Yadif_tdeint.mkv/file) clip.
Lastly, there's nothing complicated about QTGMC - pick a preset and let it do its thing.

SuperLumberjack
26th October 2019, 13:06
OK. Thanks ! I think I will try ! ;)

No, in fact, I was just too lazy too download the plugins required ! :p It's the complicated thing ! :D


P.S. : Does the QTGMC automatically detect if it's BFF or TFF in the source ?

SuperLumberjack
26th October 2019, 13:33
There are so many plugins to install. Each time I get a new error from VirtualDub :(

It would have been cool to put them all in one pack with the QTGMC...

Sorry, even if I'm not completely a noob, I'm still a noob ! :D


Edit 1 : I don't understand what I'm supposed to do with the files from the "FFTW3" archive... So yes, it's a bit complicated with all these plugins. It's why I was lazy ! :p

Edit 2 : I said nothing ! :D https://forum.doom9.org/showthread.php?t=156028

SuperLumberjack
26th October 2019, 13:56
I get this error :) :

Avisynth open failure:
FFT3DFilter: libfftw3f-3.dll or fftw3.dll not found. Please put un PATH or use LoadDll() plugin

I placed the files "libfftw3f-3.dll" and "FFTW3.dll" in the SysWow64 folder, but it doesn't work.

SuperLumberjack
26th October 2019, 14:09
Sory, I used the x64 version of VirtualDub instead of the x86 ! :p

But with the 32 bit version, I still have an error :rolleyes::

Avisynth open failure:
Script error: mt_lut does not have a named argument "use_expr"
(C:Program Files (x86)/AviSynth+/plugins+/SMDegrain.avsi, line 737)
(C:Program Files (x86)/AviSynth+/plugins+/QTGMC.avsi, line 494)

StainlessS
26th October 2019, 14:13
looks like maybe old version masktools.

EDIT: looks like use_expr also requires Avs+. [uses avs+ Expr() ]

EDIT:

Pinterf Masktools:- https://github.com/pinterf/masktools
AviSynthPlus_3.4.0_20191020.exe:- https://github.com/AviSynth/AviSynthPlus/releases

SuperLumberjack
26th October 2019, 14:15
looks like maybe old version masktools.


Thanks for your answer ! :)

But I took all the DLL from this pack :

http://www.mediafire.com/?nm188lh2oam487m

Source : https://forum.doom9.org/showthread.php?t=156028

StainlessS
26th October 2019, 14:27
That pack from 2012,
however, looks like some of the other stuff (QTGMC or SMDegrain) is real.finder recent versions requiring updated plugs.

EDIT:
the changed from 3.33 (https://forum.doom9.org/showthread.php?p=1423459#post1423459) you need to know is (there are others, you can get it from the QTGMC.avsi):-

1- it work only with 2.6 avs or avs+, avs 2.5 dropped
2- it work with YUY2 without ssetools
3- it's ready to HBD (it work in the Default settings now for 10-16 bit)


some notes:-

1- it's need masktools 2.2.17 or above (https://github.com/pinterf/masktools/releases) or you will get wrong result
2- it's may need some other scripts and up-to-date plugins, see the wiki page

last version in this post (https://forum.doom9.org/showthread.php?p=1836519=510) and this one (https://forum.doom9.org/attachment.php?attachmentid=15838&d=1491145773) is older if anything wrong

wiki page http://avisynth.nl/index.php/QTGMC

SuperLumberjack
26th October 2019, 15:26
:thanks: It works ! More or less... :D

The picture looks very dark ! :o

SuperLumberjack
26th October 2019, 18:44
In fact, I took a video in a 480p resolution and interlaced it, then I tested all these deinterlacing method to compare (with double framerate) :) :

- non interlaced
- bob
- smooth deinterlacer
- yadif

And I think it's the "smooth deinterlacer" that I prefer, because my goal wasn't necessarily to have a perfect image, but to have a good imitation of the render of a interlaced video on a CRT TV ;)

https://www.guthspot.se/video/AVSPorts/SmoothDeinterlacer/

I tried to keep something authentic, but not as bad as the weave method and it's really impressive when I compare the source in 480p with the video in 480i deinterlaced with the "smooth deinterlacer" ! I think it's the same effect than switching between 480p and 480i on a CRT ! :o

But I'm still curious to see the result with the QTGMC method ! ;)

For other contents it could be useful !

StainlessS
26th October 2019, 22:28
There is also LeakKernelDeint, and FieldDeinterlace (both old-ish) and a few more :- http://avisynth.nl/index.php/External_filters#Deinterlacing
QTGMC has a load of parameters which alter results, including speed.

You should never assume that any field order dependant filter detects field order and set it properley yourself.
(some may detect what field order is currently in-force, ie what you have set it to [or what it defaults to, but that is not necessarily correct]).


No idea why you got dark result.
EDIT:

Colorbars(pixel_type="YV12")
#SomeSourceFilter(...)
ORG=Last

DeinterlaceThingy()

SSS="""
oy=ORG.AverageLuma
ny=Last.AverageLuma
return RT_Subtitle("Old = %f\nNew = %f",oy,ny)
"""

return ScriptClip(SSS)

SuperLumberjack
26th October 2019, 22:57
OK. Thanks StainlessS ! ;)

I will watch all of this.