Created
June 26, 2017 10:03
-
-
Save ignar/eb1630f133e8868a827a219276f269b2 to your computer and use it in GitHub Desktop.
Transcode VMA into mp3
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
#!/bin/sh | |
vcodec="mp4v" | |
acodec="mp4a" | |
bitrate="1024" | |
arate="128" | |
mux="mp3" | |
# For Linux | |
#vlc="/usr/bin/vlc" | |
# For OSX | |
vlc="/Applications/VLC.app/Contents/MacOS/VLC" | |
if [ ! -e "$vlc" ]; then | |
echo "Command '$vlc' does not exist" | |
exit 1 | |
fi | |
for file in "$@"; do | |
echo "=> Transcoding '$file'... " | |
dst=`dirname "$file"` | |
new=`basename "$file" | sed 's@\.[a-z][a-z][a-z]$@@'`.$mux | |
$vlc -I dummy -q "$file" \ | |
--sout "#transcode{acodec=mp3,ab=128,channels=2,samplerate=44100}:standard{mux=mp3,dst=\"$dst/$new\",access=file}" \ | |
vlc://quit | |
ls -lh "$file" "$dst/$new" | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment