I am trying to switch between two streams using input-selector
but I am getting the error:
`AttributeError: 'NoneType' object has no attribute 'get_property'`
This is my Python code:
def __init__(self):
pipeline_string=(
'videotestsrc pattern=0 ! in. '
'videotestsrc pattern=2 ! in. '
'input-selector name=in ! autovideosink '
)
self.pipeline=Gst.parse_launch(pipeline_string)
def cam1(self):
switch = self.pipeline.get_by_name('in')
stop_time = switch.emit('block')
newpad = switch.get_static_pad('sink0')
start_time = newpad.get_property('running-time')
switch.emit('switch', newpad, stop_time, start_time)
I think those two functions are only thing you need. I wrote it so that I can test the input-stream
element. The thing that happens is that I get None
type when I try to get the sink0
pad. Why ?