Quantcast Avisynth: Interlaced Sources Guide? [See Pg2] - Page 2 - digitalFAQ.com Forums [Archives]
  #21  
04-12-2004, 11:11 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 J-Wo
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!
what i think?
it's very J-Wo !
i'm waiting your guide.

my recomendations:
IF (only if) you have doubts...
ask Boulder, vmesquita, ink, Kwag, muaddib, Phil,
and all the wises to help you too !
send lots of pms if needed!
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
  #22  
04-12-2004, 11:20 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

I know I would and alot of other people would appreciate a simple guide
Reply With Quote
  #23  
04-12-2004, 01:45 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
NTSC Interlaced Sources - A Simple Guide

The following is a very simple guide on dealing with NTSC Interlaced sources. At this time, I am not covering such topics as PAL sources, NTSC to PAL conversions (or vice versa), or hybrid interlaced sources. My goal is to provide a very basic step-by-step guide on this topic. My apologies if I "plagerize" from other people, but I'll try my best not to!

At this time this guide does not get into any heavy definitions nor does it have any screencaps. There are a number of great sites for those, and frankly the topic gets so complicated that reading too much of it can might just make you more confused! However I would like to provide two links (previously mentioned in this thread) which have provided me with a lot of insight. If you are at all confused about what I write in this guide, I strongly suggest you check out these links for your further edification:

1) Incredible's post Interlaced / Progressive ... and what it means
2) Doom9's tutorial Force Film, IVTC, and Deinterlacing

So now, onto the guide!

Step 1: Loading your source
This portion assumes your source is DVD. If you are using DV or VHS capture, I believe the steps are the same (but I can't be certain!)

1. Load your source into DVD2AVI and press [F5] to Preview source

2. Take a look at what is displayed in the Information window on the right. If it says NTSC under Video Type and Interlaced under Frame Type, then this is the guide for you! Otherwise you should probably go somewhere else

3. Under Video -> Field Operation, make sure Force Film is not selected but instead select None.

4. Press [F4] to save your project as a .d2v file

Step 2: Checking your source
1. Create a simple .avs file loading your .d2v file. The result should look like this:
Code:
MpegSource("clip.d2v")
2. Load your .avs file into VirtualDub and move the trackbar at the bottom of the screen to a point in the film where there is movement. Advance frame-by-frame by using the right arrow key on your keyboard. What you are looking for are occurances of "interlaced" frames, which have a characteristic "combing" effect. For more accurate descriptions and pictures, please go to the links provided above! Depending on what you see, you should hopefully fall into one of the following categories:

1) Telecined NTSC FILM material
This type of film source was originally shot at 23.976fps, but has been "telecined" to 29.970fps. In simple terms, that means a certain number of frames have been repeated in order to stretch (or telecine) the material to fill a longer framerate. If you have this type of source, you will notice when advancing frame-by-frame a pattern of 3 progressive frames (non-interlaced) followed by 2 interlaced frames. If this is the case, you will want to reverse the telecine process to restore the original 23.976fps film material by doing what is called an Inverse Telecine, or IVTC.

To do this, we will start off with the following avs file. Please remember to place a copy of decomb.dll in your Avisynth / Plugins subfolder (if you are using Avs 2.5x) or load the decomb_legacy.dll file in your script if you are using Avs 2.0x. Both filters may be downloaded here.
Code:
Telecide(Guide=1,Post=false)
Decimate(Cycle=5)
The Post=fale argument turns off post-processing deinterlacer, which will speed up encoding but is only recommended on very "clean" telecined sources. To check this, load your new script into VirtualDub and move to a high action scene, again checking frame-by-frame for any interlaced frames. Here's what you might see:
  • If all is good, you will see no more interlaced frames and you are good to go!
  • If you see a few stray interlaced frames, then you have two options. First, you can leave things as is since a couple sparse interlaced frames will hardly be noticeable in the final encode. If however you are not satisfied with that, then change the argument to Post=true and you should see no more interlaced frames with the tradeoff of a slightly longer encoding time
2) Pure NTSC VIDEO interlaced material
This type of material is shot at 29.970fps and is 100% interlaced, which means that in our avs script of MpegSource("clip.d2v") we would see in VirtualDub that every single frame is interlaced. One of the best ways to deal with this source is a special form of deinterlacing called convert60ito24p. What this does is it converts the interlaced 29.970fps source to progressive 23.976fps, similar to an inverse telecine. However, note that we are not dealing with a telecined 29.970fps source, so what we are doing is not considered IVTC but is actually a form of deinterlacing.

The following script for convert60ito24p was created by scharfis_brain, whose site is here:
Code:
Mpeg2Source("interlaced_source.d2v")

converttoyuy2() # this line may not be needed, so you can try commenting it out.  
                # However if you receive the avisynth error "Layer only support 
                # RGB32 and YUY2 formats" then put it back in!

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

convert60ito24p(2,0)

# converttoyv12() # Normally I keep this commented out, but if you are having 
                  # problems when encoding in CCE then put it back in

# insert any resizers, filters, and addborders as needed

#
############### 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)
}
#################################
The above script uses the filter Bob which is built into Avisynth. I found it does an excellent and quick job here, but as suggested by Incredible you might want to try SmoothDeinterlace for higher quality. That filter may be downloaded here.

3) Progressive NTSC FILM material
With this type of material, you will notice no interlaced frames when using the simple script MpegSource("clip.d2v"). If this is the case, then you are in luck! What you have is actually a progressive NTSC FILM material shot at 23.976fps, but DVD2AVI has incorrectly recognized it as interlaced. Personally I've never come across this situation but all you have to do is load your VOB back up in DVD2AVI and create a new .d2v project file, but this time enable Force Film. Ta da, this will give you back your original progressive 23.976fps material!

Step 3: Encoding
Before encoding your video, make a final check of either your IVTC or deinterlacing script in Virtualdub and cofirm that your script is free of any avisynth errors and that there are no longer any more interlaced frames. If there are, then either I have made a mistake in this guide, or you have made a mistake in this guide, OR you have a more complicated source that is currently beyond the scope of this guide!

In any event, once you are ready to encode you are safe to add any resizing or motion adaptive filters you want, as long as they are after the IVTC or deinterlacing lines. I have found Kwag's MA script does an excellent job, but of course there are a multitude of others.
Reply With Quote
  #24  
04-12-2004, 02:09 PM
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
As said in my Guide...

to see if DVD2AVI deals with an interlaced source, you don't need to do a "dummy" avs to see if there's combing. Just use the slider below in DVD2AVI to scroll to a motion scene .....
Reply With Quote
  #25  
04-12-2004, 02:30 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
Quote:
Originally Posted by incredible
As said in my Guide...

to see if DVD2AVI deals with an interlaced source, you don't need to do a "dummy" avs to see if there's combing. Just use the slider below in DVD2AVI to scroll to a motion scene .....
The problem with that is DVD2AVI does not advance frame-by-frame, so it may not be possible to distinguish between a 100% interlaced film or telecined film.
Reply With Quote
  #26  
04-12-2004, 02:43 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 J-Wo
The problem with that is DVD2AVI does not advance frame-by-frame, so it may not be possible to distinguish between a 100% interlaced film or telecined film.
Then load your VOB into Virtualdub

-kwag
Reply With Quote
  #27  
04-12-2004, 03:56 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
Quote:
Originally Posted by kwag
Then load your VOB into Virtualdub
Hey I never realized that was possible! However the only problem with that is a) not all versions of Virtualdub can load VOB files. It appears that only the latest versions of VirtualdubMod and VirtualDubMPEG-2 can; and b) it takes a bit for vdub to import the vob file in, whereas with an avs file it's instantaneous.

Besides, since you're likely going to be using an avs file anyway which starts with an Mpeg2Source() line, why not just use that?
Reply With Quote
  #28  
04-12-2004, 04:05 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
for a and b :
load the .avs using trim(xxxx,xxxx) and it load faster!

Reply With Quote
  #29  
04-13-2004, 07:09 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
J-Wo my son, where are you ?

did i " tilt " the thread?
Reply With Quote
  #30  
04-15-2004, 03:34 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
J-Wo...
we all are waiting for you my friend.
the team don't know that we change some pms
and you're ending details in the guide !
well, ...now they know!
(i posted only to update the thread! )



i posted 3 times...later i delete some!
Reply With Quote
  #31  
04-15-2004, 04:01 PM
Zyphon Zyphon is offline
Free Member
 
Join Date: Oct 2003
Location: London, England (UK)
Posts: 1,035
Thanks: 0
Thanked 0 Times in 0 Posts
This thread has been a really interesting read I also read Inc's Interlaced /Progressive what does it mean (A really interesting read btw )

Im totally clueless when it comes to Interlaced or Progressive. Seeing as I live in the U.K and we use PAL @25fps for our DVD's I can only assume that most of our DVD's are Interlaced.

I liked your guide J-WO a really interesting read also.
__________________
Regards.

Michael.
Reply With Quote
  #32  
04-15-2004, 04:54 PM
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
Jorel whats your question que queda?

I thought everything above also was (maybe in another way explained - but the same content or to do's in the interlaced an what it means sticky).

There won't be an veery fast understanding guide which clearyfies all interlaced questions.
What you gonna do if you got a "raped" stream where a pal interlaced 25.000 was just "fieldblended" converted to NTSC 29.97?? That also would be recognised as a full interlaced 29.97 but a simple deinterlacer would still end up in blendings .. so that would be a case to use rePAL() or better unblendpattern()
.. just an example

So IF theres something not understandable in the Interlacing sticky, let me know! Ill fix/clearify that and If J-Wo got some addings, I will apriciate! to add them to that interlacing sticky (incl. credits for shure )

Quote:
Originally Posted by J-Wo
One of the best ways to deal with this source is a special form of deinterlacing called convert60ito24p. What this does is it converts the interlaced 29.970fps source to progressive 23.976fps, similar to an inverse telecine.
Watch out! IVTC and 60ito24p do got totally diff. approaches!
When doing an IVTC a frame decimating will be done and a dynamical phase shift will be inversed so the frames will be restored, (the dynamical phase shift on telecined material gives you a smooth movement on TV as the offset of the fields is moved by one field but not static but rather danamically) 60ito24p doesnt perform inverse phase shifts but mixes fields (in mode2, thats why it ends up in a smooth 23.976 movement like motion blur applied).

The advantage of adding a smart bob deinterlacer instead of Bob() is cause bob is stupid and treats EVERY frame as the same in its deinterlacing, even theres no movement. Smart bobbers do got motion detections where only interlaced frames will be treated. That is also done when using fielddeinterlace(full=false) BUT as fielddeinterlace results in a 29.97 NTSC or 25 PAL deinterlaced stream therefore it cant be used to prepare the source for 60ito24p. Thats why we need for 60ito24p a FULL fieldrate deinterlacer where at NTSC 60 and at PAL 50 fps at full size will result which will be treated correctly by the following 60ito24p function .
Reply With Quote
  #33  
04-15-2004, 05:40 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
ok ink!
part of my doubts you posted here too.

you did a great guide for smart guys.
i need that you do an

"guide for real stups like jorel"...

i read it all tons but still confused.
Boulder,Kwag,vmesquita, Phil,,GFR,you and more friends always help me
but
i need to see pictures like children to do comparisons!


and ivtc, progressive, ffilm,etc... still for me!

when (and if) i understand it all,
all newbys will learn faster reading this guide !

believe, i don't feel shame to ask for what i don't know!
all that i learn is asking, listening and reading !
don't know a better way and don't have "an ugly proud"!
i'm only an asker ,you and lots friends here are teachers!
for this reason i "bore" you all every day!
... i really don't know it all.
only little parts!

Reply With Quote
  #34  
04-15-2004, 06:33 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 know what you mean Jorel! Incredible, I just read your last post at the last two paragraphs just went waaaaay over my head. I think it's just too technical for me to ever understand. That's why I think we need an easy to follow guide that explains a) what to look for b) determine what type of video you have; and c) what you should do with it. IMHO, all the technical information that explains what video type A is vs. video type B confuses the matter so much more. So does an explanation on how certain filters work! I think many would be happy with a guide which simply shows what things work. Just like the MA script. I don't know what 75% of those filters is doing but because Kwag said it works and there hasn't been much dispute, I use it! Whenever there is discussion and optimization, Kwag updates it. Maybe that's how we should be treating interlaced material. Thoughts?
Reply With Quote
  #35  
04-16-2004, 01:18 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
YEP!

We the interlacing Guide should be updated to a more simple understanding one .... I hope I get the time to fix that this week.
Reply With Quote
  #36  
04-16-2004, 07:50 AM
GFR GFR is offline
Free Member
 
Join Date: May 2002
Posts: 438
Thanks: 0
Thanked 0 Times in 0 Posts
Nice thread...

I'd like to see comments on how you deal with these kind of sources, which I find the most problematic:

1) home videos shoot on a NTSC VHS camcorder.
2) NTSC TV shows or porn tapes/dvds shoot in betacam, super beta or even SVHS.

I always try to keep them interlaced (since may player only accepts mpeg2 anyway), would the 60->24 function work OK for these sources?
Reply With Quote
  #37  
04-16-2004, 08:24 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 GFR
Nice thread...

I'd like to see comments on how you deal with these kind of sources, which I find the most problematic:

1) home videos shoot on a NTSC VHS camcorder.
2) NTSC TV shows or porn tapes/dvds shoot in betacam, super beta or even SVHS.

I always try to keep them interlaced (since may player only accepts mpeg2 anyway), would the 60->24 function work OK for these sources?
All these mentioned sources to me seem to be recorded "fieldbased"! Means Real interlaced where every field (not frame) at half height gots its unique movement.

So you should try the recommendation of
Smoothdeinterlacer(doublerate=true) # or any other full fieldrate deinterlacer, also dgbob(order=x) does that well ... just try spped/quality
convert60ito24p(2,0)

I think if your source comes from a standalone VHS or Camcorder you do digitize that one using for example a HuffYUV or a mjpeg codec. Both do deliver a good quality and they come in YUY2 which got better Chroma subsampling and also there won't be a colorconversation needed BEFORE the function call as convert60ito24p needs YUY2 as input.



Even if you choose mpeg2 as encoding format, you can gain MUCH compressibility by converting that one using convert60ito24p. As interlaced encodings do need much more bitrate if the output of quality should be the same as a progressive encoding (according to blocks etc.)

BUT keep in mind .. on the one hand you will get less blocks cause of more compression, but the "smooth" movement of your NTSC VIDEO material will be changed to that typically Film Look playback! And once convert60ito24p is proceeded on the encoding you cant restore it in the future.
Reply With Quote
  #38  
04-16-2004, 12:09 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
ink wrote:
"BUT keep in mind...."

oh, i'm trying my firend ink
but my brain now is like "star wars",

the good and the bad are fighting and i only see stars .
Reply With Quote
  #39  
04-16-2004, 12:38 PM
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
The very big bullshit is that one day the holy lord brought us NTSC 29.97! And thats what does give us all the confusing.
Reply With Quote
  #40  
04-16-2004, 08:27 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
ink, J-Wo, all...
now another reference (too confuse for me):

http://www.hometheaterhifi.com/volum...e-10-2000.html
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 07:47 AM  —  vBulletin © Jelsoft Enterprises Ltd