Skip to content

Instantly share code, notes, and snippets.

@namndev
Forked from buttreygoodness/FLACConvert.md
Last active December 6, 2025 16:51
Show Gist options
  • Select an option

  • Save namndev/17ec34e7eb1e2b35bd215f4de7c95cbf to your computer and use it in GitHub Desktop.

Select an option

Save namndev/17ec34e7eb1e2b35bd215f4de7c95cbf to your computer and use it in GitHub Desktop.
How to split FLAC files by cue and convert to ALAC on Mac OS X

FLAC

  • Install required packages
brew install cuetools flac ffmpeg shntool
  • Split flac file by cue
$ shnsplit -o flac -f file.cue file.flac
$ cuetag file.cue split-track*.flac
  • Convert flac files to alac
$ for i in *.flac; do ffmpeg -i "$i" -acodec alac "`basename "$i" .flac`.m4a"; done;

from https://coderwall.com/p/6ydyoq/how-to-split-flac-files-by-cue-and-convert-to-alac-on-mac-os-x

Download Youtube

  • Using yt-dlp
pip install yt-dlp
  • Using command
yt-dlp -x --audio-format mp3 --audio-quality 0 --embed-thumbnail --add-metadata -o "%(title)s.%(ext)s" "https://music.youtube.com/watch?v=s4e32Ny6csc"
  • Convert AAC
ffmpeg -i input.mp3 -vn -c:a libfdk_aac -b:a 192k -ar 44100 output.m4a

Or

ffmpeg -i input.mp3 -metadata title="New Video Title" -c:a libfdk_aac -vbr 4 -ar 48000 output.m4a

VBR 4 ≈ ~256 kbps

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