Difference between revisions of "Content Service"

From MythTV Official Wiki
Jump to: navigation, search
(GetAlbumArt)
 
(21 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
=What is this?=
 +
See [[Services API]]
 +
 +
 
=Content Service API List=
 
=Content Service API List=
  
Line 23: Line 27:
 
| align="center"  | No
 
| align="center"  | No
 
| Display, and optionally scale, an image file of a given type (coverart, banner, fanart) for a given recording's inetref and season number.
 
| Display, and optionally scale, an image file of a given type (coverart, banner, fanart) for a given recording's inetref and season number.
 +
|-
 +
| style="background:silver" | [[Content_Service#GetRecordingArtworkList | GetRecordingArtworkList]]
 +
| style="background:silver" align="center" | No
 +
| style="background:silver" | Display a list of artwork available for a recording by start time and channel id.
 +
|-
 +
| [[Content_Service#GetProgramArtworkList | GetProgramArtworkList]]
 +
| align="center"  | No
 +
| Display a list of artwork available for a program by inetref and season.
 
|-  
 
|-  
 
| style="background:silver" | [[Content_Service#GetVideoArtwork | GetVideoArtwork]]
 
| style="background:silver" | [[Content_Service#GetVideoArtwork | GetVideoArtwork]]
Line 53: Line 65:
 
|-  
 
|-  
 
| [[Content_Service#DownloadFile | DownloadFile]]
 
| [[Content_Service#DownloadFile | DownloadFile]]
| align="center"  | No
+
| align="center"  | Yes
 
| Instruct the backend to download a remote file into a storage group.
 
| Instruct the backend to download a remote file into a storage group.
 
+
|-
 +
| style="background:silver" | [[Content_Service#AddLiveStream | AddLiveStream]]
 +
| style="background:silver" align="center" | No
 +
| style="background:silver" | Start a HTTP Live Stream transcode for a given file and storage group.
 +
|-
 +
| [[Content_Service#AddRecordingLiveStream | AddRecordingLiveStream]]
 +
| align="center"  | No
 +
| Start a HTTP Live Stream transcode for a given ChanId and StartTime.
 +
|-
 +
| style="background:silver" | [[Content_Service#AddVideoLiveStream | AddVideoLiveStream]]
 +
| style="background:silver" align="center" | No
 +
| style="background:silver" | Start a HTTP Live Stream transcode for a given Video ID.
 +
|-
 +
| [[Content_Service#GetLiveStream | GetLiveStream]]
 +
| align="center"  | No
 +
| Get the stream status data for a given HTTP Live Stream.
 +
|-
 +
| style="background:silver" | [[Content_Service#GetLiveStreamList | GetLiveStreamList]]
 +
| style="background:silver" align="center" | No
 +
| style="background:silver" | Get the stream status data for all available HTTP Live Streams.
 +
|-
 +
| [[Content_Service#GetFilteredLiveStreamList | GetFilteredLiveStreamList]]
 +
| align="center"  | No
 +
| Get the stream status data for all available HTTP Live Streams created from a given filename.
 +
|-
 +
| style="background:silver" | [[Content_Service#RemoveLiveStream | RemoveLiveStream]]
 +
| style="background:silver" align="center" | No
 +
| style="background:silver" | Stop transcoding a given HTTP Live Stream, and remove the transcoded files.
 +
|-
 +
| [[Content_Service#StopLiveStream | StopLiveStream]]
 +
| align="center"  | No
 +
| Stop transcoding a given HTTP Live Stream, leaving the transcoded files intact.
 
|}
 
|}
 
</center>
 
</center>
Line 69: Line 112:
 
:: The Storage Group name in which you wish to search for the file.
 
:: The Storage Group name in which you wish to search for the file.
  
:<span style="color:SteelBlue">Filename</Span> ('''Required''')
+
:<span style="color:SteelBlue">FileName</Span> ('''Required''')
 
:: '''Parameter Type:''' String
 
:: '''Parameter Type:''' String
 
:: The filename (and relative path if necessary) of the file you wish to receive.
 
:: The filename (and relative path if necessary) of the file you wish to receive.
Line 89: Line 132:
 
:: The Storage Group name in which you wish to search for the file.
 
:: The Storage Group name in which you wish to search for the file.
  
:<span style="color:SteelBlue">Filename</Span> ('''Required''')
+
:<span style="color:SteelBlue">FileName</Span> ('''Required''')
 
:: '''Parameter Type:''' String
 
:: '''Parameter Type:''' String
 
:: The filename (and relative path if necessary) of the file you wish to receive.
 
:: The filename (and relative path if necessary) of the file you wish to receive.
Line 138: Line 181:
 
</QStringList>
 
</QStringList>
 
</pre>
 
</pre>
 +
 +
==GetRecordingArtwork==
 +
 +
The <span style="color:LimeGreen">GetRecordingArtwork</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">Inetref</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The inetref for the recording you are looking up.  This information is available in the Program construct, which can be queried in the DVR Service.
 +
 +
:<span style="color:SteelBlue">Type</Span> ('''Optional''')
 +
:: '''Parameter Type:''' String
 +
:: The type of artwork you wish to download. Valid types are ''coverart'', ''fanart'', and ''banner''. If no type is present, the query will fall back to coverart.
 +
 +
:<span style="color:SteelBlue">Season</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The season number of the artwork you wish to receive.  If no season number is present, the query will fall back to the latest available season.
 +
 +
:<span style="color:SteelBlue">Width</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The scaled width to return the image.  To preserve proper aspect, you may want to specify only one of width or height.
 +
 +
:<span style="color:SteelBlue">Height</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The scaled height to return the image.  To preserve proper aspect, you may want to specify only one of width or height.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Content/GetRecordingArtwork?Inetref=80552&Type=fanart&Season=2</code>
 +
 +
Example Return:
 +
 +
The return for this command is a ''binary file'' which will be interpreted by your browser and downloaded or displayed as appropriate.
 +
 +
==GetRecordingArtworkList==
 +
 +
The <span style="color:LimeGreen">GetRecordingArtwork</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">ChanId</Span> ('''Required''')
 +
:: '''Parameter Type:''' Integer
 +
:: The database channel id for the recording.
 +
 +
:<span style="color:SteelBlue">StartTime</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The recording start time for the item.  This should be in MySQL ISO format, eg: 2011-08-29 18:59:00.  You can replace the space with %20 or T.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Content/GetRecordingArtworkList?ChanId=3123&StartTime=2011-01-01T09:00:00</code>
 +
 +
Example Return:
 +
 +
<pre>
 +
<ArtworkInfoList version="1.0" serializerVersion="1.1">
 +
    <ArtworkInfos>
 +
        <ArtworkInfo>
 +
            <URL>/Content/GetRecordingArtwork?InetRef=210841&Season=1&Type=coverart</URL>
 +
            <FileName>myth://Coverart@192.168.0.99:6543/Alphas Season 1_coverart.jpg</FileName>
 +
            <StorageGroup>Coverart</StorageGroup>
 +
            <Type>coverart</Type>
 +
        </ArtworkInfo>
 +
        <ArtworkInfo>
 +
            <URL>/Content/GetRecordingArtwork?InetRef=210841&Season=1&Type=fanart</URL>
 +
            <FileName>myth://Fanart@192.168.0.99:6543/Alphas Season 1_fanart.jpg</FileName>
 +
            <StorageGroup>Fanart</StorageGroup>
 +
            <Type>fanart</Type>
 +
        </ArtworkInfo>
 +
        <ArtworkInfo>
 +
            <URL>/Content/GetRecordingArtwork?InetRef=210841&Season=1&Type=banner</URL>
 +
            <FileName>myth://Banners@192.168.0.99:6543/Alphas Season 1_banner.jpg</FileName>
 +
            <StorageGroup>Banners</StorageGroup>
 +
            <Type>banner</Type>
 +
        </ArtworkInfo>
 +
    </ArtworkInfos>
 +
</ArtworkInfoList>
 +
</pre>
 +
 +
==GetProgramArtworkList==
 +
 +
The <span style="color:LimeGreen">GetRecordingArtwork</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">Inetref</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The inetref for the recording you are looking up.  This information is available in the Program construct, which can be queried in the DVR Service.
 +
 +
:<span style="color:SteelBlue">Season</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The season number of the artwork you wish to receive.  If no season number is present, the query will fall back to the latest available season.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Content/GetRecordingArtwork?Inetref=80552&Type=fanart&Season=2</code>
 +
 +
Example Return:
 +
 +
<pre>
 +
<ArtworkInfoList version="1.0" serializerVersion="1.1">
 +
    <ArtworkInfos>
 +
        <ArtworkInfo>
 +
            <URL>/Content/GetRecordingArtwork?InetRef=210841&Season=1&Type=coverart</URL>
 +
            <FileName>myth://Coverart@192.168.0.99:6543/Alphas Season 1_coverart.jpg</FileName>
 +
            <StorageGroup>Coverart</StorageGroup>
 +
            <Type>coverart</Type>
 +
        </ArtworkInfo>
 +
        <ArtworkInfo>
 +
            <URL>/Content/GetRecordingArtwork?InetRef=210841&Season=1&Type=fanart</URL>
 +
            <FileName>myth://Fanart@192.168.0.99:6543/Alphas Season 1_fanart.jpg</FileName>
 +
            <StorageGroup>Fanart</StorageGroup>
 +
            <Type>fanart</Type>
 +
        </ArtworkInfo>
 +
        <ArtworkInfo>
 +
            <URL>/Content/GetRecordingArtwork?InetRef=210841&Season=1&Type=banner</URL>
 +
            <FileName>myth://Banners@192.168.0.99:6543/Alphas Season 1_banner.jpg</FileName>
 +
            <StorageGroup>Banners</StorageGroup>
 +
            <Type>banner</Type>
 +
        </ArtworkInfo>
 +
    </ArtworkInfos>
 +
</ArtworkInfoList>
 +
</pre>
 +
 +
==GetVideoArtwork==
 +
 +
The <span style="color:LimeGreen">GetVideoArtwork</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">Id</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The database id for the video you are looking up.  This information is available in the VideoMetadataInfo construct, which can be queried in the Video Service.
 +
 +
:<span style="color:SteelBlue">Type</Span> ('''Optional''')
 +
:: '''Parameter Type:''' String
 +
:: The type of artwork you wish to download. Valid types are ''coverart'', ''fanart'', and ''banner''. If no type is present, the query will fall back to coverart.
 +
 +
:<span style="color:SteelBlue">Width</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The scaled width to return the image.  To preserve proper aspect, you may want to specify only one of width or height.
 +
 +
:<span style="color:SteelBlue">Height</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The scaled height to return the image.  To preserve proper aspect, you may want to specify only one of width or height.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Content/GetVideoArtwork?Id=100&Type=fanart</code>
 +
 +
Example Return:
 +
 +
The return for this command is a ''binary file'' which will be interpreted by your browser and downloaded or displayed as appropriate.
 +
 +
==GetAlbumArt==
 +
 +
The <span style="color:LimeGreen">GetAlbumArt</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">Id</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The database id for the '''track''' you are looking up. For an album, use the id of the first track.
 +
 +
:<span style="color:SteelBlue">Width</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The scaled width to return the image.  To preserve proper aspect, you may want to specify only one of width or height.
 +
 +
:<span style="color:SteelBlue">Height</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The scaled height to return the image.  To preserve proper aspect, you may want to specify only one of width or height.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Content/GetAlbumArt?Id=585</code>
 +
 +
Example Return:
 +
 +
The return for this command is a ''binary file'' which will be interpreted by your browser and downloaded or displayed as appropriate.
 +
 +
==GetPreviewImage==
 +
 +
The <span style="color:LimeGreen">GetPreviewImage</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">ChanId</Span> ('''Required''')
 +
:: '''Parameter Type:''' Integer
 +
:: The database channel id for the recording.
 +
 +
:<span style="color:SteelBlue">StartTime</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The recording start time for the item.  This should be in MySQL ISO format, eg: 2011-08-29 18:59:00.  You can replace the space with %20 or T.
 +
 +
:<span style="color:SteelBlue">Width</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The scaled width to return the image.  To preserve proper aspect, you may want to specify only one of width or height.
 +
 +
:<span style="color:SteelBlue">Height</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The scaled height to return the image.  To preserve proper aspect, you may want to specify only one of width or height.
 +
 +
:<span style="color:SteelBlue">SecsIn</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The number of seconds into the recording to fast forward before generating a preview image.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Content/GetPreviewImage?ChanId=34736&StartTime=2011-08-29T18:59:00</code>
 +
 +
Example Return:
 +
 +
The return for this command is a ''binary file'' which will be interpreted by your browser and downloaded or displayed as appropriate.
 +
 +
==GetRecording==
 +
 +
The <span style="color:LimeGreen">GetRecording</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">ChanId</Span> ('''Required''')
 +
:: '''Parameter Type:''' Integer
 +
:: The database channel id for the recording.
 +
 +
:<span style="color:SteelBlue">StartTime</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The recording start time for the item.  This should be in MySQL ISO format, eg: 2011-08-29 18:59:00.  You can replace the space with %20 or T.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Content/GetRecording?ChanId=34736&StartTime=2011-08-29T18:59:00</code>
 +
 +
Example Return:
 +
 +
The return for this command is a ''binary file'' which will be interpreted by your browser and downloaded or displayed as appropriate.
 +
 +
==GetVideo==
 +
 +
The <span style="color:LimeGreen">GetVideo</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">Id</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The database id for the video file.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Content/GetVideo?Id=100</code>
 +
 +
Example Return:
 +
 +
The return for this command is a ''binary file'' which will be interpreted by your browser and downloaded or displayed as appropriate.
 +
 +
==GetMusic==
 +
 +
The <span style="color:LimeGreen">GetMusic</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">Id</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The database id for the music file.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Content/GetMusic?Id=100</code>
 +
 +
Example Return:
 +
 +
The return for this command is a ''binary file'' which will be interpreted by your browser and downloaded or displayed as appropriate.
 +
 +
==GetHash==
 +
 +
The <span style="color:LimeGreen">GetHash</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">StorageGroup</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The Storage Group name in which you wish to search for the file.
 +
 +
:<span style="color:SteelBlue">FileName</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The filename (and relative path if necessary) of the file you wish to hash.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Content/GetHash?StorageGroup=Recordings&FileName=244001_20110922210000.mpg</code>
 +
 +
Example Return:
 +
 +
<pre>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<QString>c80767b59e4d96d2</QString>
 +
</pre>
 +
 +
==DownloadFile==
 +
 +
The <span style="color:LimeGreen">DownloadFile</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">StorageGroup</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The Storage Group name to which you wish to download the file.
 +
 +
:<span style="color:SteelBlue">URL</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The URL that you wish to download.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Content/DownloadFile?StorageGroup=Videos&URL=http://www.mythtv.org/index.html</code>
 +
 +
Example Return:
 +
 +
<pre>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<bool>true</bool>
 +
</pre>
 +
 +
==AddLiveStream==
 +
 +
The <span style="color:LimeGreen">AddLiveStream</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">FileName</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The Filename you wish to transcode.
 +
 +
:<span style="color:SteelBlue">StorageGroup</Span> ('''Optional''')
 +
:: '''Parameter Type:''' String
 +
:: The Storage Group name which contains the file to be transcoded.
 +
 +
:<span style="color:SteelBlue">MaxSegments</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The number of 10-second segments to keep at any given time.  When this number of segments is reached, each new segment results in the deletion of the oldest one from the playlist and filesystem.  Not setting this value, or a value of 0, will result in all segments being kept.
 +
 +
:<span style="color:SteelBlue">Width</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The width, in pixels, of the output stream.  If only one of Height and Width are set, the other will be set automatically to preserve the aspect.
 +
 +
:<span style="color:SteelBlue">Height</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The height, in pixels, of the output stream.  If only one of Height and Width are set, the other will be set automatically to preserve the aspect.
 +
 +
:<span style="color:SteelBlue">Bitrate</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The video bitrate, in bits per second, of the output stream.  The default bitrate is 800000 b/s (800 Kb/s).
 +
 +
:<span style="color:SteelBlue">AudioBitrate</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The audio bitrate, in bits per second, of the output stream.  The default audio bitrate is 64000 b/s (64 Kb/s).
 +
 +
:<span style="color:SteelBlue">SampleRate</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The audio sampling rate, in Hz, of the output stream.  The default audio sampling rate is 44100 Hz (44.1 Khz/s).
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Content/AddLiveStream?FileName=34736_20110926190000.mpg&StorageGroup=Default&Height=540&Width=0&Bitrate=600000&AudioBitrate=40000&SampleRate=22050</code>
 +
 +
Example Return:
 +
 +
<pre>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<LiveStreamInfo version="1.0" serializerVersion="1.1">
 +
    <Id>100</Id>
 +
    <Width>0</Width>
 +
    <Height>540</Height>
 +
    <Bitrate>600000</Bitrate>
 +
    <AudioBitrate>40000</AudioBitrate>
 +
    <SegmentSize>10</SegmentSize>
 +
    <MaxSegments>0</MaxSegments>
 +
    <StartSegment>0</StartSegment>
 +
    <CurrentSegment>0</CurrentSegment>
 +
    <SegmentCount>0</SegmentCount>
 +
    <PercentComplete>0</PercentComplete>
 +
    <Created>2011-12-03T06:58:55</Created>
 +
    <LastModified>2011-12-03T06:58:55</LastModified>
 +
    <RelativeURL>/Content/GetFile?StorageGroup=Streaming&amp;FileName=34736_20110926190000.mpg.0x540_600kV_40kA.m3u8</RelativeURL>
 +
    <FullURL>http://192.168.0.99:6544/Content/GetFile?StorageGroup=Streaming&amp;FileName=34736_20110926190000.mpg.0x540_600kV_40kA.m3u8</FullURL>
 +
    <StatusStr>Queued</StatusStr>
 +
    <StatusInt>0</StatusInt>
 +
    <StatusMessage></StatusMessage>
 +
    <SourceFile>/var/lib/mythtv/recordings/34736_20110926190000.mpg</SourceFile>
 +
    <SourceHost>Holmes</SourceHost>
 +
    <SourceWidth>0</SourceWidth>
 +
    <SourceHeight>0</SourceHeight>
 +
    <AudioOnlyBitrate>32000</AudioOnlyBitrate>
 +
</LiveStreamInfo>
 +
</pre>
 +
 +
==AddRecordingLiveStream==
 +
 +
The <span style="color:LimeGreen">AddRecordingLiveStream</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">ChanId</Span> ('''Required''')
 +
:: '''Parameter Type:''' Integer
 +
:: The database channel id for the recording.
 +
 +
:<span style="color:SteelBlue">StartTime</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The recording start time for the item.  This should be in MySQL ISO format, eg: 2011-08-29 18:59:00.  You can replace the space with %20 or T.
 +
 +
:<span style="color:SteelBlue">MaxSegments</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The number of 10-second segments to keep at any given time.  When this number of segments is reached, each new segment results in the deletion of the oldest one from the playlist and filesystem.  Not setting this value, or a value of 0, will result in all segments being kept.
 +
 +
:<span style="color:SteelBlue">Width</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The width, in pixels, of the output stream.  If only one of Height and Width are set, the other will be set automatically to preserve the aspect.
 +
 +
:<span style="color:SteelBlue">Height</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The height, in pixels, of the output stream.  If only one of Height and Width are set, the other will be set automatically to preserve the aspect.
 +
 +
:<span style="color:SteelBlue">Bitrate</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The video bitrate, in bits per second, of the output stream.  The default bitrate is 800000 b/s (800 Kb/s).
 +
 +
:<span style="color:SteelBlue">AudioBitrate</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The audio bitrate, in bits per second, of the output stream.  The default audio bitrate is 64000 b/s (64 Kb/s).
 +
 +
:<span style="color:SteelBlue">SampleRate</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The audio sampling rate, in Hz, of the output stream.  The default audio sampling rate is 44100 Hz (44.1 Khz/s).
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Content/AddRecordingLiveStream?ChanId=34736&StartTime=2011-09-26T19:00:00&Height=540&Width=0&Bitrate=600000&AudioBitrate=40000&SampleRate=22050</code>
 +
 +
Example Return:
 +
 +
<pre>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<LiveStreamInfo version="1.0" serializerVersion="1.1">
 +
    <Id>100</Id>
 +
    <Width>0</Width>
 +
    <Height>540</Height>
 +
    <Bitrate>600000</Bitrate>
 +
    <AudioBitrate>40000</AudioBitrate>
 +
    <SegmentSize>10</SegmentSize>
 +
    <MaxSegments>0</MaxSegments>
 +
    <StartSegment>0</StartSegment>
 +
    <CurrentSegment>0</CurrentSegment>
 +
    <SegmentCount>0</SegmentCount>
 +
    <PercentComplete>0</PercentComplete>
 +
    <Created>2011-12-03T06:58:55</Created>
 +
    <LastModified>2011-12-03T06:58:55</LastModified>
 +
    <RelativeURL>/Content/GetFile?StorageGroup=Streaming&amp;FileName=34736_20110926190000.mpg.0x540_600kV_40kA.m3u8</RelativeURL>
 +
    <FullURL>http://192.168.0.99:6544/Content/GetFile?StorageGroup=Streaming&amp;FileName=34736_20110926190000.mpg.0x540_600kV_40kA.m3u8</FullURL>
 +
    <StatusStr>Queued</StatusStr>
 +
    <StatusInt>0</StatusInt>
 +
    <StatusMessage></StatusMessage>
 +
    <SourceFile>/var/lib/mythtv/recordings/34736_20110926190000.mpg</SourceFile>
 +
    <SourceHost>Holmes</SourceHost>
 +
    <SourceWidth>0</SourceWidth>
 +
    <SourceHeight>0</SourceHeight>
 +
    <AudioOnlyBitrate>32000</AudioOnlyBitrate>
 +
</LiveStreamInfo>
 +
</pre>
 +
 +
==AddVideoLiveStream==
 +
 +
The <span style="color:LimeGreen">AddVideoLiveStream</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">Id</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The database id for the video you are streaming.  This information is available in the VideoMetadataInfo construct, which can be queried in the Video Service.
 +
 +
:<span style="color:SteelBlue">MaxSegments</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The number of 10-second segments to keep at any given time.  When this number of segments is reached, each new segment results in the deletion of the oldest one from the playlist and filesystem.  Not setting this value, or a value of 0, will result in all segments being kept.
 +
 +
:<span style="color:SteelBlue">Width</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The width, in pixels, of the output stream.  If only one of Height and Width are set, the other will be set automatically to preserve the aspect.
 +
 +
:<span style="color:SteelBlue">Height</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The height, in pixels, of the output stream.  If only one of Height and Width are set, the other will be set automatically to preserve the aspect.
 +
 +
:<span style="color:SteelBlue">Bitrate</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The video bitrate, in bits per second, of the output stream.  The default bitrate is 800000 b/s (800 Kb/s).
 +
 +
:<span style="color:SteelBlue">AudioBitrate</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The audio bitrate, in bits per second, of the output stream.  The default audio bitrate is 64000 b/s (64 Kb/s).
 +
 +
:<span style="color:SteelBlue">SampleRate</Span> ('''Optional''')
 +
:: '''Parameter Type:''' Integer
 +
:: The audio sampling rate, in Hz, of the output stream.  The default audio sampling rate is 44100 Hz (44.1 Khz/s).
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Content/AddVideoLiveStream?Id=75&Height=540&Width=0&Bitrate=600000&AudioBitrate=40000&SampleRate=22050</code>
 +
 +
Example Return:
 +
 +
<pre>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<LiveStreamInfo version="1.0" serializerVersion="1.1">
 +
    <Id>100</Id>
 +
    <Width>0</Width>
 +
    <Height>540</Height>
 +
    <Bitrate>600000</Bitrate>
 +
    <AudioBitrate>40000</AudioBitrate>
 +
    <SegmentSize>10</SegmentSize>
 +
    <MaxSegments>0</MaxSegments>
 +
    <StartSegment>0</StartSegment>
 +
    <CurrentSegment>0</CurrentSegment>
 +
    <SegmentCount>0</SegmentCount>
 +
    <PercentComplete>0</PercentComplete>
 +
    <Created>2011-12-03T06:58:55</Created>
 +
    <LastModified>2011-12-03T06:58:55</LastModified>
 +
    <RelativeURL>/Content/GetFile?StorageGroup=Streaming&amp;FileName=300.evo.0x540_600kV_40kA.m3u8</RelativeURL>
 +
    <FullURL>http://192.168.0.99:6544/Content/GetFile?StorageGroup=Streaming&amp;FileName=300.evo.0x540_600kV_40kA.m3u8</FullURL>
 +
    <StatusStr>Queued</StatusStr>
 +
    <StatusInt>0</StatusInt>
 +
    <StatusMessage></StatusMessage>
 +
    <SourceFile>/MythMedia/movies/300.evo</SourceFile>
 +
    <SourceHost>Holmes</SourceHost>
 +
    <SourceWidth>0</SourceWidth>
 +
    <SourceHeight>0</SourceHeight>
 +
    <AudioOnlyBitrate>32000</AudioOnlyBitrate>
 +
</LiveStreamInfo>
 +
</pre>
 +
 +
==GetLiveStream==
 +
 +
The <span style="color:LimeGreen">GetLiveStream</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">Id</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The database id for the live stream.  This information is returned with the LiveStreamInfo from when adding a stream.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Content/GetLiveStream?Id=100</code>
 +
 +
Example Return:
 +
 +
<pre>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<LiveStreamInfo version="1.0" serializerVersion="1.1">
 +
    <Id>100</Id>
 +
    <Width>960</Width>
 +
    <Height>540</Height>
 +
    <Bitrate>600000</Bitrate>
 +
    <AudioBitrate>40000</AudioBitrate>
 +
    <SegmentSize>10</SegmentSize>
 +
    <MaxSegments>0</MaxSegments>
 +
    <StartSegment>0</StartSegment>
 +
    <CurrentSegment>10</CurrentSegment>
 +
    <SegmentCount>10</SegmentCount>
 +
    <PercentComplete>4</PercentComplete>
 +
    <Created>2011-12-03T06:58:55</Created>
 +
    <LastModified>2011-12-03T06:58:55</LastModified>
 +
    <RelativeURL>/Content/GetFile?StorageGroup=Streaming&amp;FileName=300.evo.0x540_600kV_40kA.m3u8</RelativeURL>
 +
    <FullURL>http://192.168.0.99:6544/Content/GetFile?StorageGroup=Streaming&amp;FileName=300.evo.0x540_600kV_40kA.m3u8</FullURL>
 +
    <StatusStr>Queued</StatusStr>
 +
    <StatusInt>0</StatusInt>
 +
    <StatusMessage></StatusMessage>
 +
    <SourceFile>/MythMedia/movies/300.evo</SourceFile>
 +
    <SourceHost>Holmes</SourceHost>
 +
    <SourceWidth>0</SourceWidth>
 +
    <SourceHeight>0</SourceHeight>
 +
    <AudioOnlyBitrate>32000</AudioOnlyBitrate>
 +
</LiveStreamInfo>
 +
</pre>
 +
 +
==GetLiveStreamList==
 +
 +
The <span style="color:LimeGreen">GetLiveStreamList</span> API takes no arguments.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Content/GetLiveStreamList</code>
 +
 +
Example Return:
 +
 +
<pre>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<LiveStreamInfoList>
 +
    <LiveStreamInfo>
 +
        <Id>100</Id>
 +
        <Width>960</Width>
 +
        <Height>540</Height>
 +
        <Bitrate>600000</Bitrate>
 +
        <AudioBitrate>40000</AudioBitrate>
 +
        <SegmentSize>10</SegmentSize>
 +
        <MaxSegments>0</MaxSegments>
 +
        <StartSegment>0</StartSegment>
 +
        <CurrentSegment>10</CurrentSegment>
 +
        <SegmentCount>10</SegmentCount>
 +
        <PercentComplete>4</PercentComplete>
 +
        <Created>2011-12-03T06:58:55</Created>
 +
        <LastModified>2011-12-03T06:58:55</LastModified>
 +
        <RelativeURL>/Content/GetFile?StorageGroup=Streaming&amp;FileName=300.evo.0x540_600kV_40kA.m3u8</RelativeURL>
 +
        <FullURL>http://192.168.0.99:6544/Content/GetFile?StorageGroup=Streaming&amp;FileName=300.evo.0x540_600kV_40kA.m3u8</FullURL>
 +
        <StatusStr>Queued</StatusStr>
 +
        <StatusInt>0</StatusInt>
 +
        <StatusMessage></StatusMessage>
 +
        <SourceFile>/MythMedia/movies/300.evo</SourceFile>
 +
        <SourceHost>Holmes</SourceHost>
 +
        <SourceWidth>0</SourceWidth>
 +
        <SourceHeight>0</SourceHeight>
 +
        <AudioOnlyBitrate>32000</AudioOnlyBitrate>
 +
    </LiveStreamInfo>
 +
    <LiveStreamInfo>
 +
        <Id>101</Id>
 +
        <Width>0</Width>
 +
        <Height>540</Height>
 +
        <Bitrate>600000</Bitrate>
 +
        <AudioBitrate>40000</AudioBitrate>
 +
        <SegmentSize>10</SegmentSize>
 +
        <MaxSegments>0</MaxSegments>
 +
        <StartSegment>0</StartSegment>
 +
        <CurrentSegment>0</CurrentSegment>
 +
        <SegmentCount>0</SegmentCount>
 +
        <PercentComplete>0</PercentComplete>
 +
        <Created>2011-12-03T06:58:55</Created>
 +
        <LastModified>2011-12-03T06:58:55</LastModified>
 +
        <RelativeURL>/Content/GetFile?StorageGroup=Streaming&amp;FileName=34736_20110926190000.mpg.0x540_600kV_40kA.m3u8</RelativeURL>
 +
        <FullURL>http://192.168.0.99:6544/Content/GetFile?StorageGroup=Streaming&amp;FileName=34736_20110926190000.mpg.0x540_600kV_40kA.m3u8</FullURL>
 +
        <StatusStr>Queued</StatusStr>
 +
        <StatusInt>0</StatusInt>
 +
        <StatusMessage></StatusMessage>
 +
        <SourceFile>/var/lib/mythtv/recordings/34736_20110926190000.mpg</SourceFile>
 +
        <SourceHost>Holmes</SourceHost>
 +
        <SourceWidth>0</SourceWidth>
 +
        <SourceHeight>0</SourceHeight>
 +
        <AudioOnlyBitrate>32000</AudioOnlyBitrate>
 +
    </LiveStreamInfo>
 +
<LiveStreamInfoList>
 +
</pre>
 +
 +
==GetFilteredLiveStreamList==
 +
 +
The <span style="color:LimeGreen">GetFilteredLiveStreamList</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">FileName</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The source filename, or a portion of a source filename, to narrow the list of returned LiveStreamInfos.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Content/GetFilteredLiveStreamList?FileName=30</code>
 +
 +
Example Return:
 +
 +
<pre>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<LiveStreamInfoList>
 +
    <LiveStreamInfo>
 +
        <Id>100</Id>
 +
        <Width>960</Width>
 +
        <Height>540</Height>
 +
        <Bitrate>600000</Bitrate>
 +
        <AudioBitrate>40000</AudioBitrate>
 +
        <SegmentSize>10</SegmentSize>
 +
        <MaxSegments>0</MaxSegments>
 +
        <StartSegment>0</StartSegment>
 +
        <CurrentSegment>10</CurrentSegment>
 +
        <SegmentCount>10</SegmentCount>
 +
        <PercentComplete>4</PercentComplete>
 +
        <Created>2011-12-03T06:58:55</Created>
 +
        <LastModified>2011-12-03T06:58:55</LastModified>
 +
        <RelativeURL>/Content/GetFile?StorageGroup=Streaming&amp;FileName=300.evo.0x540_600kV_40kA.m3u8</RelativeURL>
 +
        <FullURL>http://192.168.0.99:6544/Content/GetFile?StorageGroup=Streaming&amp;FileName=300.evo.0x540_600kV_40kA.m3u8</FullURL>
 +
        <StatusStr>Queued</StatusStr>
 +
        <StatusInt>0</StatusInt>
 +
        <StatusMessage></StatusMessage>
 +
        <SourceFile>/MythMedia/movies/300.evo</SourceFile>
 +
        <SourceHost>Holmes</SourceHost>
 +
        <SourceWidth>0</SourceWidth>
 +
        <SourceHeight>0</SourceHeight>
 +
        <AudioOnlyBitrate>32000</AudioOnlyBitrate>
 +
    </LiveStreamInfo>
 +
<LiveStreamInfoList>
 +
</pre>
 +
 +
==RemoveLiveStream==
 +
 +
The <span style="color:LimeGreen">RemoveLiveStream</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">Id</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The database id for the live stream.  This information is returned with the LiveStreamInfo from when adding a stream.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Content/RemoveLiveStream?Id=100</code>
 +
 +
Example Return:
 +
 +
<pre>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<bool>true</bool>
 +
</pre>
 +
 +
==StopLiveStream==
 +
 +
The <span style="color:LimeGreen">StopLiveStream</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">Id</Span> ('''Required''')
 +
:: '''Parameter Type:''' String
 +
:: The database id for the live stream.  This information is returned with the LiveStreamInfo from when adding a stream.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Content/StopLiveStream?Id=100</code>
 +
 +
Example Return:
 +
 +
<pre>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<bool>true</bool>
 +
</pre>
 +
 +
[[Category:Services_API]]

Latest revision as of 19:28, 10 September 2013

What is this?

See Services API


Content Service API List

API Command POST Required? Description
GetFile No Download a given file from a given storage group.
GetImageFile No Display, and optionally scale, an image file from a given storage group.
GetFileList No Get a list of files in a specified storage group.
GetRecordingArtwork No Display, and optionally scale, an image file of a given type (coverart, banner, fanart) for a given recording's inetref and season number.
GetRecordingArtworkList No Display a list of artwork available for a recording by start time and channel id.
GetProgramArtworkList No Display a list of artwork available for a program by inetref and season.
GetVideoArtwork No Display, and optionally scale, an image file of a given type (coverart, banner, fanart) for a given video's database id number.
GetAlbumArt No Display, and optionally scale, the album art for a given music file's database id number.
GetPreviewImage No Display, and optionally scale, an preview thumbnail for a given recording by timestamp, chanid and starttime.
GetRecording No Download a given recording file by chanid and starttime.
GetMusic No Download a given music file by database id.
GetVideo No Download a given video by database id.
GetHash No Perform a unique identifying hash on a given file in a given storage group.
DownloadFile Yes Instruct the backend to download a remote file into a storage group.
AddLiveStream No Start a HTTP Live Stream transcode for a given file and storage group.
AddRecordingLiveStream No Start a HTTP Live Stream transcode for a given ChanId and StartTime.
AddVideoLiveStream No Start a HTTP Live Stream transcode for a given Video ID.
GetLiveStream No Get the stream status data for a given HTTP Live Stream.
GetLiveStreamList No Get the stream status data for all available HTTP Live Streams.
GetFilteredLiveStreamList No Get the stream status data for all available HTTP Live Streams created from a given filename.
RemoveLiveStream No Stop transcoding a given HTTP Live Stream, and remove the transcoded files.
StopLiveStream No Stop transcoding a given HTTP Live Stream, leaving the transcoded files intact.

Content APIs

GetFile

The GetFile API takes the following arguments:

StorageGroup (Required)
Parameter Type: String
The Storage Group name in which you wish to search for the file.
FileName (Required)
Parameter Type: String
The filename (and relative path if necessary) of the file you wish to receive.

Example Query:

http://BackendServerIP:6544/Content/GetFile?StorageGroup=Recordings&FileName=244001_20110922210000.mpg

Example Return:

The return for this command is a binary file which will be interpreted by your browser and downloaded or displayed as appropriate.

GetImageFile

The GetImageFile API takes the following arguments:

StorageGroup (Required)
Parameter Type: String
The Storage Group name in which you wish to search for the file.
FileName (Required)
Parameter Type: String
The filename (and relative path if necessary) of the file you wish to receive.
Width (Optional)
Parameter Type: Integer
The scaled width to return the image. To preserve proper aspect, you may want to specify only one of width or height.
Height (Optional)
Parameter Type: Integer
The scaled height to return the image. To preserve proper aspect, you may want to specify only one of width or height.

Example Query:

http://BackendServerIP:6544/Content/GetImageFile?StorageGroup=Fanart&FileName=9461_fanart.jpg&Width=200

Example Return:

The return for this command is a binary file which will be interpreted by your browser and downloaded or displayed as appropriate.

GetFileList

The GetFileList API takes the following arguments:

StorageGroup (Required)
Parameter Type: String
The Storage Group name for which you wish to see a list of files.

Example Query:

http://BackendServerIP:6544/Content/GetFileList?StorageGroup=Fanart

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<QStringList>
    <String>10020_fanart.jpg</String>
    <String>10074_fanart.jpg</String>
    <String>10126_fanart.jpg</String>
    <String>10138_fanart.jpg</String>
    <String>10139_fanart.jpg</String>
    <String>10140_fanart.jpg</String>
    <String>10189_fanart.jpg</String>
    <String>10191_fanart.jpg</String>
    <String>10192_fanart.jpg</String>
    <String>10196_fanart.jpg</String>
</QStringList>

GetRecordingArtwork

The GetRecordingArtwork API takes the following arguments:

Inetref (Required)
Parameter Type: String
The inetref for the recording you are looking up. This information is available in the Program construct, which can be queried in the DVR Service.
Type (Optional)
Parameter Type: String
The type of artwork you wish to download. Valid types are coverart, fanart, and banner. If no type is present, the query will fall back to coverart.
Season (Optional)
Parameter Type: Integer
The season number of the artwork you wish to receive. If no season number is present, the query will fall back to the latest available season.
Width (Optional)
Parameter Type: Integer
The scaled width to return the image. To preserve proper aspect, you may want to specify only one of width or height.
Height (Optional)
Parameter Type: Integer
The scaled height to return the image. To preserve proper aspect, you may want to specify only one of width or height.

Example Query:

http://BackendServerIP:6544/Content/GetRecordingArtwork?Inetref=80552&Type=fanart&Season=2

Example Return:

The return for this command is a binary file which will be interpreted by your browser and downloaded or displayed as appropriate.

GetRecordingArtworkList

The GetRecordingArtwork API takes the following arguments:

ChanId (Required)
Parameter Type: Integer
The database channel id for the recording.
StartTime (Required)
Parameter Type: String
The recording start time for the item. This should be in MySQL ISO format, eg: 2011-08-29 18:59:00. You can replace the space with %20 or T.

Example Query:

http://BackendServerIP:6544/Content/GetRecordingArtworkList?ChanId=3123&StartTime=2011-01-01T09:00:00

Example Return:

<ArtworkInfoList version="1.0" serializerVersion="1.1">
    <ArtworkInfos>
        <ArtworkInfo>
            <URL>/Content/GetRecordingArtwork?InetRef=210841&Season=1&Type=coverart</URL>
            <FileName>myth://Coverart@192.168.0.99:6543/Alphas Season 1_coverart.jpg</FileName>
            <StorageGroup>Coverart</StorageGroup>
            <Type>coverart</Type>
        </ArtworkInfo>
        <ArtworkInfo>
            <URL>/Content/GetRecordingArtwork?InetRef=210841&Season=1&Type=fanart</URL>
            <FileName>myth://Fanart@192.168.0.99:6543/Alphas Season 1_fanart.jpg</FileName>
            <StorageGroup>Fanart</StorageGroup>
            <Type>fanart</Type>
        </ArtworkInfo>
        <ArtworkInfo>
            <URL>/Content/GetRecordingArtwork?InetRef=210841&Season=1&Type=banner</URL>
            <FileName>myth://Banners@192.168.0.99:6543/Alphas Season 1_banner.jpg</FileName>
            <StorageGroup>Banners</StorageGroup>
            <Type>banner</Type>
        </ArtworkInfo>
    </ArtworkInfos>
</ArtworkInfoList>

GetProgramArtworkList

The GetRecordingArtwork API takes the following arguments:

Inetref (Required)
Parameter Type: String
The inetref for the recording you are looking up. This information is available in the Program construct, which can be queried in the DVR Service.
Season (Optional)
Parameter Type: Integer
The season number of the artwork you wish to receive. If no season number is present, the query will fall back to the latest available season.

Example Query:

http://BackendServerIP:6544/Content/GetRecordingArtwork?Inetref=80552&Type=fanart&Season=2

Example Return:

<ArtworkInfoList version="1.0" serializerVersion="1.1">
    <ArtworkInfos>
        <ArtworkInfo>
            <URL>/Content/GetRecordingArtwork?InetRef=210841&Season=1&Type=coverart</URL>
            <FileName>myth://Coverart@192.168.0.99:6543/Alphas Season 1_coverart.jpg</FileName>
            <StorageGroup>Coverart</StorageGroup>
            <Type>coverart</Type>
        </ArtworkInfo>
        <ArtworkInfo>
            <URL>/Content/GetRecordingArtwork?InetRef=210841&Season=1&Type=fanart</URL>
            <FileName>myth://Fanart@192.168.0.99:6543/Alphas Season 1_fanart.jpg</FileName>
            <StorageGroup>Fanart</StorageGroup>
            <Type>fanart</Type>
        </ArtworkInfo>
        <ArtworkInfo>
            <URL>/Content/GetRecordingArtwork?InetRef=210841&Season=1&Type=banner</URL>
            <FileName>myth://Banners@192.168.0.99:6543/Alphas Season 1_banner.jpg</FileName>
            <StorageGroup>Banners</StorageGroup>
            <Type>banner</Type>
        </ArtworkInfo>
    </ArtworkInfos>
</ArtworkInfoList>

GetVideoArtwork

The GetVideoArtwork API takes the following arguments:

Id (Required)
Parameter Type: String
The database id for the video you are looking up. This information is available in the VideoMetadataInfo construct, which can be queried in the Video Service.
Type (Optional)
Parameter Type: String
The type of artwork you wish to download. Valid types are coverart, fanart, and banner. If no type is present, the query will fall back to coverart.
Width (Optional)
Parameter Type: Integer
The scaled width to return the image. To preserve proper aspect, you may want to specify only one of width or height.
Height (Optional)
Parameter Type: Integer
The scaled height to return the image. To preserve proper aspect, you may want to specify only one of width or height.

Example Query:

http://BackendServerIP:6544/Content/GetVideoArtwork?Id=100&Type=fanart

Example Return:

The return for this command is a binary file which will be interpreted by your browser and downloaded or displayed as appropriate.

GetAlbumArt

The GetAlbumArt API takes the following arguments:

Id (Required)
Parameter Type: String
The database id for the track you are looking up. For an album, use the id of the first track.
Width (Optional)
Parameter Type: Integer
The scaled width to return the image. To preserve proper aspect, you may want to specify only one of width or height.
Height (Optional)
Parameter Type: Integer
The scaled height to return the image. To preserve proper aspect, you may want to specify only one of width or height.

Example Query:

http://BackendServerIP:6544/Content/GetAlbumArt?Id=585

Example Return:

The return for this command is a binary file which will be interpreted by your browser and downloaded or displayed as appropriate.

GetPreviewImage

The GetPreviewImage API takes the following arguments:

ChanId (Required)
Parameter Type: Integer
The database channel id for the recording.
StartTime (Required)
Parameter Type: String
The recording start time for the item. This should be in MySQL ISO format, eg: 2011-08-29 18:59:00. You can replace the space with %20 or T.
Width (Optional)
Parameter Type: Integer
The scaled width to return the image. To preserve proper aspect, you may want to specify only one of width or height.
Height (Optional)
Parameter Type: Integer
The scaled height to return the image. To preserve proper aspect, you may want to specify only one of width or height.
SecsIn (Optional)
Parameter Type: Integer
The number of seconds into the recording to fast forward before generating a preview image.

Example Query:

http://BackendServerIP:6544/Content/GetPreviewImage?ChanId=34736&StartTime=2011-08-29T18:59:00

Example Return:

The return for this command is a binary file which will be interpreted by your browser and downloaded or displayed as appropriate.

GetRecording

The GetRecording API takes the following arguments:

ChanId (Required)
Parameter Type: Integer
The database channel id for the recording.
StartTime (Required)
Parameter Type: String
The recording start time for the item. This should be in MySQL ISO format, eg: 2011-08-29 18:59:00. You can replace the space with %20 or T.

Example Query:

http://BackendServerIP:6544/Content/GetRecording?ChanId=34736&StartTime=2011-08-29T18:59:00

Example Return:

The return for this command is a binary file which will be interpreted by your browser and downloaded or displayed as appropriate.

GetVideo

The GetVideo API takes the following arguments:

Id (Required)
Parameter Type: String
The database id for the video file.

Example Query:

http://BackendServerIP:6544/Content/GetVideo?Id=100

Example Return:

The return for this command is a binary file which will be interpreted by your browser and downloaded or displayed as appropriate.

GetMusic

The GetMusic API takes the following arguments:

Id (Required)
Parameter Type: String
The database id for the music file.

Example Query:

http://BackendServerIP:6544/Content/GetMusic?Id=100

Example Return:

The return for this command is a binary file which will be interpreted by your browser and downloaded or displayed as appropriate.

GetHash

The GetHash API takes the following arguments:

StorageGroup (Required)
Parameter Type: String
The Storage Group name in which you wish to search for the file.
FileName (Required)
Parameter Type: String
The filename (and relative path if necessary) of the file you wish to hash.

Example Query:

http://BackendServerIP:6544/Content/GetHash?StorageGroup=Recordings&FileName=244001_20110922210000.mpg

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<QString>c80767b59e4d96d2</QString>

DownloadFile

The DownloadFile API takes the following arguments:

StorageGroup (Required)
Parameter Type: String
The Storage Group name to which you wish to download the file.
URL (Required)
Parameter Type: String
The URL that you wish to download.

Example Query:

http://BackendServerIP:6544/Content/DownloadFile?StorageGroup=Videos&URL=http://www.mythtv.org/index.html

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<bool>true</bool>

AddLiveStream

The AddLiveStream API takes the following arguments:

FileName (Required)
Parameter Type: String
The Filename you wish to transcode.
StorageGroup (Optional)
Parameter Type: String
The Storage Group name which contains the file to be transcoded.
MaxSegments (Optional)
Parameter Type: Integer
The number of 10-second segments to keep at any given time. When this number of segments is reached, each new segment results in the deletion of the oldest one from the playlist and filesystem. Not setting this value, or a value of 0, will result in all segments being kept.
Width (Optional)
Parameter Type: Integer
The width, in pixels, of the output stream. If only one of Height and Width are set, the other will be set automatically to preserve the aspect.
Height (Optional)
Parameter Type: Integer
The height, in pixels, of the output stream. If only one of Height and Width are set, the other will be set automatically to preserve the aspect.
Bitrate (Optional)
Parameter Type: Integer
The video bitrate, in bits per second, of the output stream. The default bitrate is 800000 b/s (800 Kb/s).
AudioBitrate (Optional)
Parameter Type: Integer
The audio bitrate, in bits per second, of the output stream. The default audio bitrate is 64000 b/s (64 Kb/s).
SampleRate (Optional)
Parameter Type: Integer
The audio sampling rate, in Hz, of the output stream. The default audio sampling rate is 44100 Hz (44.1 Khz/s).

Example Query:

http://BackendServerIP:6544/Content/AddLiveStream?FileName=34736_20110926190000.mpg&StorageGroup=Default&Height=540&Width=0&Bitrate=600000&AudioBitrate=40000&SampleRate=22050

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<LiveStreamInfo version="1.0" serializerVersion="1.1">
    <Id>100</Id>
    <Width>0</Width>
    <Height>540</Height>
    <Bitrate>600000</Bitrate>
    <AudioBitrate>40000</AudioBitrate>
    <SegmentSize>10</SegmentSize>
    <MaxSegments>0</MaxSegments>
    <StartSegment>0</StartSegment>
    <CurrentSegment>0</CurrentSegment>
    <SegmentCount>0</SegmentCount>
    <PercentComplete>0</PercentComplete>
    <Created>2011-12-03T06:58:55</Created>
    <LastModified>2011-12-03T06:58:55</LastModified>
    <RelativeURL>/Content/GetFile?StorageGroup=Streaming&FileName=34736_20110926190000.mpg.0x540_600kV_40kA.m3u8</RelativeURL>
    <FullURL>http://192.168.0.99:6544/Content/GetFile?StorageGroup=Streaming&FileName=34736_20110926190000.mpg.0x540_600kV_40kA.m3u8</FullURL>
    <StatusStr>Queued</StatusStr>
    <StatusInt>0</StatusInt>
    <StatusMessage></StatusMessage>
    <SourceFile>/var/lib/mythtv/recordings/34736_20110926190000.mpg</SourceFile>
    <SourceHost>Holmes</SourceHost>
    <SourceWidth>0</SourceWidth>
    <SourceHeight>0</SourceHeight>
    <AudioOnlyBitrate>32000</AudioOnlyBitrate>
</LiveStreamInfo>

AddRecordingLiveStream

The AddRecordingLiveStream API takes the following arguments:

ChanId (Required)
Parameter Type: Integer
The database channel id for the recording.
StartTime (Required)
Parameter Type: String
The recording start time for the item. This should be in MySQL ISO format, eg: 2011-08-29 18:59:00. You can replace the space with %20 or T.
MaxSegments (Optional)
Parameter Type: Integer
The number of 10-second segments to keep at any given time. When this number of segments is reached, each new segment results in the deletion of the oldest one from the playlist and filesystem. Not setting this value, or a value of 0, will result in all segments being kept.
Width (Optional)
Parameter Type: Integer
The width, in pixels, of the output stream. If only one of Height and Width are set, the other will be set automatically to preserve the aspect.
Height (Optional)
Parameter Type: Integer
The height, in pixels, of the output stream. If only one of Height and Width are set, the other will be set automatically to preserve the aspect.
Bitrate (Optional)
Parameter Type: Integer
The video bitrate, in bits per second, of the output stream. The default bitrate is 800000 b/s (800 Kb/s).
AudioBitrate (Optional)
Parameter Type: Integer
The audio bitrate, in bits per second, of the output stream. The default audio bitrate is 64000 b/s (64 Kb/s).
SampleRate (Optional)
Parameter Type: Integer
The audio sampling rate, in Hz, of the output stream. The default audio sampling rate is 44100 Hz (44.1 Khz/s).

Example Query:

http://BackendServerIP:6544/Content/AddRecordingLiveStream?ChanId=34736&StartTime=2011-09-26T19:00:00&Height=540&Width=0&Bitrate=600000&AudioBitrate=40000&SampleRate=22050

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<LiveStreamInfo version="1.0" serializerVersion="1.1">
    <Id>100</Id>
    <Width>0</Width>
    <Height>540</Height>
    <Bitrate>600000</Bitrate>
    <AudioBitrate>40000</AudioBitrate>
    <SegmentSize>10</SegmentSize>
    <MaxSegments>0</MaxSegments>
    <StartSegment>0</StartSegment>
    <CurrentSegment>0</CurrentSegment>
    <SegmentCount>0</SegmentCount>
    <PercentComplete>0</PercentComplete>
    <Created>2011-12-03T06:58:55</Created>
    <LastModified>2011-12-03T06:58:55</LastModified>
    <RelativeURL>/Content/GetFile?StorageGroup=Streaming&FileName=34736_20110926190000.mpg.0x540_600kV_40kA.m3u8</RelativeURL>
    <FullURL>http://192.168.0.99:6544/Content/GetFile?StorageGroup=Streaming&FileName=34736_20110926190000.mpg.0x540_600kV_40kA.m3u8</FullURL>
    <StatusStr>Queued</StatusStr>
    <StatusInt>0</StatusInt>
    <StatusMessage></StatusMessage>
    <SourceFile>/var/lib/mythtv/recordings/34736_20110926190000.mpg</SourceFile>
    <SourceHost>Holmes</SourceHost>
    <SourceWidth>0</SourceWidth>
    <SourceHeight>0</SourceHeight>
    <AudioOnlyBitrate>32000</AudioOnlyBitrate>
</LiveStreamInfo>

AddVideoLiveStream

The AddVideoLiveStream API takes the following arguments:

Id (Required)
Parameter Type: String
The database id for the video you are streaming. This information is available in the VideoMetadataInfo construct, which can be queried in the Video Service.
MaxSegments (Optional)
Parameter Type: Integer
The number of 10-second segments to keep at any given time. When this number of segments is reached, each new segment results in the deletion of the oldest one from the playlist and filesystem. Not setting this value, or a value of 0, will result in all segments being kept.
Width (Optional)
Parameter Type: Integer
The width, in pixels, of the output stream. If only one of Height and Width are set, the other will be set automatically to preserve the aspect.
Height (Optional)
Parameter Type: Integer
The height, in pixels, of the output stream. If only one of Height and Width are set, the other will be set automatically to preserve the aspect.
Bitrate (Optional)
Parameter Type: Integer
The video bitrate, in bits per second, of the output stream. The default bitrate is 800000 b/s (800 Kb/s).
AudioBitrate (Optional)
Parameter Type: Integer
The audio bitrate, in bits per second, of the output stream. The default audio bitrate is 64000 b/s (64 Kb/s).
SampleRate (Optional)
Parameter Type: Integer
The audio sampling rate, in Hz, of the output stream. The default audio sampling rate is 44100 Hz (44.1 Khz/s).

Example Query:

http://BackendServerIP:6544/Content/AddVideoLiveStream?Id=75&Height=540&Width=0&Bitrate=600000&AudioBitrate=40000&SampleRate=22050

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<LiveStreamInfo version="1.0" serializerVersion="1.1">
    <Id>100</Id>
    <Width>0</Width>
    <Height>540</Height>
    <Bitrate>600000</Bitrate>
    <AudioBitrate>40000</AudioBitrate>
    <SegmentSize>10</SegmentSize>
    <MaxSegments>0</MaxSegments>
    <StartSegment>0</StartSegment>
    <CurrentSegment>0</CurrentSegment>
    <SegmentCount>0</SegmentCount>
    <PercentComplete>0</PercentComplete>
    <Created>2011-12-03T06:58:55</Created>
    <LastModified>2011-12-03T06:58:55</LastModified>
    <RelativeURL>/Content/GetFile?StorageGroup=Streaming&FileName=300.evo.0x540_600kV_40kA.m3u8</RelativeURL>
    <FullURL>http://192.168.0.99:6544/Content/GetFile?StorageGroup=Streaming&FileName=300.evo.0x540_600kV_40kA.m3u8</FullURL>
    <StatusStr>Queued</StatusStr>
    <StatusInt>0</StatusInt>
    <StatusMessage></StatusMessage>
    <SourceFile>/MythMedia/movies/300.evo</SourceFile>
    <SourceHost>Holmes</SourceHost>
    <SourceWidth>0</SourceWidth>
    <SourceHeight>0</SourceHeight>
    <AudioOnlyBitrate>32000</AudioOnlyBitrate>
</LiveStreamInfo>

GetLiveStream

The GetLiveStream API takes the following arguments:

Id (Required)
Parameter Type: String
The database id for the live stream. This information is returned with the LiveStreamInfo from when adding a stream.

Example Query:

http://BackendServerIP:6544/Content/GetLiveStream?Id=100

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<LiveStreamInfo version="1.0" serializerVersion="1.1">
    <Id>100</Id>
    <Width>960</Width>
    <Height>540</Height>
    <Bitrate>600000</Bitrate>
    <AudioBitrate>40000</AudioBitrate>
    <SegmentSize>10</SegmentSize>
    <MaxSegments>0</MaxSegments>
    <StartSegment>0</StartSegment>
    <CurrentSegment>10</CurrentSegment>
    <SegmentCount>10</SegmentCount>
    <PercentComplete>4</PercentComplete>
    <Created>2011-12-03T06:58:55</Created>
    <LastModified>2011-12-03T06:58:55</LastModified>
    <RelativeURL>/Content/GetFile?StorageGroup=Streaming&FileName=300.evo.0x540_600kV_40kA.m3u8</RelativeURL>
    <FullURL>http://192.168.0.99:6544/Content/GetFile?StorageGroup=Streaming&FileName=300.evo.0x540_600kV_40kA.m3u8</FullURL>
    <StatusStr>Queued</StatusStr>
    <StatusInt>0</StatusInt>
    <StatusMessage></StatusMessage>
    <SourceFile>/MythMedia/movies/300.evo</SourceFile>
    <SourceHost>Holmes</SourceHost>
    <SourceWidth>0</SourceWidth>
    <SourceHeight>0</SourceHeight>
    <AudioOnlyBitrate>32000</AudioOnlyBitrate>
</LiveStreamInfo>

GetLiveStreamList

The GetLiveStreamList API takes no arguments.

Example Query:

http://BackendServerIP:6544/Content/GetLiveStreamList

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<LiveStreamInfoList>
    <LiveStreamInfo>
        <Id>100</Id>
        <Width>960</Width>
        <Height>540</Height>
        <Bitrate>600000</Bitrate>
        <AudioBitrate>40000</AudioBitrate>
        <SegmentSize>10</SegmentSize>
        <MaxSegments>0</MaxSegments>
        <StartSegment>0</StartSegment>
        <CurrentSegment>10</CurrentSegment>
        <SegmentCount>10</SegmentCount>
        <PercentComplete>4</PercentComplete>
        <Created>2011-12-03T06:58:55</Created>
        <LastModified>2011-12-03T06:58:55</LastModified>
        <RelativeURL>/Content/GetFile?StorageGroup=Streaming&FileName=300.evo.0x540_600kV_40kA.m3u8</RelativeURL>
        <FullURL>http://192.168.0.99:6544/Content/GetFile?StorageGroup=Streaming&FileName=300.evo.0x540_600kV_40kA.m3u8</FullURL>
        <StatusStr>Queued</StatusStr>
        <StatusInt>0</StatusInt>
        <StatusMessage></StatusMessage>
        <SourceFile>/MythMedia/movies/300.evo</SourceFile>
        <SourceHost>Holmes</SourceHost>
        <SourceWidth>0</SourceWidth>
        <SourceHeight>0</SourceHeight>
        <AudioOnlyBitrate>32000</AudioOnlyBitrate>
    </LiveStreamInfo>
    <LiveStreamInfo>
        <Id>101</Id>
        <Width>0</Width>
        <Height>540</Height>
        <Bitrate>600000</Bitrate>
        <AudioBitrate>40000</AudioBitrate>
        <SegmentSize>10</SegmentSize>
        <MaxSegments>0</MaxSegments>
        <StartSegment>0</StartSegment>
        <CurrentSegment>0</CurrentSegment>
        <SegmentCount>0</SegmentCount>
        <PercentComplete>0</PercentComplete>
        <Created>2011-12-03T06:58:55</Created>
        <LastModified>2011-12-03T06:58:55</LastModified>
        <RelativeURL>/Content/GetFile?StorageGroup=Streaming&FileName=34736_20110926190000.mpg.0x540_600kV_40kA.m3u8</RelativeURL>
        <FullURL>http://192.168.0.99:6544/Content/GetFile?StorageGroup=Streaming&FileName=34736_20110926190000.mpg.0x540_600kV_40kA.m3u8</FullURL>
        <StatusStr>Queued</StatusStr>
        <StatusInt>0</StatusInt>
        <StatusMessage></StatusMessage>
        <SourceFile>/var/lib/mythtv/recordings/34736_20110926190000.mpg</SourceFile>
        <SourceHost>Holmes</SourceHost>
        <SourceWidth>0</SourceWidth>
        <SourceHeight>0</SourceHeight>
        <AudioOnlyBitrate>32000</AudioOnlyBitrate>
    </LiveStreamInfo>
<LiveStreamInfoList>

GetFilteredLiveStreamList

The GetFilteredLiveStreamList API takes the following arguments:

FileName (Required)
Parameter Type: String
The source filename, or a portion of a source filename, to narrow the list of returned LiveStreamInfos.

Example Query:

http://BackendServerIP:6544/Content/GetFilteredLiveStreamList?FileName=30

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<LiveStreamInfoList>
    <LiveStreamInfo>
        <Id>100</Id>
        <Width>960</Width>
        <Height>540</Height>
        <Bitrate>600000</Bitrate>
        <AudioBitrate>40000</AudioBitrate>
        <SegmentSize>10</SegmentSize>
        <MaxSegments>0</MaxSegments>
        <StartSegment>0</StartSegment>
        <CurrentSegment>10</CurrentSegment>
        <SegmentCount>10</SegmentCount>
        <PercentComplete>4</PercentComplete>
        <Created>2011-12-03T06:58:55</Created>
        <LastModified>2011-12-03T06:58:55</LastModified>
        <RelativeURL>/Content/GetFile?StorageGroup=Streaming&FileName=300.evo.0x540_600kV_40kA.m3u8</RelativeURL>
        <FullURL>http://192.168.0.99:6544/Content/GetFile?StorageGroup=Streaming&FileName=300.evo.0x540_600kV_40kA.m3u8</FullURL>
        <StatusStr>Queued</StatusStr>
        <StatusInt>0</StatusInt>
        <StatusMessage></StatusMessage>
        <SourceFile>/MythMedia/movies/300.evo</SourceFile>
        <SourceHost>Holmes</SourceHost>
        <SourceWidth>0</SourceWidth>
        <SourceHeight>0</SourceHeight>
        <AudioOnlyBitrate>32000</AudioOnlyBitrate>
    </LiveStreamInfo>
<LiveStreamInfoList>

RemoveLiveStream

The RemoveLiveStream API takes the following arguments:

Id (Required)
Parameter Type: String
The database id for the live stream. This information is returned with the LiveStreamInfo from when adding a stream.

Example Query:

http://BackendServerIP:6544/Content/RemoveLiveStream?Id=100

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<bool>true</bool>

StopLiveStream

The StopLiveStream API takes the following arguments:

Id (Required)
Parameter Type: String
The database id for the live stream. This information is returned with the LiveStreamInfo from when adding a stream.

Example Query:

http://BackendServerIP:6544/Content/StopLiveStream?Id=100

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<bool>true</bool>