Difference between revisions of "Capture Service"

From MythTV Official Wiki
Jump to: navigation, search
Line 279: Line 279:
  
 
Boolean return.  Returns true if the value was modified, false if the change failed.
 
Boolean return.  Returns true if the value was modified, false if the change failed.
 +
 +
<pre><bool>true</bool></pre>
 +
 +
==RemoveCaptureCard==
 +
 +
The <span style="color:LimeGreen">RemoveCaptureCard</span> API takes the following arguments:
 +
 +
:<span style="color:SteelBlue">CardId</Span> ('''Required''')
 +
:: '''Parameter Type:''' Integer
 +
:: The database card ID for the device you are deleting.
 +
 +
Example Query:
 +
 +
<code>http://BackendServerIP:6544/Capture/RemoveCaptureCard?CardId=3</code>
 +
 +
Example Return:
 +
 +
Boolean return.  Returns true if the device was removed from the database, false if the delete failed.
  
 
<pre><bool>true</bool></pre>
 
<pre><bool>true</bool></pre>

Revision as of 17:14, 2 October 2011

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:

Simple 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>