Skip to content

Instantly share code, notes, and snippets.

@tluyben
Created January 3, 2015 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tluyben/4d0973617d388f6b0873 to your computer and use it in GitHub Desktop.
Save tluyben/4d0973617d388f6b0873 to your computer and use it in GitHub Desktop.
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