Chromaprint plug-in for GStreamer

It's been a long time since I learned some new framework (or even wrote some real code), so I decided to write a GStreamer plug-in that will wrap libchromaprint and make it very easy to generate Chromaprint fingerprints in GStreamer applications. This was inspired by a similar plug-in that Milosz Derezynski wrote for MusicDNS/libofa (the plug-in is now integrated in the official GStreamer distribution). Using the code from gst-ofa and gst-template, it turned out to be pretty easy. After a couple of hours, I was able to run commands like this and get valid fingerprints:

$ gst-launch-0.10 -t filesrc location=/path/to/audio/file ! decodebin ! audioconvert ! chromaprint duration=60 ! fakesink sync=0 | grep 'chromaprint fingerprint'

I also wrote a simple Python script that uses the GStreamer element to generate fingeprints and look them up using the Acoustid web service. It's nice to see how little code is necessary to have a fully working fingerprinting application.

The only disadvantage is that it's too slow. :) I had some GStreamer code in Picard for decoding audio files, but I eventually removed it because it was significantly slower compared to the other decoding options (FFmpeg and DirectX). It seems that the situation is still the same, because even compared to calling the ffmpeg binary in a subprocess (which I used in [acoustid-tools](, GStreamer is about three times slower. It's not too bad for applications that rarely use the functionality, but I wouldn't use it in a tagger that needs to identify many files as fast as possible.

Anyway, the project is on Launchpad, where you can download the source code using bzr or a tarball. It depends on the development version of libchromaprint.

Leave a Reply

comments powered by Disqus