+
+ # This is the best way to detect if content is interlaced or progressive:
+ # http://www.aktau.be/2013/09/22/detecting-interlaced-video-with-ffmpeg/
+ my $progressive = 0;
+ my $detect_cmd = "$ffmpeg -filter:v idet -frames:v 100 -an -f rawvideo -y /dev/null -i \"$video\" 2>&1 | grep Parsed_idet";
+ if($opt_v) { print " $detect_cmd\n"; }
+ my $detect_output = `$detect_cmd`;
+ if($detect_output !~ /Progressive:0/) { $progressive = 1; }