Quantcast Avisynth: Best Deinterlacer Script? - digitalFAQ.com Forums [Archives]
  #1  
08-31-2004, 06:12 AM
andybno1 andybno1 is offline
Free Member
 
Join Date: Jul 2002
Location: Liverpool, UK
Posts: 832
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to andybno1 Send a message via Yahoo to andybno1
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.
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
08-31-2004, 06:28 AM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #3  
08-31-2004, 06:30 AM
andybno1 andybno1 is offline
Free Member
 
Join Date: Jul 2002
Location: Liverpool, UK
Posts: 832
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to andybno1 Send a message via Yahoo to andybno1
cheers I'll try that out.

so the line would go something like:

Code:
Mpeg2Source("C:\source.d2v" FieldDeinterlace)
Reply With Quote
  #4  
08-31-2004, 06:32 AM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
Ugh...

Code:
MPEG2Source(....)
Fieldeinterlace()
But check also this :
http://www.kvcd.net/forum/viewtopic.php?t=8678
Reply With Quote
  #5  
08-31-2004, 06:35 AM
andybno1 andybno1 is offline
Free Member
 
Join Date: Jul 2002
Location: Liverpool, UK
Posts: 832
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to andybno1 Send a message via Yahoo to andybno1
cheers dialhot I'm not so up on deinterlacing myself but I know tmpgenc doesn't do the best of jobs with deinterlace.
Reply With Quote
  #6  
08-31-2004, 06:39 AM
andybno1 andybno1 is offline
Free Member
 
Join Date: Jul 2002
Location: Liverpool, UK
Posts: 832
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to andybno1 Send a message via Yahoo to andybno1
would you know what plugin do I need for Smoothdeinterlace??
Reply With Quote
  #7  
08-31-2004, 06:47 AM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
Just look for the word "smoothdeinterlace" on this page and you will find your answer

http://www.avisynth.org/warpenterprises/
Reply With Quote
  #8  
08-31-2004, 06:54 AM
Prodater64 Prodater64 is offline
Free Member
 
Join Date: Mar 2003
Location: Palma de Mallorca - España
Posts: 2,925
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #9  
08-31-2004, 07:10 AM
andybno1 andybno1 is offline
Free Member
 
Join Date: Jul 2002
Location: Liverpool, UK
Posts: 832
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to andybno1 Send a message via Yahoo to 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.
Reply With Quote
  #10  
08-31-2004, 07:14 AM
Dialhot Dialhot is offline
Free Member
 
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote
  #11  
08-31-2004, 07:16 AM
andybno1 andybno1 is offline
Free Member
 
Join Date: Jul 2002
Location: Liverpool, UK
Posts: 832
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to andybno1 Send a message via Yahoo to andybno1
hehehe what I might do isdo a go with FieldDeinterlace() then smothdeinterlace an see which looks better lol thanx for the help guys.
Reply With Quote
  #12  
08-31-2004, 07:28 AM
andybno1 andybno1 is offline
Free Member
 
Join Date: Jul 2002
Location: Liverpool, UK
Posts: 832
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to andybno1 Send a message via Yahoo to andybno1
well fielddeinterlace works Smoothdeinterlace doesn't I either get a 5 second still shot of staic or I get a blank output.
Reply With Quote
  #13  
08-31-2004, 08:07 AM
Prodater64 Prodater64 is offline
Free Member
 
Join Date: Mar 2003
Location: Palma de Mallorca - España
Posts: 2,925
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #14  
08-31-2004, 08:35 AM
andybno1 andybno1 is offline
Free Member
 
Join Date: Jul 2002
Location: Liverpool, UK
Posts: 832
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to andybno1 Send a message via Yahoo to 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.
Reply With Quote
  #15  
08-31-2004, 08:46 AM
Prodater64 Prodater64 is offline
Free Member
 
Join Date: Mar 2003
Location: Palma de Mallorca - España
Posts: 2,925
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #16  
08-31-2004, 08:47 AM
andybno1 andybno1 is offline
Free Member
 
Join Date: Jul 2002
Location: Liverpool, UK
Posts: 832
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to andybno1 Send a message via Yahoo to andybno1
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()
Reply With Quote
  #17  
08-31-2004, 09:09 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
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()
Reply With Quote
  #18  
08-31-2004, 09:13 AM
andybno1 andybno1 is offline
Free Member
 
Join Date: Jul 2002
Location: Liverpool, UK
Posts: 832
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to andybno1 Send a message via Yahoo to andybno1
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
Reply With Quote
  #19  
08-31-2004, 10:42 AM
Boulder Boulder is offline
Free Member
 
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
Sure, you can deinterlace with FieldDeinterlace but you'll end up with a 29.97fps stream and that means 25% more frames to encode 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
Reply With Quote
  #20  
08-31-2004, 10:49 AM
incredible incredible is offline
Free Member
 
Join Date: May 2003
Location: Germany
Posts: 3,189
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to incredible
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!
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
KVCD: what would be the best deinterlacer to use? Paul0889 Video Encoding and Conversion 1 01-26-2004 05:52 PM
Avisynth: best deinterlacer with MA script? CheronAph Avisynth Scripting 23 01-03-2004 05:58 AM
Recording Video: Bob deinterlacer, then how to bring down the framerate? syk2c11 Video Capturing / Recording 2 08-21-2003 01:00 PM
Avisynth: Difference between MA script and optimal script? mistermickster Avisynth Scripting 2 08-01-2003 09:36 AM
Avisynth: Latest script using Avisynth 2.51 J-Wo Avisynth Scripting 6 04-08-2003 11:46 AM

Thread Tools



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