Skip to content

Instantly share code, notes, and snippets.

@nguyentienlong
Forked from goliver79/autoConvert.sh
Created September 30, 2017 04:07
Show Gist options
  • Save nguyentienlong/e2c725c0e089b14a6309b8e774842698 to your computer and use it in GitHub Desktop.
Save nguyentienlong/e2c725c0e089b14a6309b8e774842698 to your computer and use it in GitHub Desktop.
[LINUX] Convert MP4 to MP3
#!/bin/bash
for f in *.mp4
do
echo "Converting $f"
name=`echo "$f" | sed -e "s/.mp4$//g"`
ffmpeg -i "$f" -vn -acodec libmp3lame -ac 2 -ab 160k -ar 48000 "$name.mp3"
done
sudo apt-get install libavcodec-extra-53
ffmpeg -i video.mp4 -vn -acodec libmp3lame -ac 2 -ab 160k -ar 48000 audio.mp3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment