Skip to content

Instantly share code, notes, and snippets.

@obeninteractive
Created August 19, 2019 13:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save obeninteractive/9b7757150553b07c95b2e6c85b71db32 to your computer and use it in GitHub Desktop.
Save obeninteractive/9b7757150553b07c95b2e6c85b71db32 to your computer and use it in GitHub Desktop.
Convert mp4 into mp3 using command line
ffmpeg -i file.mp4 -vn \
-acodec libmp3lame -ac 2 -ab 160k -ar 48000 \
file.mp3
@obeninteractive
Copy link
Author

ffmpeg -i file.ts -vn
-acodec libmp3lame -ac 2 -ab 160k -ar 48000
file.mp3

@obeninteractive
Copy link
Author

small script for converting mp4 to mp3
put this script inside mp4tomp3.sh

------------- mp4tomp3.sh : start ------------------
#!/bin/bash
for i in *.mp4; do
ffmpeg -i "$i" -vn -acodec libmp3lame -ac 2 -ab 160k -ar 48000 ./audio/"basename "$i" .mp4.mp3"
done
------------- mp4tomp3.sh : end ------------------

then, do :
chmod +x mp4tomp3.sh
sh mp4tomp3.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment