How I can use decodebin with rtspServer

Tim Müller tim at
Tue Apr 20 08:15:43 UTC 2021

On Mon, 2021-04-19 at 23:08 +0200, Jordi Alcaine via gstreamer-devel

Hi Jordi,

> I'm implementing an RTSP server using as source dmsssrc library. This
> library is for connect dahua cameras.
> In the gst_rtsp_media_factory_set_launch I need to use  decodebin
> element
> gst_rtsp_media_factory_set_launch(factory, "( "
>         "dmsssrc host = XXXX port=37777 user=XXX password=YYY
> channel=0 subchannel=1 ! dmssdemux ! queue !  decodebin ! x264enc !
> rtph264pay name=pay0 pt=96 )");
> My problem it´s I can`t  use decodebin from launch because use 
> sometime pads. In another program I'm solved this problem waiting for
> pads creating using  g_signal_connect  "pad-added".
> Is It possible to create the pipeline and then assign to rtsp server
> without use  gst_rtsp_media_factory_set_launch ? Exist another
> solution?

You can subclass GstRtspMediaFactory and implement the
::create_element() virtual method, but I'm not sure if that's needed to
use decodebin here. parse_launch should handle decodebin's dynamic pads
automatically already, just like in gst-launch-1.0, so if that doesn't
work for you then maybe something is missing to make it link decodebin
to x264enc, perhaps a videoconvert element or such?


More information about the gstreamer-devel mailing list