Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 27th September 2002, 14:06   #1  |  Link
trbarry
Registered User
 
trbarry's Avatar
 
Join Date: Oct 2001
Location: Gainesville FL USA
Posts: 2,092
Useful function for checking TopFirst

When is a clip "TopFirst"?

Interlaced video clips have 2 different fields in each frame and you are never quite sure which one was intended to be displayed first and which second when displaying interlaced or when deinterlacing. But some of my filters (GreedyHMA, TomsMoComp) make you specify that when invoking them.

So I just wrote a quickie Avisynth function that makes it easy to know if the clip is stored "TopFirst". The following function will do it fairly reliably:

later edit: see updated version on page 2 of this thread.

Code:
function CheckTopFirst(clip v1){
t0=v1.ComplementParity
t1=t0.separatefields
t2=compare(t1.trim(1,0),t1)
b1=v1.separatefields
b2=compare(b1.trim(1,0),b1)
return stackvertical(t2,b2)}
Run the function with something like:

v=AVISource("C:\whatever\bikes.avi")
CheckTopFirst(v)

Then preview a few frames. It will use Compare to evaluate the two possibilities and vertically stack the results. This shows 2 useful pieces of info. First the preview of either the top or bottom half of the screen will probably be jerky, so choose the other one.

But just as reliable is the "Avg Mean Abs Dev" value that is displayed for each. Choose either the top (TopFirst=1) or bottom (TopFirst=0) clip that has the LOWEST value for Avg Mean Abs Dev.

Picture attached. In this example the Avg Mean Abs Dev is 6.143 for the top and 7.549 for the bottom, so the clip is TopFirst.

- Tom

Last edited by trbarry; 12th December 2002 at 14:48.
trbarry is offline   Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:15.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.