Log in

View Full Version : Indicating Interlaced Video to Avisynth?


peridian
23rd December 2012, 18:57
Hi,

Is there anyway that an Avisynth script can pickup from the use of a d2v file whether the input is interlaced or progressive?

Obviously I can look myself manually, but I am trying to automate my process. I'd like to be able to toggle use of deinterlacing in the script somehow, like:

video = mpeg2Source(d2vfile, cpu=0, info=3)
isInterlaced = video.type == 1

Does such a mechanism exist? Would I have to determine this outside of Avisynth and have some script tool modify the Avisynth script based on its findings?

Regards,
Rob.

TheSkiller
24th December 2012, 12:12
AviSynth doesn't have a parameter to determine whether a video is interlaced or not.

But even if it did, for the usage you'd want to use it, it would be almost useless because mpeg2Source relies purely on the flags of the MPEG2 video. And those flags maybe set to interlaced even for progressive content. This is quite often the case with commercial DVDs.

So, this means there's no way around an actual "check" to determine it. Maybe I'm mistaken but I think there's actually a script somewhere that checks a video for interlacing. The only other way are your eyes.

peridian
27th December 2012, 15:19
AviSynth doesn't have a parameter to determine whether a video is interlaced or not.

But even if it did, for the usage you'd want to use it, it would be almost useless because mpeg2Source relies purely on the flags of the MPEG2 video. And those flags maybe set to interlaced even for progressive content. This is quite often the case with commercial DVDs.

So, this means there's no way around an actual "check" to determine it. Maybe I'm mistaken but I think there's actually a script somewhere that checks a video for interlacing. The only other way are your eyes.

Doh! Oh well, that's annoying. I have found this page on the avisynth wiki:

http://avisynth.org/mediawiki/Interlace_detection

Can't fully understand it yet, and it doesn't look ready to use out of the box, but I'll see if I can get this to work.

Cheers,
Rob.

Blue_MiSfit
5th January 2013, 11:44
This is definitely non-trivial. Some of the more cutting edge professional transcoding systems integrate frame-by-frame analysis to properly handle interlacing in an automated fashion. Sadly, these usually require dedicated (slow) analysis passes prior to the actual transcoding process. The software in question is also extremely expensive! Telestream Vantage is an example, but you'd better be prepared to fork over about $30k :devil:

As it turns out, (well trained) humans are really good at detecting this kind of thing, but it's really hard (tm) to make a computer good at the same thing :) I've yet to see a good auto-magical interlace detection system run automated in AviSynth or similar.

Derek

pandy
7th January 2013, 16:45
Perhaps you can analyze difference between fields with motion analysis tool.

Asmodian
8th January 2013, 03:12
You could but it wouldn't be as good as a (well trained) human.

pandy
8th January 2013, 11:48
You could but it wouldn't be as good as a (well trained) human.

For sure no however maybe good enough...