Skip to content

Instantly share code, notes, and snippets.

@goliver79
Last active September 19, 2021 01:25
Show Gist options
  • Save goliver79/8984731 to your computer and use it in GitHub Desktop.
Save goliver79/8984731 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