Hi,<br><br>I use gstreamer for playing RTSP stream from IP cameras like Axis. I use a command line like this:<br><br><span style="font-family: courier new,monospace;">gst-launch-0.10 rtspsrc location=rtsp://<a href="http://192.168.0.127/axis-media/media.amp">192.168.0.127/axis-media/media.amp</a> latency=0 ! decodebin ! autovideosink</span><br>
<br>and it work fine.<br><br>I want to control it with a gui in pygtk so I use the gstreamer python bindings. I&#39;ve wrote this piece of code:<br><br><span style="font-family: courier new,monospace;">[...]</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">self.player = gst.Pipeline(&quot;player&quot;)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">source = gst.element_factory_make(&quot;rtspsrc&quot;, &quot;source&quot;)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">source.set_property(&quot;location&quot;, &quot;rtsp://<a href="http://192.168.0.127/axis-media/media.amp">192.168.0.127/axis-media/media.amp</a>&quot;)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">decoder = gst.element_factory_make(&quot;decodebin&quot;, &quot;decoder&quot;)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">sink = gst.element_factory_make(&quot;autovideosink&quot;, &quot;sink&quot;)</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">self.player.add(source, decoder, sink)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">gst.element_link_many(source, decoder, sink)</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">bus = self.player.get_bus()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">bus.add_signal_watch()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">bus.enable_sync_message_emission()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">bus.connect(&quot;message&quot;, self.on_message)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">bus.connect(&quot;sync-message::element&quot;, self.on_sync_message)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">[...]</span><br>
<br>But it doesn&#39;t work and quit with this message:<br><br><span style="font-family: courier new,monospace;">gst.element_link_many(source, decoder,sink)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">gst.LinkError: failed to link source with decoder</span><br>
<br><br>I&#39;ve also try to improve my CLI with this as I only use h264:<br><br><span style="font-family: courier new,monospace;">gst-launch-0.10 -v rtspsrc location=rtsp://<a href="http://192.168.0.127/axis-media/media.amp">192.168.0.127/axis-media/media.amp</a> ! rtph264depay !  ffdec_h264 ! xvimagesink</span><br>
<br>And implement it in my python code like that:<br><br>[<span style="font-family: courier new,monospace;">...]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">self.player = gst.Pipeline(&quot;player&quot;)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">source = gst.element_factory_make(&quot;rtspsrc&quot;, &quot;source&quot;)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">depay = gst.element_factory_make(&quot;rtph264depay&quot;, &quot;depay&quot;)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">decoder = gst.element_factory_make(&quot;ffdec_h264&quot;, &quot;decoder&quot;)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">sink = gst.element_factory_make(&quot;xvimagesink&quot;, &quot;output&quot;)</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">self.player.add(source, depay, decoder, sink)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">gst.element_link_many(source, depay, decoder, sink)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">[...]</span><br><br>But I got the same error :(<br><span style="font-family: courier new,monospace;">gst.LinkError: failed to link source with depay</span><br>There is something wrong between my source (rtspsrc), as it work with decodebin with a filesrc (don&#39;t work of course with rtph264depay)<br>
<br>I don&#39;t understand why it doesn&#39;t work because it work in cli. Any experts of gstreamer who can help me ?<br><br>Thanks in advance.<br><br>Regards,<br>