Skip to content

Instantly share code, notes, and snippets.

@doole
Created February 8, 2024 13:47
Show Gist options
  • Select an option

  • Save doole/f9c2899b0d2f5d3e039c27d9cf84e447 to your computer and use it in GitHub Desktop.

Select an option

Save doole/f9c2899b0d2f5d3e039c27d9cf84e447 to your computer and use it in GitHub Desktop.

Revisions

  1. doole created this gist Feb 8, 2024.
    32 changes: 32 additions & 0 deletions flac_transcoding.org
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    #+title: FLAC Transcode

    * Convert
    ** MP3 - VBR V0
    [[https://trac.ffmpeg.org/wiki/Encode/MP3][- encode/mp3]]
    #+begin_src bash
    find . -name '*.flac' -print0 | xargs -0 -I FILE sh -c 'ffmpeg -i "$1" -c:a libmp3lame -q:a 0 "${1%.flac}.mp3" ' -- FILE
    #+end_src
    ** M4A - CBR 320kbps
    - [[https://trac.ffmpeg.org/wiki/Encode/AAC][encode/aac]]
    #+begin_src bash
    find . -name '*.flac' -print0 | xargs -0 -I FILE sh -c 'ffmpeg -i "$1" -c:a libfdk_aac -b:a 320k "${1%.flac}.m4a" ' -- FILE
    #+end_src
    * Split from single FLAC + CUE
    #+begin_src bash
    shnsplit -f file.cue -t '%n - %t' -o flac file.flac
    #+end_src
    * Tools
    - fedora
    #+begin_src bash
    sudo dnf install cuetools shntool
    #+end_src

    - debian
    #+begin_src bash
    sudo apt install cuetools shntool
    #+end_src

    - macos (homebrew)
    #+begin_src bash
    brew install cuetools shntool
    #+end_src