Created
December 1, 2015 08:38
-
-
Save kennyng/24d4cfa59a408a983e62 to your computer and use it in GitHub Desktop.
ffmpeg Audio Conversion Notes
This file contains 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
for f in *.flac ; do | |
# Regex for whitespaces in filenames. | |
# Specify input and output filetypes. | |
out="${f[@]/%flac/mp3}" | |
# Use -qscale or -vbr for VBR [0-9]. | |
# 0: slowest & best possible algo | |
# 1: slow and not as high quality | |
# 2: recommended (same as -h) | |
# 5: default; good speed, reasonable quality | |
# 7: very fast, ok quality (same as -f) | |
# 9: disables most algos; poor quality | |
ffmpeg -i "$f" -qscale:a 0 "$out" | |
# Can specify codec: -codec:a libmp3lame | |
# Metadata tags auto transferred by ffmpeg, but specified for example. | |
# For CBR [320k] and keep metadata tags (mp3 only): | |
# ffmpeg -i "$f" -ab 320k -map_metadata 0 -idv2_version 3 "$out" | |
# To convert to ALAC (.m4a): | |
# ffmpeg -i "$f" -c:a alac "${f%.*}.m4a" | |
# (ffmpeg -i "$f" -c:a alac "$out") | |
# To convert to AAC (VBR or CBR): | |
# ffmpeg -i "$f" -c:a libfdk_aac -vbr 0 "$out" | |
# ffmpeg -i "$f" -c:a libfdk_aac -b:a 320k | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment