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?

  • 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.
    – Anthon
    Apr 22, 2014 at 17:32

3 Answers 3


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.


Ubuntu Forum

  • 1
    See here for how to retain ID3 tags.
    – Raphael
    Feb 1, 2017 at 22:13

Try this bash script:

for file in *.${EXT}; do
   if [ ! -e ${file%.flac}.ogg ]; then          
        ffmpeg -i ${file} -qscale:a 6 ${file%.flac}.ogg
  • This does transcodes all files, not just the new ones added (which is what the OP asked)
    – Anthon
    Sep 19, 2017 at 16:14
  • @Anthon Right, but neither does Ramesh's answer. If you downvote this one, you should downvote both.
    – xhienne
    Sep 19, 2017 at 16:37
  • @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.
    – Anthon
    Sep 19, 2017 at 17:00
  • Sorry Anthon, it was downvoted at the time I wrote this and I believed it was your vote. The downvote has gone since
    – xhienne
    Sep 19, 2017 at 21:26
  • 1
    You'll need to enclose all variables in quotes to correctly handle files with spaces in their names.
    – grifferz
    Apr 13, 2018 at 20:49

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.


Simple perl script, with configurations, options, etc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .