[FFmpeg-user] Detect interlaced video

Oliver Fromme oliver at fromme.com
Tue May 13 21:36:39 CEST 2014


Nicholas Robbins wrote:
 > > On Monday, May 12, 2014 12:54 PM, Oliver Fromme <oliver at fromme.com> wrote:
 > > 
 > > Is there a way to automatically (i.e. in a script) detect
 > > whether a title from a DVD is interlaced or progressive?
 > 
 > You could try to parse the output of the idet filter, with something like:
 > 
 > $ ffmpeg -i video.vob -vf idet -f null /dev/null  2>&1 | grep Parsed_idet

Thanks, that seems to work nicely.  I didn't know the "idet"
filter exists.  So, thanks for the hint.

Only problem is that it takes so long, but I guess it should
be sufficient to run the filter only on the first five minutes
of a movie (option -t 300).  This takes only 20 seconds on my
machine; that's quick enough for me.

Actually I had hoped that there is a flag somewhere on the
DVD, either in the meta data or in the MPEG2 stream itself,
indicating whether a title is interlaced or progressive.
So it would just be a matter of reading that flag, and no
guesswork required.  A note in the ffmpeg manual page made
me believe that such a flag might exist ...  The description
of the yadif filter mentions an option deint=1 which means
"deinterlace frames marked as interlaced".  But I guess I
just misinterpreted that and there is no such flag.

Best regards
   Oliver

-- 


More information about the ffmpeg-user mailing list