Audio mass encode on Synology NAS (FLAC to MP3)

Published: 2012-05-20
Quick Sunday hack while waiting for the damn rain to stop :-(

 I was looking for an easy solution to mass-convert my music library from FLAC to MP3 (because iP*ds don't play FLAC...). Don't worry, I'm still keeping the FLACs for home playing :)

My library is stored on a Synology NAS and the prospect of transferring all of it back and forth through my LAN didn't sound really attractive, so I figured maybe I could find a way to reencode everything on the NAS itself, using whatever tools are available on a vanilla box (i.e. no additional package).

And voila!

This script is pretty self-explanatory: just ssh to your box and launch the script at the root of the music library. It will go sequentially through every subdirectory and each FLAC file will be encoded to a 320kbit MP3 file, saved in the same directory under $newbasedir. Existing ID3 tags are preserved by ffmpeg.

Of course, this will not only run on Synology, but also on any Unix box with ffmpeg... although in this case, I'm sure there are much better solutions :)

Good to see that I can still write a few lines of script. Hope you like it!

 

About the Author

Julien Simon is the Chief Evangelist at Arcee AI , specializing in Small Language Models and enterprise AI solutions. Recognized as the #1 AI Evangelist globally by AI Magazine in 2021, he brings over 30 years of technology leadership experience to his role.

With 650+ speaking engagements worldwide and 350+ technical blog posts, Julien is a leading voice in practical AI implementation, cost-effective AI solutions, and the democratization of artificial intelligence. His expertise spans open-source AI, Small Language Models, enterprise AI strategy, and edge computing optimization.

Previously serving as Principal Evangelist at Amazon Web Services and Chief Evangelist at Hugging Face, Julien has helped thousands of organizations implement AI solutions that deliver real business value. He is the author of "Learn Amazon SageMaker," the first book ever published on AWS's flagship machine learning service.

Julien's mission is to make AI accessible, understandable, and controllable for enterprises through transparent, open-weights models that organizations can deploy, customize, and trust.