Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
The ISO/IEC 29341-20-4 standard defines the UPnP AV MediaServer v2 device template, a comprehensive specification for devices that provide media content to UPnP networks. The MediaServer device template combines multiple UPnP services — typically ContentDirectory v2 (29341-18-13), ConnectionManager v2 (29341-18-6), and optionally AVTransport v2 (29341-18-12) — into a cohesive device type that can serve audio, video, and image content to MediaRenderers on the home network.
The v2 MediaServer template extends the v1 specification with significant architectural improvements: support for multiple content directories on a single device, improved content synchronization across servers, enhanced search capabilities with federated queries, content bookmarking and resume support, and metadata enrichment from multiple sources including embedded tags and external databases.
The MediaServer v2 device template mandates the inclusion of several core services and allows optional services for enhanced functionality. The mandatory services are ContentDirectory (for content browsing and search), ConnectionManager (for protocol and content format negotiation between server and renderer), and the device description itself (providing the device’s friendly name, manufacturer, model information, and icon URLs).
Optional but strongly recommended services include AVTransport (for server-side playback control, particularly useful for streaming servers that manage trick-play), MediaServerCapabilities (advertising supported media formats and features), and ScheduledRecording (for Personal Video Recorder functionality). The v2 specification also introduces an optional ContentSync service that enables content database synchronization across multiple MediaServers on the same network, allowing a unified content view.
| Service | Mandatory/Optional | Purpose |
|---|---|---|
| ContentDirectory v2 | Mandatory | Browse, search, and enumerate media content hierarchy |
| ConnectionManager v2 | Mandatory | Negotiate protocols, transport formats, and content types |
| AVTransport v2 | Optional | Server-managed playback control and trick-play |
| ScheduledRecording v2 | Optional | Schedule and manage PVR recordings |
| ContentSync v2 | Optional | Synchronize content databases across multiple servers |
| MediaServerCapabilities | Optional | Advertise supported media formats and transcoding capabilities |
A critical function of the MediaServer is managing the connection between the content source and the rendering device. The ConnectionManager service facilitates this by supporting protocol and format negotiation through the GetProtocolInfo action, which returns lists of supported transport protocols (HTTP GET, RTSP, RTP, MMS) and content formats (MIME types) for both the source (the MediaServer) and the sink (the MediaRenderer). The v2 specification enhances this with capability-based filtering using the GetCurrentConnectionInfo action, which provides real-time information about active connections including bandwidth utilization and QoS parameters.
The MediaServer v2 also supports transcoding capabilities through the GetMediaServerCapabilities action. A server that supports transcoding can convert content from one format to another on-the-fly when the requesting MediaRenderer does not support the original format. For example, a server might transcode a DTS-HD Master Audio track to Dolby Digital Plus for a renderer that only supports the latter. This is advertised through the TranscodingCapabilities state variable, which lists supported input-to-output format mappings.
When implementing a MediaServer v2, the most critical engineering decision is the content database architecture. The server must maintain an indexed database of all available content, including metadata, cover art references, and resource URIs. The database must support efficient hierarchical browsing (for the Browse action) and full-text search (for the Search action). File system-based implementations are suitable for small collections (under 1,000 items), but database-backed implementations (SQLite, embedded database) are strongly recommended for larger collections.
The ContentSync service introduced in v2 addresses the challenge of multiple MediaServers on the same home network. It defines a “sync group” concept where servers can subscribe to each other’s content changes and maintain a unified content database. The synchronization uses a version vector approach based on SystemUpdateID values, where each server maintains its own update counter and exchanges change logs with peer servers in the sync group. This allows a control point to see content from all servers without querying each one individually.
For servers with large content libraries (10,000+ items), the v2 specification recommends implementing lazy loading of metadata. Instead of scanning all files at startup (which can take minutes), the server should perform an initial quick scan to discover new and removed files, then load metadata on demand when items are first browsed or searched. This dramatically reduces startup time and memory usage.