Skip to content

Instantly share code, notes, and snippets.

@andreipak
Created March 21, 2017 16:40
Show Gist options
  • Save andreipak/8c44c922419cae45a00e7d4437852290 to your computer and use it in GitHub Desktop.
Save andreipak/8c44c922419cae45a00e7d4437852290 to your computer and use it in GitHub Desktop.
convert flac to mp3
#!/bin/bash
# [all variants] Converting a directory of flac to mp3 320 with ffmpeg
# http://ubuntuforums.org/showthread.php?t=1096665
#
# Convert Flac to Mp3 - ArchWiki
# https://wiki.archlinux.org/index.php/Convert_Flac_to_Mp3
#
# Bash script to convert all *flac to *.mp3 with FFmpeg? - Unix & Linux Stack Exchange
# http://unix.stackexchange.com/questions/114908/bash-script-to-convert-all-flac-to-mp3-with-ffmpeg
#
# Converting FLAC files to MP3 with FFmpeg and Bash — Mark P. Lindhout’s Flamepit
# https://blogs.fsfe.org/marklindhout/2012/11/converting-flac-files-to-mp3-with-ffmpeg-and-bash/
#
# Lewis' house of joy and joyness: Converting Flac to Mp3 (or other formats)
# http://lewisdiamond.blogspot.com.eg/2012/01/converting-flac-to-mp3.html
# for a in ./*.flac; do
# ffmpeg -i "$a" -qscale:a 0 "${a[@]/%flac/mp3}"
# done
(for FILE in *.flac ; do ffmpeg -y -i "$FILE" -f mp3 -ab 192000 "`basename "$FILE" .flac`.mp3" || break; done)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment