Converts movie_name.flv to movie_name.mp4 with AAC audio, H.264 video. Extracts a thumbnail jpg, too
#!/usr/bin/perl
$ENV{LD_LIBRARY_PATH} ='/usr/local/lib/';
$movie_name=shift @ARGV;
$old_movie_name = $movie_name.".flv";
$new_movie_name = $movie_name.".mp4";
$toe_name = $movie_name.".jpg";
my $range = 100000;
my $random_number = int(rand($range));
$temp_movie_name="/tmp/$random_number.mp4";
$make_mpeg=`/usr/local/bin/ffmpeg -y -i $old_movie_name -acodec libfaac -ab 96k -ar 44100 -vcodec libx264 -vpre hq -crf 22 -flags2 -bpyramid $resize $temp_movie_name`;
$test=`/usr/local/bin/ffmpeg -y -i $temp_movie_name -f image2 -ss 15 -vframes 1 -s "360x270" $toe_name 2>&1`;
$last=`/usr/local/bin/qt-faststart $temp_movie_name $new_movie_name`;