Capture Service

From MythTV Official Wiki
Revision as of 11:45, 19 July 2013 by Pvr4me (talk | contribs) (Intro)

Jump to: navigation, search

What is this?

See Services API


Capture Service API List

API Command POST Required? Description
GetCaptureCardList No Get a list of configured capture devices globally, on a certain host, or of a certain type.
GetCaptureCard No Get info on a specific capture device, by card id.
AddCaptureCard Yes Add a brand new capture device to the database.
UpdateCaptureCard Yes Change a specific setting value for a specific capture device.
RemoveCaptureCard Yes Remove a particular capture device from the database, by card id.
AddCardInput Yes Add a new card input to the database, and associate it with a video listings source.
UpdateCardInput Yes Change a specific setting value for a specific card input id.
RemoveCardInput Yes Remove a particular card input from the database, by card input id.

Capture APIs

GetCaptureCardList

The GetCaptureCardList API takes the following arguments:

HostName (Optional)
Parameter Type: String
The backend host name you wish to see a capture card list for.
CardType (Optional)
Parameter Type: String
Filter results by a particular capture card type (HDHOMERUN, DEMO, etc.)

Example Query:

http://BackendServerIP:6544/Capture/GetCaptureCardList?HostName=localhost&CardType=HDHOMERUN

Example Return:

<CaptureCardList version="1.0" serializerVersion="1.1">
    <CaptureCards>
        <CaptureCard>
            <CardId>3</CardId>
            <VideoDevice>13100674-0</VideoDevice>
            <AudioDevice></AudioDevice>
            <VBIDevice></VBIDevice>
            <CardType>HDHOMERUN</CardType>
            <DefaultInput>MPEG2TS</DefaultInput>
            <AudioRateLimit>0</AudioRateLimit>
            <HostName>localhost</HostName>
            <DVBSWFilter>0</DVBSWFilter>
            <DVBSatType>0</DVBSatType>
            <DVBWaitForSeqStart>true</DVBWaitForSeqStart>
            <SkipBTAudio>false</SkipBTAudio>
            <DVBOnDemand>false</DVBOnDemand>
            <DVBDiSEqCType>0</DVBDiSEqCType>
            <FirewireSpeed>0</FirewireSpeed>
            <FirewireModel></FirewireModel>
            <FirewireConnection>0</FirewireConnection>
            <SignalTimeout>1000</SignalTimeout>
            <ChannelTimeout>3000</ChannelTimeout>
            <DVBTuningDelay>0</DVBTuningDelay>
            <Contrast>0</Contrast>
            <Brightness>0</Brightness>
            <Colour>0</Colour>
            <Hue>0</Hue>
            <DiSEqCId>0</DiSEqCId>
            <DVBEITScan>true</DVBEITScan>
        </CaptureCard>
    </CaptureCards>
</CaptureCardList>

GetCaptureCard

The GetCaptureCard API takes the following arguments:

CardId (Required)
Parameter Type: Integer
The database card ID for the device you want informaion for.

Example Query:

http://BackendServerIP:6544/Capture/GetCaptureCard?CardId=3

Example Return:

<CaptureCard>
    <CardId>3</CardId>
    <VideoDevice>13100674-0</VideoDevice>
    <AudioDevice></AudioDevice>
    <VBIDevice></VBIDevice> 
    <CardType>HDHOMERUN</CardType>
    <DefaultInput>MPEG2TS</DefaultInput>
    <AudioRateLimit>0</AudioRateLimit>
    <HostName>localhost</HostName>
    <DVBSWFilter>0</DVBSWFilter>
    <DVBSatType>0</DVBSatType>
    <DVBWaitForSeqStart>true</DVBWaitForSeqStart>
    <SkipBTAudio>false</SkipBTAudio>
    <DVBOnDemand>false</DVBOnDemand>
    <DVBDiSEqCType>0</DVBDiSEqCType>
    <FirewireSpeed>0</FirewireSpeed>
    <FirewireModel></FirewireModel>
    <FirewireConnection>0</FirewireConnection>
    <SignalTimeout>1000</SignalTimeout>
    <ChannelTimeout>3000</ChannelTimeout>
    <DVBTuningDelay>0</DVBTuningDelay>
    <Contrast>0</Contrast> 
    <Brightness>0</Brightness>
    <Colour>0</Colour>
    <Hue>0</Hue>
    <DiSEqCId>0</DiSEqCId>
    <DVBEITScan>true</DVBEITScan>
</CaptureCard>

AddCaptureCard

The AddCaptureCard API takes the following arguments:

VideoDevice (Required)
Parameter Type: String
The device path (/dev/video1) or device string (12345678-0) used to address the device.
CardType (Required)
Parameter Type: String
The capture card type being created (HDHOMERUN, DEMO, etc.).
DefaultInput (Required)
Parameter Type: String
The default physical input for the device being created (Component, MPEG2TS, Television, etc.).
HostName (Required)
Parameter Type: String
The backend hostname which houses this new capture device.
AudioDevice (Optional)
Parameter Type: String
The device path (/dev/dsp) or device string (ALSA:input) used to address the audio capture device. Usually only useful for framegrabber cards.
VBIDevice (Optional)
Parameter Type: String
The device path (/dev/vbi1) used for VBI/CC capture. Usually only useful for a limited number of analog capture devices.
AudioRateLimit (Optional)
Parameter Type: Integer
The maximum audio sampling rate for captured audio. Usually only useful for framegrabber cards.
SkipBTAudio (Optional)
Parameter Type: Boolean
Used only for quirky BT878 DVB cards to prevent the backend adjusting their volume.
DVBSWFilter (Optional)
Parameter Type: Integer
No longer used. Left as a parameter for legacy purposes.
DVBSatType (Optional)
Parameter Type: Integer
No longer used. Left as a parameter for legacy purposes.
DVBWaitForSeqStart (Optional)
Parameter Type: Boolean
Wait for the SEQ start header. Only useful for DVB capture devices.
DVBOnDemand (Optional)
Parameter Type: Boolean
Only open the capture device when used for recording or EIT. Allow other programs to access the device when not actively used. Enabling can cause recording issues if multiple applications contend for the same device.
DVBDiSEqCType (Optional)
Parameter Type: Integer
No longer used. Left as a parameter for legacy purposes.
FirewireModel (Optional)
Parameter Type: String
The model of the firewire device, as defined in firewiredevices.cpp. Used to determine which AVC command set to use when changing channels and capturing.
FirewireSpeed (Optional)
Parameter Type: Integer
Firewire speed to use. For firewire capture devices.
FirewireConnection (Optional)
Parameter Type: Integer
The Firewire communication method to use. For firewire capture devices.
SignalTimeout (Optional)
Parameter Type: Integer
Number of milliseconds to wait upon tuning a frequency before signal is found. If this timer expires, tuning has failed.
ChannelTimeout (Optional)
Parameter Type: Integer
Number of milliseconds to wait upon finding signal before the desired channel is found. If this timer expires, tuning has failed.
DVBTuningDelay (Optional)
Parameter Type: Integer
Workaround for quirky capture devices. Introduce a delay to the tuning process in milliseconds.
Contrast (Optional)
Parameter Type: Integer
Used to adjust picture attributes on capture for framegrabber capture devices.
Brightness (Optional)
Parameter Type: Integer
Used to adjust picture attributes on capture for framegrabber capture devices.
Colour (Optional)
Parameter Type: Integer
Used to adjust picture attributes on capture for framegrabber capture devices.
Hue (Optional)
Parameter Type: Integer
Used to adjust picture attributes on capture for framegrabber capture devices.
DiSEqCId (Optional)
Parameter Type: Integer
Cross reference this device with a DiSEqC tree found in the diseqc_config table.
DVBEITScan (Optional)
Parameter Type: Boolean
Permit this device to scan for EIT programming data (digital capture devices only).

Example Query:

http://BackendServerIP:6544//Capture/AddCaptureCard?VideoDevice=12345678-0&CardType=HDHOMERUN&DefaultInput=MPEG2TS&HostName=localhost&SignalTimeout=3000&ChannelTimeout=10000&DVBEITScan=0

Example Return:

Integer return. Returns the cardid of the card if successfully created, -1 if card creation failed.

<int>7</int>

UpdateCaptureCard

The UpdateCaptureCard API takes the following arguments:

CardId (Required)
Parameter Type: Integer
The cardid you wish to modify.
Setting (Required)
Parameter Type: String
The database column you wish to modify for the card.
Value (Required)
Parameter Type: String or Integer
The new value for the database field.

Example Query:

http://BackendServerIP:6544/Capture/UpdateCaptureCard?CardId=1&Setting=audiodevice&Value=ALSA:input

Example Return:

Boolean return. Returns true if the value was modified, false if the change failed.

<bool>true</bool>

RemoveCaptureCard

The RemoveCaptureCard API takes the following arguments:

CardId (Required)
Parameter Type: Integer
The database card ID for the device you are deleting.

Example Query:

http://BackendServerIP:6544/Capture/RemoveCaptureCard?CardId=3

Example Return:

Boolean return. Returns true if the device was removed from the database, false if the delete failed.

<bool>true</bool>

AddCardInput

Each configured capture card needs at least one card input to tie a video source and a capture device together.

The AddCardInput API takes the following arguments:

CardId (Required)
Parameter Type: Integer
The database card number this input belongs to.
SourceId (Required)
Parameter Type: Integer
The database video source number bound to this card input.
HostName (Required)
Parameter Type: String
The backend hostname where this card input is located.
InputName (Required)
Parameter Type: String
The text name of the input (Component, MPEG2TS, Television, etc.)
ExternalCommand (Optional)
Parameter Type: String
The path and command for an external channel changing script.
ChangerDevice (Optional)
Parameter Type: String
If "Internal" is used as the channel change script, the internal firewire changer will be used, and a ChangerDevice is required. This is the GUID for the attached Firewire set top box.
ChangerModel (Optional)
Parameter Type: String
If "Internal" is used as the channel change script, the internal firewire changer will be used, and a ChangerModel is required, as defined in firewiredevice.cpp.
TuneChan (Optional)
Parameter Type: String
For coaxial inputs, it may be necessary to set the tuned channel to 3 or 4, and rely on the external device to perform tuning.
StartChan (Optional)
Parameter Type: String
Tune to this channel the next time the backend starts. This value is updated when the user uses LiveTV.
DisplayName (Optional)
Parameter Type: String
The "User Friendly" name for a card input, like "My HD-PVR" or "HDHomeRun Prime 1".
DishnetEIT (Optional)
Parameter Type: Boolean
Enable the use of long-term EIT data if using a DVB-S tuner and Dish Network.
RecPriority (Optional)
Parameter Type: Integer
A recording priority modification for this card input.
Quicktune (Optional)
Parameter Type: Integer
Use quick tuning (on devices which accept it). 0 = never, 1 = Live TV Only, 2 = Always

Example Query:

http://BackendServerIP:6544/Capture/AddCardInput?CardId=1&SourceId=1&InputName=MPEG2TS&DisplayName=My%20Source

Example Return:

Integer return. Returns the cardinputid if successfully created, -1 if card creation failed.

<int>1</int>

UpdateCardInput

The UpdateCardInput API takes the following arguments:

CardInputId (Required)
Parameter Type: Integer
The card input id you wish to modify.
Setting (Required)
Parameter Type: String
The database column you wish to modify for the card input.
Value (Required)
Parameter Type: String or Integer
The new value for the database field.

Example Query:

http://BackendServerIP:6544/Capture/UpdateCardInput?CardId=1&Setting=externalcommand&Value=/usr/bin/6200ch

Example Return:

Boolean return. Returns true if the value was modified, false if the change failed.

<bool>true</bool>

RemoveCardInput

The RemoveCardInput API takes the following arguments:

CardInputId (Required)
Parameter Type: Integer
The database card input ID for the input you are deleting.

Example Query:

http://BackendServerIP:6544/Capture/RemoveCardInput?CardInputId=3

Example Return:

Boolean return. Returns true if the input was removed from the database, false if the delete failed.

<bool>true</bool>