View Full Version : Automatic interlace detection ...
kitsaros2000
3rd January 2004, 01:38
Hello ! And happy new year !!! Till now i beleived that the only way to find out if a dvd was interlaced or now was through the dvd2avi by seeing the artfacts etc ... I used for a while the AUTOGK and i show that uses this script
LoadPlugin("C:\PROGRA~1\AutoGK\filters\mpeg2dec3dg.dll")
LoadPlugin("C:\PROGRA~1\AutoGK\filters\decomb.dll")
LoadPlugin("C:\PROGRA~1\AutoGK\filters\chr.dll")
file="D:\ICaesarbC\gk_tmp\interlace.log"
sep="-"
function IsMoving() {
return (diff < 1.0) ? false : true}
mpeg2source("D:\ICaesarbC\gk_tmp\ICAESAR 3x.d2v")
c = SelectRangeEvery(160,16)
global clip = c
c = FrameEvaluate(c,"write(file,string(IsCombed(threshold=30))+sep+string(IsMoving()),append=true)")
c = FrameEvaluate(c,"global diff = 0.50*YDifferenceFromPrevious(clip) + 0.25*UDifferenceFromPrevious(clip) + 0.25*VDifferenceFromPrevious(clip)")
crop(c,0,0,4,4)
I would like to know if this script is working always or not and under which considerations ... Has anything to do with the fact that AUTOGK uses DVD2AVIdg and not the old dvd2avi (1.76) ? It is trastworthy ? Is there any other method to AUTOdedect interlation/IVTC of a film ? Sorry if my question is too basic . Happy new year !!!
len0x
3rd January 2004, 10:33
Script itself doesn't tell you if video is interlaced or not. It just collects statistics for a number of frames for future analysis within AutoGK... But inside AutoGK it works almost like your eyes work (i.e. looking at the artifacts), which is why this method cannot be worse than manual :)
P.S. this question is rather advanced and I know of no other tools perfoming AutoIVTC/interlace detection as robust as AutoGK.
kitsaros2000
3rd January 2004, 13:53
First off all thx leno0x for your application !
Yes i saw that the script outputs the interlace.log in order to analyse statistically the data . I have a little knowlege in delphi and i would like to explain to me if you dont mind of course the method that you use in order to analyse the interlace.log . I dont want any source code just the idea (algorithm) decause i dont have interlaced experience ... I mostly convert Pal Interlaced movies. If you have time and you want to share it of course .
My mail is : kitsaros@yahoo.com
Have a nice day !
Ps : Its not an urgent fact since im implementing slowly an dvd player and i dont have much time ... Thx
Dark-Cracker
3rd January 2004, 14:28
hi,
i have not made some tests but i suppose it work around somethink like (i think the selectevery is to take only 10% of the movie) :
the selectevery made some packets of 16 frames, skip the first frame of each packet (0,16,..) to avoid bad detection in the motion.
in the interlace.log the second boolean is if there a hight motion.
get 5 frames in an array, (if all the 5 frames are true for the hight motion, else get the 5 next frames).
after i think u simply get percent of combed frames, and use some threshold.
for exemple on NTSC material u analyse 30 array (of 5 frames eachs).
total frame = 30 * 5 = 150
combed frame = 60
percent of combed = 40 %
and normaly if u have around 40% of interlaced frames it's because there approxiamtively 2 frames on the 5 who is interlaced.
or 2/5 => telecine material (read the doom9 guide on ivtc & interlace)
if u have a bigger value => interlaced, because interlaced material is 5 frames on 5 frames combed => around 100%.
for pal i suppose if u have more than 1 percent (decomb can sometimes failed) of combed frames => interlaced material.
and i think with good threshold u can detect hybrid material.
of course it's only my supposition idear on how the autodetection work but i can be wrong and len0x is the more appropriate people to explain u how it work :)
Bye.
kitsaros2000
3rd January 2004, 17:14
Dark-Cracker i think that you are very close to the truth thx.
I will check out this mechanism ... :cool: I will also have to look about the hybrid stuff but i dont have experience .. :p :D
len0x
4th January 2004, 12:09
you almost got it... there are some implementation issues, but the idea is correct. for hybrid sources you need to be able to detect progressive patterns as well (along with telecined and interlaced)
Dark-Cracker
4th January 2004, 13:49
this post have give me the motivation to code a little tool :
http://forum.doom9.org/showthread.php?s=&threadid=68024
only show u basic statistics :)
i suppose for the patterns u just need to :
a) detect 5/5 combed frame => increase the interlaced patterns percent.
b) detect 2/5 combed frame => increase telecine patterns percent.
c) progressive patterns percent = 100 - a - b
i am right ?
it's the first time i use NTSC material, i only have pal dvd in my country (and i am happy :) ).
Bye.
len0x
4th January 2004, 16:59
you can count things very different, i.e. for instance I'd say more than 2 combed frames is definitely interlaced pattern. Progressive patterns can be counted separately if all frames are progressive. One combed frame may not tell us anything...
P.S. I live in PAL land as well, but know way more about NTSC sources now even without having them :)
CCoug83
28th January 2004, 10:03
God how I wish we all lived in PAL land.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.