Skip to content

Instantly share code, notes, and snippets.

@fredmajor
Created January 18, 2020 15:28
Show Gist options
  • Save fredmajor/c4abc6cfdb7fbed4a9eccfbc4a9e42c1 to your computer and use it in GitHub Desktop.
Save fredmajor/c4abc6cfdb7fbed4a9eccfbc4a9e42c1 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use 5.014;
use strict;
use warnings;
use utf8;
use File::Find;
use Cwd;
my $location=getcwd;
my $count = 0;
foreach my $file (@ARGV){
if (-f $file){
my $fout = $file =~ s/\..*$/.mp3/r;
say "attepmting to convert $file->$fout";
my $cmd = qq{ffmpeg -y -i "$file" -vn -q:1 0 "$fout" };
say "command:" . $cmd;
system $cmd;
$count++;
if ( $? == 0 ) {
say "convertion successful"
}
else {
say "convertion failed"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment