Skip to main content
Topic: brutha: transcode whole libraries to Ogg Vorbis (Read 12643 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

brutha: transcode whole libraries to Ogg Vorbis

HydrogenAudio is my resource of choice for audio encoding matters.
Here is a tool I wrote that might be of interest to a few of you. In return, I'd be interested by your opinion on it, contributions or feature requests.

The goal was to support huge libraries without doing anything fancy; the directory structure is kept as-is. And unlike many competitors, lossy files are kept as-is instead of being transcoded. Another feature is optional downsampling, i.e. doing 24/96 to 16/44 with the best algorithms available.

Here I made the choice to only support Ogg Vorbis, but I might try to add Opus later.

Available at:
https://pypi.python.org/pypi/brutha
http://git.p.engu.in/laurentb/brutha/

brutha: transcode whole libraries to Ogg Vorbis

Reply #1
Wow.

It had been quite a while for me without looking around on HA, but being in the process of planning my next big library transcode I stopped by to see what are the current discussions about Vorbis encoders. And I stumble upon this? You sir are a legend.

As you rightfully state, the currently available transcoding tools on Unix-like platforms are mostly unfit for the task of optimized[/b] massive library transcodes. With brutha it looks like you did everything right, from accounting for mixed input sources (lossless/lossy) to timestamps preservation, even including the most sought-after parallelization aspect! I had resorted to writing my own script using GNU parallel and ffmpeg to accommodate my needs... But this is much, much better. Thank you.

Once I'll have properly sorted my library, I'll give brutha a go and report back here. If it is successful I'll try to package it for the Arch User Repository, thanks to the crystal-clear README.
I can see "support for more lossless formats as input source" (I still have a few APE and Wavepack albums) and "support for Opus as output format" as potential feature requests, but brutha is already pretty impressive as is. One question comes to my mind: if GNU Make and Parallel are both installed, which one will be used? Should one be preferred over the other?

Merci pour le partage !

PS: the closest thing I had come across is beets, "the media library management system for obsessive-compulsive music geeks", and its convert plugin. It is also written in Python, but its converter seems a bit more complicated in its usage and uses ffmpeg as a backend, which in my experience has issues in preserving metadata tags (even between FLAC and Vorbis). I'd like to know whether you had stumbled upon this project and if yes, what are its drawbacks, according to you? I plan on using it for my library sorting (especially the tags/metadata part), and I'll believe brutha will be its perfect companion

brutha: transcode whole libraries to Ogg Vorbis

Reply #2
Don't forget caudec, which supports many more output codecs.
It's only audiophile if it's inconvenient.

brutha: transcode whole libraries to Ogg Vorbis

Reply #3
Don't forget caudec, which supports many more output codecs.

Come on, two in the same day! It's like Christmas before time  I can't believe those never turned up in the web searches I've done before though. Using keywords such as "linux + audio + transcode + multithread" don't seem to be enough, should have thought of HA forums. Thanks Kohlrabi!

caudec is interesting as well, and has a quite different use case:
[quote author=http://caudec.net/#usage link=msg=0 date=]Intended Usage
caudec is most useful when dealing with one album at a time (with 1, 2 or 3 discs, with each track as a separate file). Handling of multiple albums is done via scripting. caudec cannot efficiently deal with very large files (recordings that are several hours long), or very large numbers of files (messy collections with a single directory and thousands of files). Those are known limitations, and they are not within the scope of this program. See version notes.[/quote]
BTW @laurentb, I thought of another potential feature: hardlink files that aren't transcoded rather than copying them. Of course this is only possible if target directory is within filesystem boundaries, but it would allow for quite some space saving, what do you think?

brutha: transcode whole libraries to Ogg Vorbis

Reply #4
Thanks guys!

I know beets, interesting but I never got around trying it and I fear it does "too much".
I had no idea about caudec, looks pretty cool. Probably faster than brutha if you have slow I/O (if it copies to the ramdisk while encoding threads are running).

The hardlink feature is interesting, I'll add it to my TODO.

brutha: transcode whole libraries to Ogg Vorbis

Reply #5
If foobar2000 didn't exist I'd probably use either brutha or caudec.
It's only audiophile if it's inconvenient.

brutha: transcode whole libraries to Ogg Vorbis

Reply #6
I know beets, interesting but I never got around trying it and I fear it does "too much".
...
The hardlink feature is interesting, I'll add it to my TODO.

Thanks for your answer. I feel a bit the same about beets: just like emacs or vim, it is the kind of program with a steep learning curve because of great customization and possibilities.
Nice to know you'll consider the hardlink feature, I'll keep an eye on it!

If foobar2000 didn't exist I'd probably use either brutha or caudec.

I was in the happiest relationship with foobar2k when I was under Windows... Seriously, IMO it has everything right.
But then I moved to GNU/Linux: at first I resorted to use it through Wine, and was delighted to see it even supported optimized Windows-only build of encoders (!), but then I reinstalled another distro and didn't want to keep a multilib system any more, which Wine requires; besides I got more and more antagonized by non-libre software.
So I started looking for a replacement, but until this day I haven't found any that offers the same level of functionality: I used DeaDBeeF with satisfaction for a while, but it doesn't track folders (so no library management) and doesn't use multithreaded transcoding; Clementine is currently giving me a nice experience, but it has a few quirks in its transcoder and doesn't feel as powerful as foobar... Sigh. I miss foobar 

Hopefully, the combination of beets and brutha (and maybe caudec) will provide me the perfect setup I was dreaming of, all that in the UNIX-cherished command line fashion

@laurentb, what do you use for library management and audio player if I may ask?

brutha: transcode whole libraries to Ogg Vorbis

Reply #7
My understanding here is that brutha or something similar could start/orchestrate caudec instead of sox/vorbisgain directly.

I use mpd http://www.musicpd.org/ and various frontends, mostly mpc and ncmpc. I'd like a frontend that can look like that though: http://www.moonshotstudios.com/pawky/fooba..._look-album.gif (i.e. "album oriented")
Before that (i.e. ten years ago) I used foobar2000.
I like mpd because I can easily script around it (I made a few tools http://git.p.engu.in/laurentb/mpdat/tree/ but not really ready for the public).

Re: brutha: transcode whole libraries to Ogg Vorbis

Reply #8
BTW @laurentb, I thought of another potential feature: hardlink files that aren't transcoded rather than copying them. Of course this is only possible if target directory is within filesystem boundaries, but it would allow for quite some space saving, what do you think?

I finally added an option to do this (--hardlink). I also added the option to use reflinks instead, which are copy-on-write clones for filesystems like btrfs (--reflink). I saved a few gigabytes!

There are a few other improvements for the 1.1.0 release.

 
SimplePortal 1.0.0 RC1 © 2008-2018