8 print "-> Encoding $_.MTS to $_.mpg\n";
10 # Find out if content is interlaced or not
11 $deint_option = "-deinterlace";
12 $interlaced = system('ffmpeg -i "$_.MTS" 2>&1 | grep -q "frame rate differs"');
13 if($interlaced != 0) {
14 print " Detected interlaced video content\n";
16 print " Detected progressive video content\n";
20 # 2 pass encode the video to DVD compatible mpg
21 `ffmpeg -i $_ $deint_option -target ntsc-dvd -pass 1 $_.mpg`;
23 `ffmpeg -i $_ $deint_option -target ntsc-dvd -pass 2 $_.mpg`;