Convert Videos, Extract Audio from Videos and The Like

Just a short note on this right now:

Audio can be extracted with mplayer using -dumpaudio option (low quality), ffmpeg tool with -ab and -ar options or online for youtube videos at vixy.net.

Quick video converter flv2mpg using ffmpeg is shown at Linux by Example, too.

Update: Another great open source program is MediaCoder which even has a special audio edition.

Ressources

How music similarity measures could be used

Lately I’ve been thinking about the possibilities of songbird (see screencast below), collecting music distributed under common licence or the like from blogs. Wouldn’t it be great to precisely search for music that way? You could say something like “search for music that sounds like what I’m listening to right now”. That means, the method I might be working on should be efficient enough to calculate relevant vectors for different pieces of music fast. Otherwise there would have to be some central service doing some fingerprinting again for all tracks around. But, as said before, that’s not what I’m after. Rather something to get a mutual measure between two tracks, pairwise.

As you can see in the screencast songbird can already, by using diverse search services, find related music. But, as far as I can judge right now, that’s user- or expert-based. That means, the music has to be known well to a certain point to have the data what a newly found song is like. And also it’s text based.

Basics of MusicIP’s MusicDNS and MusicAnalysis

Deriving from musicbrainz the system MusicIP created finding similar music works, in short, in three steps:

  1. analyse the music audio signal (up to 10 min of a track) locally by MusicIP Mixer generating an id called PUID (closed source!)
  2. PUID is sent to MusicDNS, a web-service by MusicIP (closed source, too!) which does fuzzy matching
  3. Some magic happens that the Mixer calculates a playlist by. It would not be sufficient for the DNS (Music Digital Naming Service, don’t mistaken it with Domain Name System) server to just return a list of PUIDs since the server (hopefully!) doesn’t know about all other tracks I have in my library, i.e. that potentially could be used to generate playlists with.

PUIDs

PUID is a 128-bit Portable Unique IDentifier that represents the analysis result from MusicIP Mixer and therefore is not a music piece finger print identifying a song in some particular version. PUIDs are just the ids used in the proprietary fingerprinting system operated by MusicIP. They provide a lightweight PUID generator called genpuid that does 1. and 2. PUIDs can be used to map track information such as artist, title, etc. to a finger print. The id itself has no acoustic information.

Acoustic Fingerprinting

Refering, again, to musicbrainz’s wiki acoustic fingerprinting here is a different process using only 2 minutes of a track. This fingerprint than is send to a MusicDNS server which in turn matches it against stored fingerprints. If a close enough match is made a PUID is returned which unambiguously identifies the matching fingerprint (Also see a list of fingerprinting systems. There is also an scientific review of algorithms). This is necessary since source to generate PUIDs or submit new ones is closed source.

On the other hand wikipedia defines acoustic fingerprinting as follows:

An acoustic fingerprint is a unique code generated from an audio waveform. Depending upon the particular algorithm, acoustic fingerprints can be used to automatically categorize or identify an audio sample.

This definition is even quoted by MusicIP’s Open Fingerprintâ„¢ Architecture Whitepaper (page 3).

MusicDNS

The web-service mainly is to match a PUID to a given acoustic fingerprint and look up track metadata such as artist, title, album, year, etc. (aka tags) as done by the fingerprinting client library libofa which has been developed by Predixis Corporation (now MusicIP) during 2000-2005. Only the query code is public via the MusicDNS SDK; music analysis and PUID submitting routines are closed source!

Getting the Playlist

Up to now I couldn’t figure out or find sources how this is actually done by Music Mixer. I’ll keep you posted as I find out.

Other sources / Directions

Archive Audio CDs to APE (MAC) or FLAC Image Files and Toss Away Your Dust Catchers

If someone is interested in archiving your audio CD collection in a really save manner to get rid of them after the encoding, or I should say transcoding process you might want to have a look at Neil Popham’s guide. Neil Popham, by the way, wrote some features for the APEv2 tagging tool wapet. His guide utilizes Windows batch scripts, adds tags and employs PAR2 for parity information. The later is needed to overcome seldom yet possible bit failures which would compromise an ape file. The ripping is done with EAC, the meanwhile well-known audio CD accurate ripping tool by Andre Wiethoff.

Using one single image file per CD has the benefit over multiple files to include, among others, audio information from before the first track, lead-in silence and TOC information. On the other hand, for audio library handling and daily playback where tagging plays a more important role, one file per track is much more comfy. That way all tags can be written directly to the audio file. This, however is resolutely limited with cue sheets. For example, with foobar2000 it’s transparent whether you have your playlist made up from an ape image with cue sheet or from multiple audio files with tags. It’s all the same with randomizing the list, seeking forward and backwards and the like. But once it comes to playback statistics or ReplayGain this will not be written to any file besides fb2k’s library database.

For my daily usage I copied the file MAC.exe (the actual encoder) from the Monkey’s Audio directory to foobar2000’s one and set up an encoding preset in it’s converter preferences using one of the following parameter taken from hydrogenaudio:

-c1000 Fast / large file
-c2000 Normal
-c3000 High / medium file
-c4000 Extra High
-c5000 Insane / small file

Prefixed by the source and destination file variables %s %d. I mainly chose ape over flac because of ape’s flexible tagging feature and neglected the in terms of encoding far better codec OptimFROG because this one needs heaps of CPU usage for decoding (while listening). When CPU power is not a constraint any longer I will most likely switch to ofg (if at that time it still has the best compression around). Don’t forget to enable the secure mode for your CD drive in fb2k under file -> open audio cd… -> select your drive and than drive settings. You can also access the rip wizard from there. Or go via “add to playlist” and convert the tracks manually.

Update: I have found out about WavPack which IMHO is a much better choice to MAC (APE) and FLAC because of better support, tagging and hybrid mode.