Quantcast Avisynth: Interlaced Sources Guide? [See Pg2] - digitalFAQ.com Forums [Archives]
  #1  
04-09-2004, 10:12 AM
J-Wo J-Wo is offline
Free Member
 
Join Date: Nov 2002
Location: Toronto, Canada
Posts: 454
Thanks: 0
Thanked 0 Times in 0 Posts
I find this topic a very confusing one! When it comes to interlaced sources and MA scripts, it just seems like there are too many suggestions floating around. I hope by asking these questions someone could make a "definitive" sticky for dealing with interlaced sources.

- Boulder has a thread MA script for interlaced sources, but for the life of me I just can't get it to work. I guess I am too used to Moviestacker. He mentions stuff like mod4, mod2, and height/2, and despite my best efforts to try that out I can't for the life of me get his script to work.
- Incredible has the thread Interlaced / Progressive ... and what it means: which deals with deinterlacing sources.
- So does Kwag in the stickyConverts 60fps Video into 24fps, but then Incredible makes some suggestions
- and finally, what about Kwag's latest MA optimal script?

My problem with Boulder's MA script for interlaced sources is I simply cannot get it to work as it is. So I combined Incredible's deinterlacing with Kwag's MA script but the encoding right now is sllllloooowwwww.

I'm sorry if I have asked similar questions in the past, but I still feel in the dark on this! I hope someone can shed some light on this issue for me. Thanks
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  
04-09-2004, 10:20 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
I think the same. And maybe a taslation to spanish language.
Reply With Quote
  #3  
04-09-2004, 02:00 PM
J-Wo J-Wo is offline
Free Member
 
Join Date: Nov 2002
Location: Toronto, Canada
Posts: 454
Thanks: 0
Thanked 0 Times in 0 Posts
I really hope someone can help me. I'm trying to encode a DVD of the movie "Camp". DVD2AVI reports that it is NTSC and interlaced, I do see combing during high action scenes when I preview with DVD2AVI. But I'm so confused by

a) which script should I be using? Kwag's MA optimal?
b) How should I treat this interlaced material? Telicide/Decimate? Bob? Smoothdeinterlace? convert60ito24p? or the multitude of OTHER deinterlacing means?

Despite all the guides out there I still have no way of telling whether my source is "true" interlaced or not, and what the implications of that are. And what about IVTC? Basically if my source isn't Film I am 100% confused about what to do!
Reply With Quote
  #4  
04-09-2004, 08:46 PM
muaddib muaddib is offline
Free Member
 
Join Date: Jun 2002
Location: São Paulo - Brasil
Posts: 879
Thanks: 0
Thanked 0 Times in 0 Posts
Well, if your source is 29.970fps interlaced you have some alternatives:

1- Encode it as Interlaced and keep the 29.970fps. In this case you can use Boulder's script

2- Deinterlace it and keep the 29.970fps. In this case you just use a deinterlacer, like TomsMoComp, FieldDeinterlace, Telecide (without Decimate) and others. You have to choose the one you prefer. After that you can use the MA script.

3- Deinterlace and change to 23.976fps. In this case you can use the convert60ito24p script and than use the MA script.

I have not tested the convert60ito24p script, so I don't know if the results are good. But if they are... I would certainly choose the third alternative.
Reply With Quote
  #5  
04-09-2004, 10:26 PM
J-Wo J-Wo is offline
Free Member
 
Join Date: Nov 2002
Location: Toronto, Canada
Posts: 454
Thanks: 0
Thanked 0 Times in 0 Posts
After a long day of experimenting, here are my results. I tried using convert60ito24p on my film but the results were horrible, with either Bob or SmoothDeinterlace. During camera panning scenes I could definately see where the interlaced fields have been combined (I believe the term is ghosting?). I had the best results using telecide() and decimate(). I'm not certain why you said not to use decimate, but with it my encode was converted to 23.976fps. I then enabled 2:3 pulldown in DVD-lab as I'm making KDVDs. Oh, and I am then using the MA script.

The results so far have been fantastic. I'm encoding with CCE at Q=15, min/max = 64/4500. This compressed a 6 Gb movie down to around 2.5 Gb with really no noticeble difference. In fact the source was rather grainy with noise, and the MA script seemed to do a good job of smoothing the film out.
Reply With Quote
  #6  
04-09-2004, 11:07 PM
muaddib muaddib is offline
Free Member
 
Join Date: Jun 2002
Location: São Paulo - Brasil
Posts: 879
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by J-Wo
I tried using convert60ito24p on my film but the results were horrible, with either Bob or SmoothDeinterlace. During camera panning scenes I could definately see where the interlaced fields have been combined (I believe the term is ghosting?).
That's what I feared.

Quote:
I had the best results using telecide() and decimate(). I'm not certain why you said not to use decimate, but with it my encode was converted to 23.976fps.
Because decimating a non telecined movie will lead into a slightly jerk playback. That's a fact.
I've done some movies exact like you describe. Many friends didn't notice the problem at all. But some noticed, and I almost have headaches watching a 2 hours movie like this.
Reply With Quote
  #7  
04-09-2004, 11:16 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
convert60ito24p script must *ONLY* be used on a 100% interlaced source

-kwag
Reply With Quote
  #8  
04-10-2004, 12:01 AM
J-Wo J-Wo is offline
Free Member
 
Join Date: Nov 2002
Location: Toronto, Canada
Posts: 454
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
convert60ito24p script must *ONLY* be used on a 100% interlaced source
Okay well I think that is where my confusion lies. How does one TELL that? DVD2AVI says it is interlaced but I find this topic so confusing, whether it truly is or not. Ack!

Quote:
Originally Posted by muaddib
Because decimating a non telecined movie will lead into a slightly jerk playback. That's a fact.
I've done some movies exact like you describe. Many friends didn't notice the problem at all. But some noticed, and I almost have headaches watching a 2 hours movie like this.
Hmm that's interesting. My encode looks very smooth with decimate, at least a small 2 min clip with camera panning did. I'll check the entire film to see if I notice this. But if I don't, what does that mean about the kind of interlaced film I have?

I just wish there would be a simple and easy way to figure out what to do with Interlaced material. For progressive film material, the criteria are so clear cut. Just check out doom9.org
Reply With Quote
  #9  
04-10-2004, 12:07 AM
jorel jorel is offline
Invalid Email / Banned / Spammer
 
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
hard way.....i never understood it completely.....

http://www.doom9.org/ivtc-tut.htm

Reply With Quote
  #10  
04-10-2004, 11:02 PM
Icarus3000 Icarus3000 is offline
Free Member
 
Join Date: Feb 2003
Posts: 258
Thanks: 0
Thanked 0 Times in 0 Posts
I asked this elsewhere, but didn't get a clear response.

If I use my DV cam to capture from VHS, will the new "source" be 100% interlaced regardless of the original source?
Reply With Quote
  #11  
04-10-2004, 11:08 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Icarus3000
I asked this elsewhere, but didn't get a clear response.

If I use my DV cam to capture from VHS, will the new "source" be 100% interlaced regardless of the original source?
No. If the source was FILM, it's then telecined to 29.97fps on yor VHS.
You'll get your capture at 29.97fps which you should Inverse Telecine for best quality.
So you have to find out if your capture's original material is FILM or interlaced.

-kwag
Reply With Quote
  #12  
04-11-2004, 03:12 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 muaddib
2- Deinterlace it and keep the 29.970fps. In this case you just use a deinterlacer, like TomsMoComp, FieldDeinterlace, Telecide (without Decimate) and others. You have to choose the one you prefer. After that you can use the MA script.
I wouldn't do that cause as you already kill the smoothness advantage of 29.97 interlaced as you do deinterlace, then you can also do the next step and apply the 60iTo24p function - as this will result in a much better compresable 23.976 Stream.

So my suggestion is .... if "real" interlaced source is present:
- you can deinterlace but you also then should bring it to 23.976 (60iTo24p function)
- to keep the quality you can encode directly as interlaced but in case of even 29.97 this means a veeeery lot avg bitrate needed
Reply With Quote
  #13  
04-11-2004, 03:16 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 Icarus3000
I asked this elsewhere, but didn't get a clear response.
If I use my DV cam to capture from VHS, will the new "source" be 100% interlaced regardless of the original source?
Ok, you do capture from VHS, but the main question is: What does your VHS material base on??, means: IF you got a hollywoodmovie on your VHS then this has been shot on FILM in its veeery original state before it was brought to VHS. Means they did a telecine on that FILM material (23.976) to bring it to 29.976 VIDEO material (29.97).
Reply With Quote
  #14  
04-11-2004, 08:13 AM
bigggt bigggt is offline
Free Member
 
Join Date: Mar 2003
Location: IamCanadian
Posts: 848
Thanks: 0
Thanked 0 Times in 0 Posts
HI J-Wo

This is no solution because i am in the same boat as you i have no idea ,i go to doom9 and search the title of the movie and sometimes you can get clues what people did to get it to work.
Reply With Quote
  #15  
04-11-2004, 08:32 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
This version of the MA script should work well with interlaced sources:

Code:
 ## DLL Section ## 
# 
LoadPlugin("C:\Filters25\MPEG2Dec3.dll") 
LoadPlugin("C:\Filters25\GripFit_YV12.dll") 
LoadPlugin("C:\Filters25\STMedianFilter.dll") 
LoadPlugin("C:\Filters25\asharp.dll") 
LoadPlugin("C:\Filters25\unfilter.dll") 
LoadPlugin("C:\Filters25\undot.dll") 
# 
#### 
## Main section and static filters ### 
# 
Mpeg2Source("Your_D2V_Source_Here") 
# 

GripCrop(Your_GripCrop_Parameters_Here)

UnFoldFieldsVertical(flip=true)

undot() 
asharp(1, 4) 
GripSize(resizer="BicubicResize") 
STMedianFilter(3, 3, 1, 1 ) 
MergeChroma(blur(1.5)) 
MergeLuma(blur(0.1)) 
# 
# 

## Linear Motion Adaptive Filtering ## 
# 
# ( Portions from AviSynth's manual ) 
# This will apply variable temporalsoften 
# and variable blur. 
# Both filters are active at all times, and work inversely proportional to the 
# activity, measured from current frame to next frame. 

ScriptClip(" nf = YDifferenceToNext()" +chr(13)+ "unfilter( -(fmin(round(nf)*2, 100)), -(fmin(round(nf)*2, 100)) ).TemporalSoften( fmin( round(2/nf), 6), round(1/nf) , round(3/nf) , 1, 1)  ") 

# 
# 
# 

FoldFieldsVertical(flip=true)

GripBorders() 
#LetterBox( Your_Values_Here ) # Depends on situation. Use MovieStacker! 

# 
# 
## Functions ### 

function fmin( int f1, int f2) { 
  return ( f1<f2 ) ? f1 : f2 
} 
  
function SetParity(clip c, bool parity)
{
    return parity ? c.AssumeTFF() : c.AssumeBFF()
}

function UnfoldFieldsVertical(clip c, bool "flip")
{
    flip = default(flip, false)
    oldParity = c.GetParity()
    c = c.AssumeTFF().SeparateFields().AssumeFrameBased()
    top = c.SelectEven()
    bottom = c.SelectOdd()
    c = StackVertical(top, flip ? bottom.FlipVertical()
    \                           : bottom)
    return c.SetParity(oldParity)
}

function FoldFieldsVertical(clip c, bool "flip")
{
    assert(c.Height() % 2 == 0, "FoldFieldsVertical: unexpected frame height")
    flip = default(flip, false)
    oldParity = c.GetParity()
    originalHeight = c.Height() / 2
    evens = c.Crop(0, 0, c.Width(), originalHeight)
    odds = c.Crop(0, originalHeight, c.Width(), originalHeight)
    odds = flip ? odds.FlipVertical() : odds
    c = Interleave(evens, odds).AssumeFieldBased().AssumeTFF().Weave()
    return c.SetParity(oldParity)
}

# 
####
Reply With Quote
  #16  
04-11-2004, 09:05 AM
jorel jorel is offline
Invalid Email / Banned / Spammer
 
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by bigggt
HI J-Wo

This is no solution because i am in the same boat as you i have no idea ,i go to doom9 and search the title of the movie and sometimes you can get clues what people did to get it to work.
i'm in the same boat as you 2, but outside... (glub)
can a castaway up a board?...thanks.
now we need a navy.... more will come !
Reply With Quote
  #17  
04-11-2004, 09:14 AM
bigggt bigggt is offline
Free Member
 
Join Date: Mar 2003
Location: IamCanadian
Posts: 848
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Jorel
i'm in the same boat as you 2, but outside... (glub)
can a castaway up a board?...thanks.
now we need a navy.... more will come !
Hop a board
The more the merrier
Reply With Quote
  #18  
04-11-2004, 05:03 PM
J-Wo J-Wo is offline
Free Member
 
Join Date: Nov 2002
Location: Toronto, Canada
Posts: 454
Thanks: 0
Thanked 0 Times in 0 Posts
Jorel your link to http://www.doom9.org/ivtc-tut.htm was extremely helpful! I suggest a sticky should be put up either linking to that article or some bold person do a summerization of it, incorporating changes as needed to suit KVCD/KDVDs.

It did a REALLY good job of explaining whether your source is 100% 29.97 interlaced or 23.976 telecined to 29.97. Turns out my source was the latter, so a simple IVTC (inverse telecine) worked.

That page provides some excellent avs samples to check your source. For example, load your source with
Code:
 LoadPlugin("mpeg2dec.dll")
LoadPlugin("Decomb.dll")
MpegSource("clip.d2v")
Telecide(post=false)
and then open that file in Vdub. Advance frame by frame. For my source, I saw a pattern of 2 repeated frames followed by 3 progressive (non-interlaced) frames, meaning I could safely use IVTC. An alternative is to load your source with only MpegSource() with no telecine line. In that instance, you will see 2 interlaced frames followed by 3 progressive frames. If however I saw that almost every frame was interlaced, IVTC would not work and I would have to deinterlace.

I ended up making a script with the following IVTC lines:
Code:
 Telecide(Guide=1,Post=False)
Decimate(Cycle=5)
and the results were beautiful. The Post=False option turns off the post-processing deinterlacer, which speeds up the encoding process. This is only recommended on very "clean" telecined sources, and it turns out for my sources I still saw a stray interlaced frame every now and then during high action scenes. However the result is hardly noticeable on TV.

Anyway admitadly this topic is much more complicated than I first imagined, but with the help of this forum I'm learning more day by day!
Reply With Quote
  #19  
04-11-2004, 08:04 PM
jorel jorel is offline
Invalid Email / Banned / Spammer
 
Join Date: Aug 2002
Location: Brasil - MG - third stone from the sun
Posts: 5,570
Thanks: 0
Thanked 0 Times in 0 Posts
oh yes J-Wo, a long time i posted this :
http://www.kvcd.net/forum/viewtopic.php?t=5664
that have links to that page and some more.
i read it thousands.....
i know that this page is amazing but my poor english don't help me...
Boulder a few months, send me good explanations but it still confuse to me.

in the end of the tutorial is wroten:
"CONCLUSION
The subject is not an easy one if you’re just learning it for the first time.
It will take practice and experimentation to gain a better understanding
of the concepts and methods involved.
But we hope this tutorial will help some of you. "

then i'm out of the "some of you" in the phrase....
i really need a "how to" for stups....like: "do this" if.....and "do that" if don't...
Reply With Quote
  #20  
04-12-2004, 10:50 AM
J-Wo J-Wo is offline
Free Member
 
Join Date: Nov 2002
Location: Toronto, Canada
Posts: 454
Thanks: 0
Thanked 0 Times in 0 Posts
Jorel: I think I'll start working on just such a guide! It'll be really simple with straight forward steps, not getting into any complicated scenarios but hopefully will be enough for most users. I'll post a reply to this thread later, let me know what you think!
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Avisynth: Guide to dealing with interlaced sources Boulder Avisynth Scripting 121 04-07-2008 09:36 AM
KVCD: Interlaced/29.970 sources? gretagun Video Encoding and Conversion 13 01-08-2005 02:29 PM
Avisynth: MA script for interlaced sources? Boulder Avisynth Scripting 52 04-03-2004 02:47 PM
DVD2SVCD: Script for Interlaced sources azel Video Encoding and Conversion 3 11-02-2003 11:29 AM
VirtualDub: Correcting Field Order and Swapping in interlaced sources ozjeff99 Video Encoding and Conversion 9 05-16-2003 02:21 AM

Thread Tools



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