📜 ⬆️ ⬇️

Video rip. Part 2-3. Getting rid of ordinary interlacing (deinterlace)

Content


  1. DVD preparation
    1. vStrip
    2. DGMPGDec

  2. Video processing
    1. What is interlace and what it is eaten with
    2. How to determine what we have: progressive, interlaced or telecined?
    3. Getting rid of ordinary interlacing (deinterlace)
    4. IVTC

  3. Squeeze and pack


The first thing to do is to get the idea out of using the deinterlace filter from VirtualDub. I know it is not easy, but necessary. The thing is that after processing with this filter (with some settings) parasitic images appear on the video, for example, so-called. ghost effect. It looks like this or that . It's horrible.

I made screenshots for examples from the video that madnut shared with me.

We will get rid of interlacing with AviSynth plugins. There are a lot of them, so all the possible ones will not be mentioned. If your loved one has forgotten - do not be angry. I emphasize that this article does not consider plugins to remove pulldown and IVTC. About them - then.
')
Also, let me remind you that in the case of ordinary interlacing, making a video progressive without loss of quality will not work.

First you need to establish the correct order of appearance of fields. Top Field First (TFF) or Bottom Field First (BFF). There are two AssumeTFF or AssumeBFF commands in AviSynth for this. How to do it is well written here . Also, it shows DGMpgDec. MeGUI can also help you with this. How? Read the previous part, only instead of the Source type, look at the Field order.

As a result, you will have something like this:

DirectShowSource("00581.mts")
AssumeTFF()


Let's go directly to the filters.

Bob

This is not even the name of a specific plugin, but the name of the whole technique “Bob deinterlacing”. Its essence is that the frame rate is doubled, using the fields as frames. At the same time, the missing lines in each field are restored using interpolation or duplication. The disadvantages stem from a doubling of the frame rate - more resource-intensive decoding and an increase in the size of the video stream.

It is considered the best method, judging only by the output quality.

To use Bob deinterlacing, add the Bob command to the end of the script. The result is:

DirectShowSource("00581.mts")
AssumeTFF()
Bob()


Screenshot

Yadif

The name is an abbreviation of Y et A nother De Nterlacing F ilter. This filter has been ported to AviSynth by Michael Niedermayer. It checks the pixels of the previous, current, and next frame to restore fields using a local adaptive method (edge-directed interpolation) and uses spatial check to prevent most artifacts from appearing. A detailed explanation of the algorithm is here .

One of the easiest to use filters. I have version 0.9.

The input takes 4 parameters:



Screenshots: 0, 1 , 2 , 3 .

Example of use:

LoadCplugin("yadif.dll")

DirectShowSource("00581.mts")
AssumeTFF()
Yadif(0)


or, which is the same

LoadCplugin("yadif.dll")

DirectShowSource("00581.mts")
AssumeTFF()
Yadif()


Which method to use? Use - 0 if you do not know that you need others.

Smoothothinterlace

This plugin is more complicated. It has all sorts of options for fine tuning. Using it, however, is quite simple.

LoadPlugin("SmoothDeinterlacer.dll")

DirectShowSource("00581.mts")
AssumeTFF()
SmoothDeinterlace()


You can add different settings, for example, doublerate - doubling the frame rate.

LoadPlugin("SmoothDeinterlacer.dll")

DirectShowSource("00581.mts")
AssumeTFF()
SmoothDeinterlace(doublerate=true)


Screenshots: by default , with doubling .

TomsMoComp

I will quote the official source.

TomsMoComp.dll is a deinterlacing filter that uses motion compensation and adaptive processing. It works at different speeds depending on the SearchEffort parameter, which in this version varies from 0 (just a slightly higher quality BOB-deinterlacing) to 30 (too large amount of computation for modern computers). From this range, several values ​​are actually used (in this version, 0,1,3,5,9,11,13,15,19,21, max), if you specify a different value, the closest one is used. Values ​​above 15 have not yet been thoroughly tested and should probably be avoided.


Actually, do not add or subtract.

Example of use:

LoadPlugin("TomsMoComp.dll")

DirectShowSource("00581.mts")
AssumeTFF()
TomsMoComp(-1, 1, 0)


The SearchEffort parameter is the second.

Screenshots for SearchEffort = 1 , 30 .

On this, perhaps, I will stop. What filter to use, you ask? And I answer - I do not know. Selecting a filter is akin to arguing about choosing a codec or operating system. Try it. What seems to you the best - that one and use. If you are still torn by doubts, then try YADIF first, then TomsMoComp, and if none of these fit SmoothDeinterlace. Use pure Bob if you are sure of the need to use it.

Download TomsMoComp 0.0.1.7
Download SmoothDeinterlace 1.5.5
Download YADIF 0.9

Additions from readers
Xitsa
The conversation would be incomplete without the legendary MVBob script, considered the best of its kind. About him it is better to read everything that is on doom9.
If someone wants to try, then this is not a very fresh build (but everything is included).


sabox
What about TDeint? In my opinion, it can be in line with the above listed.

TDeint is a bidirectional, motion compensated (sharp) de-interlacing (deinterlacer). He can also adaptively choose between using adaptation to motion over whole fields and over pixels. It can use cubic interpolation, nuclear (matrix) interpolation (with switching time directions), or one of two forms of modified edge adaptive (ELA) interpolation, which helps reduce jagged edges in moving areas where interpolation should be used. TDeint also supports manual correction by the user through a special input file and can work as an intelligent field converter to a full-frame (bobber) or interlacing with preserving the original frame rate, as well as a post-processor for the inverse telekino transformation (IVTC).

Source: https://habr.com/ru/post/61822/


All Articles