Skip to content

A Technical Specification of a Device Profile

Ronen Mizrahi edited this page Jan 21, 2015 · 1 revision

A Technical Specification of a Device Profile

The following is a profile for a device that can play only MP3 audio, MPEG1/2 video (standard definition) and display JPEG photos. This profile is designed to serve as an example and does not represent any specific device, for the purpose of this example we will assume the device identities itself as Zulu and provides this identification in the user agent header of each HTTP request it makes. The documentation within the profile should allow for quick learning by example.

You can test your custom profile by pasting it at the very end of <code>profiles.xml</code> and restarting TVersity.

Example

<profile id="<some GUID>">
        <friendlyName>Zulu Device</friendlyName>
	<manufacturerName>Zulu Inc.</manufacturerName>
	<modelName>The Zulu 1000</modelName>

        <!-- The icon is used in the status tab of the graphical user interface - please submit an icon with your profile.
             To test it, copy your device icon to the web/images subfolder of TVersity.
        -->
        <icon>/images/<name of PNG or JPEG image></icon>

        <!--
	      inUASubstr - A list of sub-strings used to identify the device by matching the sub-strings against the user agent HTTP header.
              The pipe character ('|')is used to separate the list items.
	-->
        <HTTPHeader inUASubstr="zulu|ZULU"/>

	<!-- List of ip addresses corresponding to devices that TVersity should always map to this profile.
             This is provided as a manual workaround for device models that cannot be auto-detected otherwise and should be set by end users.
	<devicesIP value="ip1|ip2|ip3..."/>
	-->
		
        <!-- The Name of the media server device description document that should be used in conjunction with a player that corresponds to this profile.
             The default is UPNP_AV_MediaServer_1.0.default.xml, which is available in the TVersity Media Server distribution.
             If a special document is needed for your device, please create it and submit it to TVersity along with the profile.
             In such a case please also provide an explanation of the reasons for creating a custom device description document.
        -->
        <deviceDescription name="UPNP_AV_MediaServer_1.0.default.xml"/>
        
        <!-- The audio/photo/video container id TVersity should use 
             The default is 1 for audio, 2 for photo, 3 for video - devices that rely on different values change this.
             The ability to set these values allow easy bindings of remote control functions to the audio/photo/video navigation menus.
             A value of "null" will hide that section completely.

             Additional containers for which the id can be set are:
               musicAlbum - The root container for the music "albums" menu
               musicArtistAlbum - The root container for the music "artist / albums" menu
               musicGenre - The root container for the music "genre" menu
               musicAll - The root container for the music "All tracks" menu
               audioFeed - The root container for the audio podcasts menu
               videoActor - The root container for the video "actor" menu
               videoAlbum - The root container for the video "albums" menu
               videoAll - The root container for the video "All items" menu
               videoGenre - The root container for the video "genre" menu
               photoAlbum - The root container for the photo "albums" menu
               photoAll - The root container for the music "All items" menu
               photoDate - The root container for the photo "By Date" menu

             Other supported attributes:
               shortUrl="true/false" - short URLs may be required by devices that are limited in the maximum URL length they allow (false by default).
               friendlyFilename="true/false" - The filename portion of the URL should be descriptive for devices that allow downloading to the device local storage (false by default).

             As an example, full compatibility with Windows Media Player would require the following values:
               musicAlbum="7"
               musicArtistAlbum="6"
               musicGenre="5"
               musicAll="4"
               audioFeed="F"
               videoActor="A"
               videoAlbum="E"
               videoAll="8"
               videoGenre="9"
               photoAlbum="D"
               photoAll="B"
               photoDate="C"
        -->
        <contentDirectory audio="1" photo="2" video="3"/>
        
        <!-- When transcoding of local content is needed to which format should we transcode:

             audio="<mime type>" where the mime type is one of:
               audio/mpeg (mp3)
               audio/wav or audio/x-wav (WAV)
               audio/L16 (pcm)
               audio/flmp3 (mp3 that plays in Flash 7)

             video="<mime type>" where the mime type is one of:
               video/mpeg (MPEG1)
               video/mpeg16 (MPEG1 such that width and height are made to be a multiple of 16)
               video/mpeg2 (MPEG2)
               video/vob (MPEG2 program stream)
               video/vob16 (MPEG2 program stream such that width and height are made to be a multiple of 16)
               video/dvd (dvd)
               video/vcd (vcd)
               video/vardvd (dynamically choose either vcd or dvd based on target resolution)
               video/mp4 (MPEG4 ASP, AAC audio in MPEG4 container)
               video/avi (MPEG4 video, MP3 audio in AVI container)
               video/psp (mpeg4 that plays on PSP)
               video/x-flv (Flash Video)
               video/x-ms-wmv (Windows Media Video)
               video/x-ms-wmv9 (Windows Media Video 9)

              photo="<mime type>" where the mime type is image/jpeg

              When transcoding of Internet content is needed to which format should we transcode:

              onlineAudio - similar values as local audio files.

              onlineVideo - similar values as local video files.

              onlinePhoto - similar values as local photo files.

              NOTE:
              In some cases online content should be transcoded to a different format from local content. For example, music collections should be transcoded (when necessary) to WAV.
              This is because lossless formats are popular these days. Yet for online audio it is unnecessary and even undesirable because it can be live (e.g. radio stations).
              TVersity implements time shifting for live media and so stopping the playback does not abort the stream. Resuming playback results in skipping to the live portion
              of the stream and therefore streaming friendly formats (like MP3 and PCM) are better suited for online content.

              Additional supported attributes:

              adjustReadStartPos="true/false" - Live streams should be adjusted to start playing live when playing, stopping and they playing again (true by default).

              audioFailFutureSeek="true/false" - Devices that try reading the end of a transcoded audio file should fail as opposed to getting all zeros (false by default).

              videoFailFutureSeek="true/true" - Devices that try reading the end of a transcoded video file should fail as opposed to getting all zeros (false by default).

              actualSizeMatchFileSize="true/false" - When the actual file size after transcoding completes ends up being less than the estimated size, a value of true
                                                     (the default) will result in zero padding the file. A value of false will result in a closed connection. Please note
                                                     that unless you are prepared to handle HTTP responses where the actual payload is smaller in size than the size
                                                     reported in the <code>Content-Length</code> header (i.e. the estimated size), you should keep the default setting.
        -->
        <transcodeTarget audio="audio/mpeg" video="video/mpeg" photo="image/jpeg"
                         onlineAudio="audio/mpeg" onlineVideo="video/mpeg" onlinePhoto="image/jpeg"/>
        
        <!-- Typical audio/video/photo properties supported by the device.
             Some devices support different properties for different formats, in such cases the values below should be perceived as the default.
        -->
        <maxVideoInfo width="720" height="576" bitrate="5000000" fps="60"></maxVideoInfo>
        <minVideoInfo width="0" height="0" bitrate="0" fps="0"></minVideoInfo>
        
        <maxImageInfo width="720" height="480"></maxImageInfo>
        <minImageInfo width="0" height="0"></minImageInfo>
        
        <maxAudioInfo sampleRate="48000" bitsperSample="16" nchannels="6" bitrate="1536000"></maxAudioInfo>
        <minAudioInfo sampleRate="11025" bitsperSample="16" nchannels="1" bitrate="32000"></minAudioInfo>
        
        <!-- List of mime types supported natively by the device (these will not be transcoded, everything else will be).
             Note that you can optionally specify the codecs that are supported for each mime type and the maximum bitrate for each such codec.
             See full list of allowed mime types and codecs below.
        -->
	<mimetypeList>

            <!-- Audio mime types and their known aliases
            -->
            <mimetype value="audio/mpeg"/><!-- MP3 audio format-->
            <mimetype value="audio/x-mpeg" rename="audio/mpeg"/><!-- MP3 audio format-->
            <mimetype value="audio/mp3" rename="audio/mpeg"/><!-- MP3 audio format-->
            <mimetype value="audio/x-mp3" rename="audio/mpeg"/><!-- MP3 audio format-->
            <mimetype value="audio/mpeg3" rename="audio/mpeg"/><!-- MP3 audio format-->
            <mimetype value="audio/x-mpeg3" rename="audio/mpeg"/><!-- MP3 audio format-->
            <mimetype value="audio/mpg" rename="audio/mpeg"/><!-- MP3 audio format-->
            <mimetype value="audio/x-mpg" rename="audio/mpeg"/><!-- MP3 audio format-->
            <mimetype value="audio/x-mpegaudio" rename="audio/mpeg"/><!-- MP3 audio format-->

            <!-- Photo mime types and their known aliases
            -->
	    <mimetype value="image/jpeg"/><!-- jpeg image format-->

            <!-- Video mime types and their known aliases
            -->			
	    <mimetype value="video/mpeg"><!-- MPEG (1 or 2 program or transport stream) video format-->

              <!-- Video codecs -->
              <codec name="MPEG2VIDEO" />

              <!-- Audio codecs -->
              <codec name="MP2" maxBitrate="320000" />
              <codec name="MP3" maxBitrate="320000" />

	    </mimetype>
	    <mimetype value="video/mp1s" rename="video/mpeg"/><!-- MPEG1 system stream video format-->			
	    <mimetype value="video/mpeg2" rename="video/mpeg"/><!-- MPEG2 (program or transport stream) video format-->
	    <mimetype value="video/mp2p" rename="video/mpeg"/><!-- MPEG2 program stream (VOB) video format-->
	    <mimetype value="video/dvd" rename="video/mpeg"/><!-- MPEG2 program stream (VOB) video format-->
	    <mimetype value="video/mp2t"/><!-- MPEG2 transport stream video format -->

	</mimetypeList>

	<!-- The subtitles properties supported by the device.
	     Any combination of these properties is allowed.
	     (This feature is disabled by default and relevant only to select enterprise clients)

	     asVideoStream="true/false" - available subtitles for a media will be encoded as a separate video stream (false by default)
	     asDec="true/false" - available subtitles for a media will be listed in the description format (false by default)
	     asRes="true/false" - available subtitles for a media will be provided in the resource format (false by default)
	-->
	<subtitles asVideoStream="false" asDesc="false" asRes="false"></subtitles>
</profile>

Profile Inheritance

In some cases it is desirable to define a new profile by inheriting an existing one and overriding a few of the properties. This can be done in the following way:

<profile id="<some GUID>" inherits="<some other GUID>">
....
</profile>

Supported Mime Types

Audio

audio/L16 - pcm
audio/x-aiff - aif
audio/x-aiff - aifc
audio/x-aiff - aiff
audio/basic - au
audio/basic - snd
audio/mid - mid
audio/mid - midi
audio/mid - smf
audio/mid - rmi
audio/lpcm - lpcm
audio/mp1 - mp1
audio/mp2 - mp2
audio/mpeg - mp3
audio/x-ac3 - ac3
audio/x-aacp - aacp
audio/aacp - aacp
audio/x-aac - m4a
audio/x-aac - m4b
audio/aac - m4a
audio/aac - aac
audio/x-atrac3 - at3
audio/x-atrac3 - at3p
audio/x-dts - dts
audio/x-wav - wav
audio/wav - wav
audio/x-wv - Wav Pack (wv)
audio/x-pn-realaudio - ra
audio/x-ms-wma - wma
audio/x-ms-asf - wma
audio/x-matroska - mka
audio/x-flac - flac
audio/x-ape - Monkey Audio (ape)
audio/x-mpc - Musepack (mpc)
application/x-shorten - Shorten Audio (shn)
audio/AMR - amr

Tracker file formats (created by musicians by gathering different instruments and mixing them) Directshow filter is at http://dsp-worx.de/?n=8 More info about these files and many samples at http://www.modarchive.com

audio/x-mod - mod
audio/x-mo3 - mo3
audio/x-it - it
audio/x-xm - xm
audio/x-s3m - s3m
audio/x-mtm - mtm
audio/x-umx - umx

Video

application/x-ms-asf - asf
video/x-ms-wmv - wmv
video/x-ms-wm - wm
video/x-ms-asf - wmv
video/x-msvideo - avi
video/x-msvideo - We should use video/x-divx (although it is not the official mime type) since we need it to be different from the AVI mime and we found no official mime provided by divx, however the extension is also used for regular avi files s - divx
video/x-la-asf - lsf
video/x-la-asf - lsx
video/quicktime - mov
video/quicktime - qt
video/x-sgi-movie - movie
video/mpeg - MPEG 1/2
video/mp4 - mp4, m4v
video/mp4v-es - mp4, m4v
video/h264 - MPEG4 AVC in an mpeg4 container (mp4)
video/x-dv - dv
video/x-motion-jpeg - motion jpeg
application/ogg - ogg
video/3gpp - 3gp
video/3gpp2 - 3g2
video/ogm - Ogg Media File (ogm)
video/x-tivo - tivo
video/x-ms-dvr - dvrms
video/vnd.rn-realvideo - rv
application/vnd.rn-realmedia - rmvb
application/vnd.rn-realmedia - rm
video/x-matroska - mkv
application/x-matroska - mks
video/x-cdg - CDG Karaoke (cdg)
video/x-bin - BIN CD Image (bin) - Karaoke CD image with a CDG and mp3 file in it
video/x-flv - flv
video/flv - flv
misc/ultravox - uvox

Photo

image/x-cmu-raster - ras
image/x-rgb - rgb
image/tiff - tif, tiff
image/x-xwindowdump - xwd
image/bmp - bmp
image/x-icon - ico
image/x-cmx - cmx
image/cis-cod - cod
image/gif - gif
image/png - png
image/ief - ief
image/pipeg - jfif
image/jpeg - jpg, jpeg, jpe
image/x-xpixmap - xpm
image/x-portable-bitmap - pbm
image/x-portable-graymap - pgm
image/x-portable-anymap - pnm
image/x-portable-pixmap - ppm

Digital camera raw image formats (mime type created by us just to have something reasonable)

image/x-crw - crw (Canon)
image/x-cr2 - cr2 (Canon)
image/x-nef - nef (Nikon)
image/x-nrw - nrw (Nikon)
image/x-mrw - mrw (Minolta)
image/x-orf - orf (Olympus)
image/x-raf - raf (Fuji)
image/x-dng - dng (Adobe)
image/x-erf - erf (Epson)
image/x-x3f - x3f (Sigma)
image/x-dcr - dcr (Kodak)
image/x-kdc - kdc (Kodak)
image/x-arw - arw (Sony)
image/x-raw - raw (Panasonic and Leica)

Meta formats

audio/x-mpegurl - m3u
audio/x-scpls - pls
application/xml - xml
text/xml - xml
application/rss+xml - rss
application/atom+xml - atom
application/rdf+xml - rdf
text/x-opml - opml
application/smil - smil, smi
video/x-ms-asx - asx
video/x-ms-wvx - wvx
video/x-ms-wmx - wmx
audio/x-ms-wax - wax
application/vnd.ms-wpl - wpl
application/x-pn-realaudio - ram

Supported Codec Code Names

For lack of an inclusive and conclusive standard for codec code names, TVersity follows the codes defined in the [http://ffmpeg.org ffmpeg] header files.

Here are some common video codes:

MPEG1VIDEO
MPEG2VIDEO
H261
H263
MJPEG
MPEG4
WMV1
WMV2
WMV3
VC1
FLV1
H264
XVID
VP6
VP6F

Here are some common audio codes:

MP2
MP3
AAC
AC3
DTS
VORBIS
DVAUDIO
WMAV1
WMAV2
WMAP (aka 0x0162)
WMAL (aka 0x0163)
FLAC
ALAC
WAVPACK

PCM_S16LE
PCM_S16BE
PCM_U16LE
PCM_U16BE
PCM_S8
PCM_U8,
PCM_MULAW
PCM_ALAW
S32LE
S32BE
U32LE
U32BE
S24LE
S24BE
24LE
U24BE

Clone this wiki locally