Detect automatically caps for UDP streaming

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Detect automatically caps for UDP streaming

sergio_
Hello,
I try to stream using UDP.

//server
gst-launch -v filesrc location=big_buck_bunny_720p_H264_AAC_25fps_3400K.mp4 ! queue ! qtdemux name=dem dem. ! queue ! rtph264pay ! udpsink host=127.0.0.1 port=3000 dem. ! queue ! rtpmp4apay ! udpsink host=127.0.0.1 port=5000
//client
gst-launch udpsrc port=3000 ! rtph264depay ! ffdec_h264 ! ffmpegcolorspace ! mfw_v4lsink disp-width=200 disp-height=200

When I run the client I get the next error:
ERROR: from element /GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0: No RTP format was negotiated.
Additional debug info:
gstbasertpdepayload.c(376): gst_base_rtp_depayload_chain (): /GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0:
Input buffers need to have RTP caps set on them. This is usually achieved by setting the 'caps' property of the upstream source element (often udpsrc or appsrc), or by putting a capsfilter element before the depayloader and setting the 'caps' property on that. Also see http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/gst/rtp/

If I add the caps in the client it works:
gst-launch udpsrc port=3000 caps = 'application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)\"Z0LADZp0AoAt2AiAAAADAIAAABlHihVQ\\,aM48gA\\=\\=\", payload=(int)96, ssrc=(uint)1986209123, clock-base=(uint)150257395, seqnum-base=(uint)29138' ! rtph264depay ! ffdec_h264 ! ffmpegcolorspace ! mfw_v4lsink disp-width=200 disp-height=200

But I need a way to detect the caps automatically, this way it will work for files with different encoding/caps. Does anyoine know how to do this, automatically detect the caps for UDP stream?

Thanks a lot,
Reply | Threaded
Open this post in threaded view
|

Re: Detect automatically caps for UDP streaming

Tim Müller
On Mon, 2014-01-27 at 00:56 -0800, sergio_ wrote:

Hi Sergio,

> But I need a way to detect the caps automatically, this way it will work for
> files with different encoding/caps. Does anyoine know how to do this,
> automatically detect the caps for UDP stream?

The easiest way for this might be to use gst-rtsp-server. The client
then connects to the server via TCP, gets all the setup data (ports,
formats, etc.), and can then set up UDP/RTP streaming based on that
automatically.

 Cheers
  -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Detect automatically caps for UDP streaming

sergio_
Tim, thank you for the reply.
So, it is not possible do detect the caps using gst-launch command on client side?
Reply | Threaded
Open this post in threaded view
|

Re: Detect automatically caps for UDP streaming

Michael Gruner
Hi

I don't like the idea of needing prior knowledge of the caps either. You may try using something like transport stream (mpegtsmux/mpegtsdemux) to deal automatically with the caps.

If your project allows you to use a higher level protocol, I'd rather use RTSP. It has a much smarter handshaking as Tim points.

Michael

> On 27/01/2014, at 10:20, sergio_ <[hidden email]> wrote:
>
> Tim, thank you for the reply.
> So, it is not possible do detect the caps using gst-launch command on client
> side?
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Detect-automatically-caps-for-UDP-streaming-tp4664899p4664909.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Detect automatically caps for UDP streaming

pfarmer
In reply to this post by sergio_
If you only consider RTP packing it is sufficient to tell that the udpsrc:

either using a capsfilter

gst-launch udpsrc port=3000 ! application/x-rtp ! rtph264depay ! ffdec_h264 ! ffmpegcolorspace ! mfw_v4lsink disp-width=200 disp-height=200

or set the caps as a property directly at the udpsrc:

gst-launch udpsrc port=3000 caps="application/x-rtp" ! application/x-rtp ! rtph264depay ! ffdec_h264 ! ffmpegcolorspace ! mfw_v4lsink disp-width=200 disp-height=200

The capabilities media, clock-rate and encoding-name are negotiated automatically between udpsrc and rtph264pay to probably: media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264