Can I use input-selector to switch between several inputs??

Giacomo D omagico.olo at gmail.com
Tue Nov 24 02:28:33 PST 2015


Hi,
I want to add several rtsp stream inputs to my pipeline and to switch
sometimes between them to show someone of the inputs. I'm trying to use
"input-selector" but I can't find examples about it.
I'm trying to do something like this:

        self.pipelinelaunch=Gst.parse_launch("input-selector name = i
rtspsrc location=rtsp://127.0.0.1:8555/stream ! i.  rtspsrc
location=rtsp://127.0.0.1:8554/stream !  i.   i. ! rtph264depay ! h264parse
! decodebin  ! videoconvert ! xvimagesink ")

        selector = self.pipelinelaunch.get_by_name("i")
        new_pad = selector.get_static_pad("sink1)
        selector.set_property("active-pad", new_pad)
        print(new_pad)

        Gst.Element.set_state(self.pipelinelaunch, Gst.State.PLAYING)

        time.sleep(5)
        selector = self.pipelinelaunch.get_by_name("i")
        new_pad = selector.get_static_pad("sink0)
        selector.set_property("active-pad", new_pad)
        print(new_pad)

        time.sleep(5)
        selector = self.pipelinelaunch.get_by_name("i")
        new_pad = selector.get_static_pad("sink1)
        selector.set_property("active-pad", new_pad)
        print(new_pad)

It shows me only a video and it doesn't change how it should have!
I'm getting None from "selector.get_static_pad("sink%s)".

What is wrong in this code? Is there some example on how to use it? And is
it the right element for my thought or I need to use a PROBE to change input
everytime?

Thanks in advance.
Giacomo





--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Can-I-use-input-selector-to-switch-between-several-inputs-tp4674619.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list