我正在尝试在两个流之间切换,input-selector
但出现错误:
`AttributeError: 'NoneType' object has no attribute 'get_property'`
这是我的 Python 代码:
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)
我认为这两个功能只是你需要的。我写它是为了测试input-stream
元素。发生的事情是,None
当我尝试获取sink0
垫子时,我得到了类型。为什么 ?