Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bulk extract mp3 from mkv
#!/usr/bin/perl
@x = `find .|grep mkv\$|grep "Season "|more`;
print `mkdir encdir`;
foreach(@x) {
chomp;
$f = $_;
/.*\/(.*).mkv/;
print "$1\n";
$wav = "encdir/$1.wav";
$mp3 = "encdir/$1.mp3";
next if -f $mp3;
$mplayer = "mplayer -vc dummy -vo null -ao pcm:file=\"$wav\",fast \"$f\"";
print `$mplayer`;
$lame = "lame -h -b128 \"$wav\" \"$mp3\"";
print `$lame`;
print `rm "$wav"`;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment