views:

301

answers:

2

Hi, I own a avermedia volar HX usb stick, I want to capture fromthe composite input , but I can't because I'm unable to select the input. I'm using gstreamer with + python, I think I need to use gsttuner select input but I have no experience using gstreamer's interfaces. Could someone post a simple example?

Thanks!

+1  A: 
src = gst.element_factory_make("v4l2src", "src")
src.set_state(gst.STATE_PAUSED)
try:
    # channel names will be different for each device
    channels = src.list_channels()
    composite = [x for x in channels if x.label == "Composite1"]
    if composite:
        self.src.set_channel(composite[0])
except AttributeError, e:
    log.warn("Could not tune video source\n")
joeforker
A: 

The code shown above seems basically correct, but it will flounder on the rocks of v4l2. The strings you get will depend on what card you have:

On four different cards so far I've encountered:

"Composite" "Composite1" "composite" "Composite Video Input"

Also be aware that some cards will have the driver lie, since the chip set has four inputs, the driver will often report four, even if the manufacturer only connects to two of them.

wkulecz