Created
January 18, 2020 15:28
-
-
Save fredmajor/c4abc6cfdb7fbed4a9eccfbc4a9e42c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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