Convert FLAC files to OGG Vorbis

12,546

Solution 1

You can use a graphical converter like soundconverter. However, since you need to add it to the ogg collection, I believe you might be looking for some command line solutions. You can probably try,

ffmpeg -i musicfile.flac musicfile.ogg

Or even,

find . -name "*flac" -exec oggenc -q 7 {} \;

Once, you have identified an efficient way for file conversion, doing a rsync based on difference of files would be the next step to go.

Sources

Ubuntu Forum

Solution 2

Try this bash script:

EXT=flac
for file in *.${EXT}; do
   if [ ! -e ${file%.flac}.ogg ]; then          
        ffmpeg -i ${file} -qscale:a 6 ${file%.flac}.ogg
   fi
done

Solution 3

I use acxi, which does basically exactly what the op wants. Syncs flac directories to ogg (or mp3 or opus) directories, including copying over whatever other files I want, like jpg, txt, png, etc.

https://github.com/smxi/acxi

Simple perl script, with configurations, options, etc.

Share:
12,546

Related videos on Youtube

landroni
Author by

landroni

Updated on September 18, 2022

Comments

  • landroni
    landroni almost 2 years

    Are there any Linux tools for transcoding and syncing music directories?

    I encode my music to FLAC, which I keep on an external hard drive. Some time ago I transcoded this collection to OGG Vorbis, in a different directory. Since then I have added to the FLAC collection. I am looking for a tool that scans my main (FLAC) collection and transcodes any new additions into the smaller (Vorbis) collection.

    What I have in mind is something that worked like Unison or Rsync (but was able to ignore the fact that the files are in different formats) but also transcoded during the copy process.

    Are there any tools that do something like this?

    • Admin
      Admin about 10 years
      I use a python program to walk over the tree of MP3 file to move any FLAC files out (since Picard puts FLAC and MP3) togehter, then walk the FLAC tree and convert them if the target MP3 does not exists (FLAC to temporary WAV to LAME), while preserving the ID3 tags that are in the FLAC file. The script is relatively simple, but I couldn't find anything that did all of that automatically from the commandline.
  • Raphael
    Raphael over 7 years
    See here for how to retain ID3 tags.
  • Anthon
    Anthon almost 7 years
    This does transcodes all files, not just the new ones added (which is what the OP asked)
  • Anthon
    Anthon almost 7 years
    @xhienne I don't understand your reference to downvoting, what are you referring to? This post is not downvoted. I just reviewed this answer from the review queue and commented, and that is not the same as downvoting.
  • xhienne
    xhienne almost 7 years
    Sorry Anthon, it was downvoted at the time I wrote this and I believed it was your vote. The downvote has gone since
  • brettv
    brettv almost 7 years
    I've changed the script to only convert flac files which don't already have an ogg equivalent
  • grifferz
    grifferz about 6 years
    You'll need to enclose all variables in quotes to correctly handle files with spaces in their names.