You are not logged in.
Pages: 1
Hello All,
I am currently in the process of writing a perl script to automate the conversion of avi files into mp4 format so that they can be played on my iPod classic 80GB. I was hoping to create some form of "progress bar" for the entire process. At the moment I am using ffmpeg to convert the files however I cannot see how to obtain a value for the time it is going to take to complete the conversion of each file. I have attached the code at the bottom of this post for anyone that is interested so far. Please forgive any problems with the perl code but I have only just started learning it (plus I'm a systems administrator not a code monkey).
If anyone has any ideas or has seen something that I can't see in the ffmpeg documentation then I would really like to hear it.
Cheers,
#!/usr/bin/env perl
use Cwd;
use strict;
use warnings;
use File::Basename;
while (@ARGV) {
print "*** Converting $ARGV[0] ***\n";
my $file = $ARGV[0];
my $newfile = getcwd.'/'.basename($file);
$newfile =~ s/\.avi$/.mp4/; # Convert File Extension To .mp4
my $output = `ffmpeg -i "$ARGV[0]" -vcodec libx264 -b 700k -acodec libfaac -ab 192k -s 320x240 -aspect 4:3 "$newfile" >& /dev/null`;
print "*** Conversion Complete ***\n";
shift @ARGV;
}
Offline
Pages: 1