Udpsrc auto detection of encoding

I have a pipeline similar to the following:

udpsrc caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! queue ! decodebin3 name=decoder1 ! queue ! d3d11upload ! d3d11videosink 

Is there anyway for me to remove encoding-name and rtp264depay and have the pipeline autodetect the encoding (i.e. H264/H265…)?

It might be possible to create some heuristics to detect RTP H.264/H.265 payload format, but there’s currently no functionality in GStreamer for typefinding packetised input like that.

It would be best to have some kind of out-of-band channel to transmit the type of stream carried.

This could be for example:

  • use RTSP to set up the RTP streaming (the RTSP protocol will provide the info in form of an SDP)
  • if you use multicast, you can advertise your streams with some broadcast protocol (and include the SDP)
  • shared knowledge between sender and receiver, e.g. you know what’s what based on the port number
  • use an SDP file (local, transmitted via some other channel, or downloaded via http) to set up the streaming, e.g. using sdpsrc or such
1 Like

Thank you @tpm!

Could you elobrate a bit on option #2 (i.e. using multicast and broadcast protocol)? What would be an example of a broadcast protocol?

Something like the Session Announcement Protocol (SAP) for example.

1 Like