digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: best Deinterlacer script? (http://www.digitalfaq.com/archives/avisynth/11847-avisynth-best-deinterlacer.html)

andybno1 08-31-2004 06:12 AM

Avisynth: best Deinterlacer script?
 
anyone know of a good line to add to the optimal script for deinterlacing a dvd rip ntsc music video?

I'm tryin to put together my own little music dvd of nusic vids I have on the dvds I bought.

Dialhot 08-31-2004 06:28 AM

I always use FieldDeinterlace (to put just after the load of the source).
But I'm not the "guru" of deinterlacing there, and also I deal with PAL that can be different.

andybno1 08-31-2004 06:30 AM

cheers I'll try that out.

so the line would go something like:

Code:

Mpeg2Source("C:\source.d2v" FieldDeinterlace)

Dialhot 08-31-2004 06:32 AM

Ugh...

Code:

MPEG2Source(....)
Fieldeinterlace()

But check also this :
http://www.kvcd.net/forum/viewtopic.php?t=8678

andybno1 08-31-2004 06:35 AM

cheers dialhot I'm not so up on deinterlacing myself but I know tmpgenc doesn't do the best of jobs with deinterlace.

andybno1 08-31-2004 06:39 AM

would you know what plugin do I need for Smoothdeinterlace??

Dialhot 08-31-2004 06:47 AM

Just look for the word "smoothdeinterlace" on this page and you will find your answer :-)

http://www.avisynth.org/warpenterprises/

Prodater64 08-31-2004 06:54 AM

Quote:

Originally Posted by Dialhot
I always use FieldDeinterlace (to put just after the load of the source).
But I'm not the "guru" of deinterlacing there, and also I deal with PAL that can be different.

I'm not the "guru" also, but I think Incredible know a lot about this.

http://www.kvcd.net/forum/viewtopic.php?t=9808

Quote:

Originally Posted by Incredible
If that doesn't work and by this you got a real interlaced 29,97 NTSC VIDEO stream, you can encode that stream in mpeg2 interlaced 29.97fps mode OR using Sharfis_Brain's function to convert that Stream to 23.976 which means less fps and therefore less movieinformation to encode! and by this you will receive more CQ in other words this needs less bitrate!

Here's the function of Sharfis_brain:
(his page where the function is explained: http://home.arcor.de/scharfis_brain/60ito24p.html )


Code:

       

Mpeg2Source("D:\Your Real Interlaced 29.97 Movie.d2v")

bob() # or even better "Smoothdeinterlace(doublerate=true, blend=false)"
convert60ito24p(2,0)

.... followed by the resizers, filters and addborders of avisynth



#
############### the function #############
#
function convert60ito24p (clip video, int mode, int offset)
{
work = assumefieldbased(video)
out = (mode==2) ? interleave(
\selectevery(
\layer(trim(work, 1, 0),
\layer(work, trim(work, 2, 0), "fast"),
\"fast"), 5, 0 + offset),
\selectevery(
\layer(work, trim(work, 1, 0), "fast"), 5, 3 + offset)) :
\    (mode==1) ? interleave(
\selectevery(trim(work, 1, 0), 5, 0 + offset),
\selectevery(layer(work, trim(work, 1, 0), "fast"), 5, 3 + offset)) :
\    (mode==0) ? selectevery(work, 5, 1 + offset, 4 + offset) : work
assumeframebased(out)
}
#################################





... in case of NTSC AVI sources like captures:

Also the same thing. If combing does appear in case of captured Hollywood movies you do deal with a telecined NTSC FILM capture, which will be treated by

Avisyource("xxxxxxxx.avi")
Telecide()
Decimate()

If combing does appear in case of REAL interlaced VIDEO roots (concerts, station trailers, documentations etc.), then you can encode that in mpeg2 interlaced at still 29.97 or also here using Sharfis_Brains function as explained above to get to 23.976 fps which are more easy to compress.

Read whole thread to know how to search combing effect, if you don't know how.

andybno1 08-31-2004 07:10 AM

well I had a read through that post by incredible and I'm more confused than I was lol so I just went with FieldDeinterlace() seems to do the job fine.

Dialhot 08-31-2004 07:14 AM

Quote:

Originally Posted by andybno1
well I had a read through that post by incredible and I'm more confused than I was lol so I just went with FieldDeinterlace() seems to do the job fine.

Don't worry, that is exactly the same thing for me :lol:

andybno1 08-31-2004 07:16 AM

hehehe what I might do isdo a go with FieldDeinterlace() then smothdeinterlace an see which looks better lol thanx for the help guys.

andybno1 08-31-2004 07:28 AM

well fielddeinterlace works Smoothdeinterlace doesn't I either get a 5 second still shot of staic or I get a blank output.

Prodater64 08-31-2004 08:07 AM

Always agrre with Incredible saids, Fielddeinterlace works fine just for PAL interlaced sources.
For NTSC interlaced sources he recommends that I posted in my previous post.
And as you can see, you can use bob() rather than smoothdeinterlace.

andybno1 08-31-2004 08:35 AM

well I downloaded dgbob plugin used dgbob() and got again blank video output, so I thought I'd use the script in your code and got a 3 second blank video output.

Prodater64 08-31-2004 08:46 AM

Quote:

Originally Posted by andybno1
well I downloaded dgbob plugin used dgbob() and got again blank video output, so I thought I'd use the script in your code and got a 3 second blank video output.

Well, I'm beg your perdon, but I never use it, I only quoted Inc. and maybe he can help us now.

andybno1 08-31-2004 08:47 AM

zorry I wasn't meaning to sound like I was having a go I was just commenting on what happend. Think safe bet is just put up with fielddeinterlace()

incredible 08-31-2004 09:09 AM

You do mix up something!

Every Bobber like KernelBob(), DgBob(), Smoothdeinterlace(doublrate=true) .... does quick said not really deinterlace in the known way. He does separte the fields and resizes them to full frameheight!

Means the full fieldrate containing full video vertical size comes out. Soid in easy words. In pal this is 25*2 or in NTSC 29.97*2

Sharfisbrains function needs NO simple deinterlacer BUT a bobber in front! Means the ones I mentioned above. BTW ... Smoothdeinterlace() is not the state of the art, try DgBob() or KernelBob().

Just deinterlacing a 29.97 to 29.97 makes NO sense!

- if your stream is true Video like Concerts, Documentations etc. THEN try Scharfis_Brains function or even the new MV method posted by boulder below in the 60ito24p Thread.

- if your stream is just telecined (Hollywoodmovie) then do a IVTC like explained in my Interlacing-Thread.


A bobber is used for instance if you want to do a HQ interlaced resizing:

Avisource("YourInterlacedVideo")
AssumeTFF() # The right Fieldorder here!
Bob() #.... bobbing (twice the framreate will come out)
LanczosResize(... regular FULL HEIGHT settings ...)
separatefields()
Selectevery(4,1,2) # Inverse the bob
Weave()



For Bottomfield First:

Avisource("YourInterlacedVideo")
AssumeBFF() # The right Fieldorder here!
Bob() #.... bobbing (twice the framreate will come out)
LanczosResize(... regular FULL HEIGHT settings ...)
separatefields()
Selectevery(4,0,3) # Inverse the bob
Weave()

andybno1 08-31-2004 09:13 AM

when I tried the smoothdeinterlace and dgbob and got a blank output but fielddeinterlace worked fine for me so I think for future reference I'll stick with that as I couldn't seem to get it to work

Boulder 08-31-2004 10:42 AM

Sure, you can deinterlace with FieldDeinterlace but you'll end up with a 29.97fps stream and that means 25% more frames to encode :arrow: a lot lower quality.

You're much better off using the 60ito24p method described in that thread pointed to you.

Simply:

Code:

MPEG2Source("path\clip.d2v")
KernelBob(order=x,sharp=true,threshold=7) # determine the field order!
MVConvert60ito24p()
#and the rest of the script as in a normal encode

function mvconvert60ito24p(clip x, int "mode")
{

mode = default(mode,2)
mbl=0.1

vectorsforward = x.mvanalyse(isb = false)
vectorsbackward = x.mvanalyse(isb = true)

y = x.mvinterpolate(vectorsbackward, vectorsforward, nb = 4, bl = 0.5 - mbl, el = 0.5 + mbl, wf = "hat")

interleave(y,x)
mode0=selectevery(5,2)
mode1=overlay(selectevery(5,3),selectevery(5,2),opacity=0.5)
mode2=overlay(overlay(selectevery(5,1),selectevery(5,3),opacity=0.5),selectevery(5,2),opacity=0.3)
mode3=overlay(overlay(selectevery(5,0),selectevery(5,3),opacity=0.5),overlay(selectevery(5,1),selectevery(5,2),opacity=0.5),opacity=0.5)

(mode==0) ? mode0 : (mode==1) ? mode1 : (mode==2) ? mode2 : mode3

}

You'll need MVTools, here: http://jourdan.madism.org/~manao/MVTools-v0.9.3.zip and KernelDeint, here: http://www.avisynth.org/warpenterpri...l_20040824.zip

incredible 08-31-2004 10:49 AM

Quote:

Originally Posted by andybno1
when I tried the smoothdeinterlace and dgbob and got a blank output but fielddeinterlace worked fine for me

Thats because you go into Smoothdeinterlace using YV12! Smoothdeinterlace needs YUY2 and maybe DgBob() too.

Said again: DONT!!!!!! just deinterlace 29.97 Videos as still a 29.97 stream with blendings would come out!!! Use the function Boulder quoted above!


All times are GMT -5. The time now is 02:14 AM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.