Skip to content

Instantly share code, notes, and snippets.

@ox
Created May 22, 2020 17:47
Show Gist options
  • Save ox/cefcc04cd7ba35848edc1781696d9600 to your computer and use it in GitHub Desktop.
Save ox/cefcc04cd7ba35848edc1781696d9600 to your computer and use it in GitHub Desktop.
Converts any audio/video source to a 320kbps MP3 file in the same directory using ffmpeg.
#!/bin/bash
if [[ "$#" -ne 1 ]]; then
echo "Usage: to-mp3.sh <input source>"
exit 1
fi
set -ex
ffmpeg -hide_banner -loglevel warning -i "${1}" -b:a 320k "${1%.*}.mp3"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment