PDA

View Full Version : We need a deinterlace Module !


Jeremy Duncan
12th March 2006, 10:19
Originally Posted by Beamer
I have been experimenting for some time using Avisynth and have achieved remarkable results in respect to image processing. However, I have been plagued by occasional 'stutter'. Initiially I was of the opinion that this was being caused by lack of processing power, I now know that this is not the case, it is caused by cadence processing or lack of it.

It would appear to me that as soon as ffdshow / Avisynth is introduced in to the processing loop, we lose control of cadence!! This can be proven very simply by running a 3:2 detection test without any processing (TheatreTek) and then introducing ffdshow with a simple filter, any one will do. Theatretek / Nvidia do a wonderful job of dealing with cadence issues and the 3:2 test passes 100% but fails 100% of the time when any external processing is perfomed.

The reason for this as I understand it is that the hardware deinterlace resposibility is moved off board and onto the ffdshow, accordingly we lose the excellent deinterlace that Nvidia has developed over the years.

So! are we all fooling ourselves into beleiving that we have achieving the best post processing available?

I seems to me that we need an additional module within Avisynth to deinterlace as well as Nvidia on their hardware. The deinterlace currently in Avisynth, cannot handle the 3:2 pulldown

Before anyone responds with: I don't have interlace issues etc, I need to make clear that I can watch a lot of movies without issue but there are also some movies that I need to switch processing off to watch even though my dual processor always has at least 20% of overhead left on each processor.

Test material for the cadence test is: Silicon Optix HQV Technology 3:2 Detection Test HQV Benchmark Version 1.4

Other cadence tests fail but this particular one is crytal clear in that it works fine without processing and fails 100% of the time when any processing is introduces as indicated earlier.

http://www.avsforum.com/avs-vb/showthread.php?p=7290597%23post7290596

GodofaGap
12th March 2006, 10:36
There are several external avisynth plugins for 3:2 pulldown removal. Decomb and TIVTC are 2 of them.

Jeremy Duncan
12th March 2006, 10:58
Decomb and TIVTC.

How do you load either of these into ffdshow ?
I tried.

foxyshadis
12th March 2006, 11:02
When you mix up your terminology like that, of course you end up with mixed up results. You go around asking deinterlacers to perform IVTC, you won't get good results.

I'd post in the other thread but that forum is just too garish to read. @_@

Jeremy, I can put tfm.tdecimate in the avisynth section of ffdshow and it works just fine (if a bit slow).

Jeremy Duncan
12th March 2006, 11:07
When you mix up your terminology like that, of course you end up with mixed up results. You go around asking deinterlacers to perform IVTC, you won't get good results.

I'd post in the other thread but that forum is just too garish to read. @_@

Jeremy, I can put tfm.tdecimate in the avisynth section of ffdshow and it works just fine (if a bit slow).

So your saying he's wrong ?
Why ?
I'll repost your answer over there for you.
How do I load tfm.tdecimate in ffdshow ?
tfm()
tdecimate(mode=1, hybrid=1, clip2=newfps)
What are the values for tdecimate, and what if any .dll's do I need to run these ?

foxyshadis
12th March 2006, 11:29
Assuming you have TIVTC in your autoload folder, that's all you need. Of course settings tweaks make it go faster, like tfm(pp=0), but dvd player filters have even faster if less accurate ones built in to the splitter. Most people use them and just pass the pre-deinterlaced video to ffdshow.

This tutorial (http://www.doom9.org/ivtc-tut.htm) is one of the most comprehensive introductions to different interlacing terms and methods. You should both read it.

Jeremy Duncan
12th March 2006, 11:44
"Assuming you have TIVTC in your autoload folder, that's all you need."
I found that out.

So. Here's my setup so far.

tfm(pp=0)
tdecimate(mode=1)
ColorMatrix()
LimitedSharpenFaster(ss_x=1.0, ss_y=1.0, Smode=3, strength=100)

How can I make tdecimate faster, and better ?
What's a good setting ?

Jeremy Duncan
12th March 2006, 13:11
You go around asking deinterlacers to perform IVTC

Are you saying ffdshow, or avisynth in ffdshow, deinterlaces 3:2 pulldown at IVTC fps ?
And adding a dedicated avisynth deinterlacer would be detrimental ?
But Decomb and TIVTC do a good enough job of that ?

Wilbert
12th March 2006, 13:47
Are you saying ffdshow, or avisynth in ffdshow, deinterlaces 3:2 pulldown at IVTC fps ?
For clarity, AviSynth has no native deinterlacers ... You need to use external plugins.

He's saying that deinterlacing and performing an 'inverse telecine' are two different things. A deinterlacer deinterlaces interlaced content, and an IVTC filter performs an inverse telecine on telecined content. Since interlaced content and telecined content are two different things (see tutorial that foxyshadis posted), you can't use a deinterlacer to deinterlace telecined content and vice versa.

Decomb contains filters which you can use to TIVTC:

...
Telecide(order=0)
Decimate(cycle=5)

But it also contains filters to deinterlace content:

...
FieldDeinterlace(full=false)

There are also other plugins which you can use to IVTC (the one you posted) and deinterlace (kerneldeint, tdeint).

Didée
12th March 2006, 14:47
( Since I was PM'ed "Didée, can you help?" ... )

No I can't. Generally, it's tiredsome to solve the "problems" of those wanting to do more or less complex multi-step video processing in realtime. ("Make a proper encoding, or stick with more simple RT processing.")

In particular, trying to do inverse telecine in realtime for sure isn't a too smart idea. The most sophisticated IT filter(s) in their most sophisticated mode(s) run *way below* realtime, for an obvious reason: it's not that easy. Inversely, this means that realtime IT will always contain imperfections.

Possibilities of realtime processing are limited. Period.

Jeremy Duncan
12th March 2006, 16:46
Ok. Thank you all very much.

Jeremy Duncan
12th March 2006, 17:16
This is what I made.

LoadPlugin("G:\Program Files\AviSynth 2.5\Plugins\dgdecode.dll")
LoadPlugin("G:\Program Files\AviSynth 2.5\Plugins\Decomb521.dll")
Telecide(0)
Decimate(cycle=5)
FieldDeinterlace(full=false)
ColorMatrix()
LimitedSharpenFaster(ss_x=1.0, ss_y=1.0, Smode=3, strength=60)

It works fine. But is telecide ok at 0. I tried telecide(), but it said I had to set it to 0 or 1. I put two and two together and left out the order= part.

neuron2
12th March 2006, 17:25
But is telecide ok at 0. I tried telecide(), but it said I had to set it to 0 or 1. I put two and two together and left out the order= part. You should set order=0 if your clip is BFF and order=1 if your clip is TFF. Refer to the Decomb tutorial for the procedure for determining the correct order.

It's not necessary to use FieldDeinterlace(full=false) after Telecide(), because Telecide() does the same functionality with the default post= setting.

Your script is missing a source filter, but I assume that is just an oversight.

Jeremy Duncan
12th March 2006, 17:43
What source filter ?

Jeremy Duncan
12th March 2006, 18:06
I can't open stream in DGIndex to make a d2v file.

Do I need a d2v file to use Decomb ?
How do I make one out of a DVD, and is that legal ?

Wilbert
12th March 2006, 18:08
I guess you are using the avs filtering in ffdshow, so the source is added automatically (in the ffdshow avs window).

I can't open stream in DGIndex to make a d2v file.
Normally you should open the vobs in DGIndex, if you encode to something ...

Jeremy Duncan
12th March 2006, 18:40
Hi Wilbert,

This is what I found out after reading a bit.

I extract DGIndex.exe and DGDecode.dll
and put them in the same directory.

Assuming you have a .vob from a ripped dvd.

Open DGIndex.
Using File/Open, open your VOB.
Now select Audio/Output Method/Demux All Tracks.
Now select File/Save Project and enter a name for the D2V file.
Hit Save.
The indexing process will start.
When the process finishes, exit DGIndex.

Now you have your D2V file.

The location of your avisynth plugin folder may be different.
Copy and paste this script in the FFDShow Avisynth text box;

LoadPlugin("G:\Program Files\AviSynth 2.5\Plugins\dgdecode.dll")
LoadPlugin("G:\Program Files\AviSynth 2.5\Plugins\Decomb521.dll")
mpeg2source("G:\Program Files\AviSynth 2.5\Plugins\Movie.D2V")
Telecide(0)
Decimate(cycle=5)
FieldDeinterlace(full=false)
ColorMatrix()
LimitedSharpenFaster(ss_x=1.0, ss_y=1.0, Smode=3, strength=60)

neuron2
12th March 2006, 18:43
I can't open stream in DGIndex to make a d2v file. Do you mean a VOB? What happens when you try to open it in DGIndex?

Jeremy Duncan
12th March 2006, 19:12
No. I meant the mpeg in the dvd..

neuron2
12th March 2006, 19:50
No. I meant the mpeg in the dvd.. There are ony VOBs in DVDs.

Jeremy Duncan
12th March 2006, 19:59
Check it out.

http://img53.imageshack.us/img53/3235/16zv1.jpg

Open DGIndex.
Using File/Open, open your VOB.
Now select Audio/Output Method/Demux All Tracks.
Now select File/Save Project and enter a name for the D2V file.
Hit Save.
The indexing process will start.
When the process finishes, exit DGIndex.

The problem is in bold. "No Data. Check your Pids."

I got it going.

Jeremy Duncan
12th March 2006, 20:13
I can't get more than one vob going at a time.
It's locked up every time so far.
It's locked up every time. I tried at least a dozen times.

neuron2
12th March 2006, 20:24
Start with vts_01_1.vob. Don't try to load anything labeled vts_01_0.

Jeremy Duncan
12th March 2006, 20:45
I've tried with only vts_01_1.vob.
It locked up on me most of the time.
The rest of the time I get a "No Data. Check your Pids." error.
I tried with vts_01_2.vob, same thing.

neuron2
12th March 2006, 20:56
How did you rip these VOBs?

Can you post a short unprocessed VOB fragment (use ChopperXP).

Jeremy Duncan
12th March 2006, 21:05
I thought you said the vob's were on the dvd already.
I've being opening the dvd in my dvd drive and getting the vob's from there. As seen in the last picture I posted.

Wilbert
12th March 2006, 22:12
I've being opening the dvd in my dvd drive and getting the vob's from there. As seen in the last picture I posted.
You have to rip it first: http://www.doom9.org/dvddec.htm

neuron2
13th March 2006, 01:04
I thought you said the vob's were on the dvd already.
I've being opening the dvd in my dvd drive and getting the vob's from there. As seen in the last picture I posted. Wilbert is right. There is usually CSS encryption that is undone by the ripper software.

Jeremy Duncan
13th March 2006, 01:58
Well, I'll have to stop right here then. Since I have to rip it first.

Thanks for your help, kind people.

In the avsforum thread I linked too, somebody said that descaler5 would deinterlace and IVTC filter in real time.
Any idea if this is true ?

foxyshadis
13th March 2006, 02:21
Yep, it has autodetection built in; it's not nearly as accurate as decomb or tivtc but it's a lot faster. It also does DeCSS. ffdshow can then sit on top of it, as with any dvd player filter.

Avisynth and most of its filters are really designed for accurate preprocessing, not high-speed realtime postprocessing, and relies on tools lke autogk and megui to do autodetection, which is why it's often hard to make scripts work perfectly on playback.

Jeremy Duncan
13th March 2006, 02:45
Good stuff then.