1

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 ?

Ian Mackinnon
  • 13,381
  • 13
  • 51
  • 67
Haris Kovacevic
  • 672
  • 6
  • 21
  • `get_static_pad('sink0')` works fine for me here on my Laptop, at least it returns a `GstPad object` instead of `None`. Maybe check your gstreamer installation or related configurations? – starrify Sep 21 '14 at 08:33
  • Sorry but with my Python-binding it is version `0.10.36` which is invoked. Sorry for being not helpful. – starrify Sep 21 '14 at 08:48

1 Answers1

1

Okey after a couple of hours trying to solve this I found out (thanks to guy named Tim) that iam using sink0 instead sink_0 .

Haris Kovacevic
  • 672
  • 6
  • 21