# Pre-requisites:
# mkvtoolnix - http://www.bunkus.org/videotools/mkvtoolnix/
# ffmpeg
+# avconv
####################################################################################################
# Includes
if(! defined $opt_t) { &usage(); die "-E- Missing required title: -t <title>\n"; }
if(! defined $opt_o) { &usage(); die "-E- Missing required argument output video names: -o <output.mkv>\n"; }
if(! defined $opt_i) { &usage(); die "-E- Missing required argument input video names: -i <input,input,...>\n"; }
+if(! -x $ffmpeg) { die "-E- Missing required executable for ffmpeg: $ffmpeg\n"; }
+if(! -x $avconv) { die "-E- Missing required executable for avconv: $avconv\n"; }
sub usage {
print "usage: $0 -t <title> -o <output.mkv> -i <input,input,...>\n";
my $video_mkv = $video;
print " Detected interlaced video content: $video\n";
# We don't need to do this anymore since it is not an issue with the new mkvmerge
- if(0 && $video_ext !~ /mkv/i) {
+ if($video_ext !~ /mkv/i) {
$video_mkv =~ s/\.[^.]*$//; $video_mkv .= ".ffmpeg.mkv";
print " Re-muxing the interlaced video content as an mkv file: $video_mkv\n";
- my $make_mkv_cmd = "$ffmpeg -y -i \"$video\" -scodec copy -acodec copy -vcodec copy -f matroska \"$video_mkv\" >> \"$tmpfile\" 2>&1";
+ my $make_mkv_cmd = "$avconv -y -i \"$video\" -scodec copy -acodec copy -vcodec copy -f matroska \"$video_mkv\" >> \"$tmpfile\" 2>&1";
if($opt_v) { print " $make_mkv_cmd\n"; }
if(! defined $opt_s) {
my $errno = system("$make_mkv_cmd");