Media Server

SneakyMedia is an open source media server built from first principles. It has a layered design that is highly extensible.

This document provides some insight into that design.

Layer 0 - The Database Layer

Definitions

  • Item: A file
  • Mount: A named collection of items. The user defines a Mount by giving it a name and providing the uri of a directory on an accessible file system. The Mount represents all the items that are in that directory and all its subdirectories.
  • Tag: A named class of metadata, such as 'Artist', 'Album', 'Title', etc. There are a number of common tagging systems. In the world of audio the main ones include ID3 and Vorbis Comments. SneakyMedia extends the idea of a tag by giving it not only a name but also a namespace. This enables SneakyMedia to destinguish between, for instance, "id3:Artist" and "vorbis:Artist".
  • Metadatum: The combination of a tag and its value. A file may have, for instance, the following 3 items of metadata: vorbis:Artist='Pink Floyd', vorbis:Album='Dark Side Of The Moon', vorbis:Title='Breathe'.

Purpose

At the heart of Sneaky Media is its database. Every item that is added to SneakyMedia is scanned for metadata (ID3, Vorbis Comments, etc), which are added to the Tag Database.

The database is arranged in a way that enables the following operations to be efficiently performed:

  • List all the mounts
  • List the items in a given mount
  • Report when a given mount was last scanned
  • List all the metadata for a given item
  • Add or remove a metadatum from a given item
  • List all the tags used
  • List all the items with a given metadatum

Plugins

  • Scanner Plugin - scans particular types of item and generates appropriately tagged metadata for the database
  • Database Plugin - persists the database and responds to queries
  • Query Plugin - converts a textual query using a particular grammar into a specific database query
  • Comms Query Plugin - provides access to database queries over a specific comms protocol

Layer 1 - The Uri Layer

Definitions

  • Folder Uri: a text string that identifies a set of items
  • Item Uri: a text string that identifies a single item
  • Uri Schema: a system of rules that govern the way in which a text string is translated into a particular item or set of items

Plugins

  • Uri Plugin - implements a particular uri schema
  • Comms Uri Plugin - provides access to a particular uri schema over a particular comms protocol

Layer 2 - The Media Server Layer

Purpose

Provides access to items using standard media server protocols such as Upnp or DAAP. Non-standard protocols can optionally be supported