Created
July 16, 2012 11:18
-
-
Save konrad/3122195 to your computer and use it in GitHub Desktop.
Script to convert videos to mp3 with higher speed
This file contains hidden or 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
SPEED=1.5 | |
for FILE in $@ | |
do | |
WAV_FILE=$(basename $FILE .mp4).wav | |
WAV_FILE_SPED_UP=$(basename $FILE .mp4)_spedup.wav | |
MP3_FILE=$(basename $FILE .mp4)_spedup.mp3 | |
ffmpeg -i $FILE -vn $WAV_FILE | |
sox $WAV_FILE $WAV_FILE_SPED_UP tempo $SPEED | |
lame $WAV_FILE_SPED_UP $MP3_FILE | |
rm $WAV_FILE $WAV_FILE_SPED_UP | |
done |
Ops, just now I noticed "convert video". Then what I said may not really apply totally. I've only used it for converting mp3 to smaller and faster mp3. Never noticed it was more than that.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
These days you can do all at once with just "sox", although I don't know all the syntax/the exact command.
The only downside is that with lame you can have more control over the final mp3 encoding. Sox defaults to a minimum of ~30 kbps on vbr or something like vbr. Which isn't extremely high, but still.
At very least one can ditch totally the ffmpeg/avconv part and do the speed-up wav in a single step.
Just switch the "$WAV_FILE" for "$FILE" on the sox line, comment/erase the ffmpeg one, and that will do it.
Thanks for the script though, I've shrunk substantially my podcast collection, with the added benefit of speeding up. Now everyone sounds kind of drunk when I hear them on normal speed, though.