Question

I want to setup a RTSP server stream with Gstreamer 1.0 (gst-launch-1.0).

My "Server" currently looks like this

gst-launch-1.0.exe videotestsrc  ! x264enc ! rtph264pay ! udpsink host=localhost port=5000

And my Client looks like this

gst-launch-1.0.exe udpsrc port=5000 ! rtpmp2tdepay ! decodebin ! autovideosink

Both commands run without errors, but I do not see any video on the "client". Moreover I'm aware that my commands are just streaming H.264 encoded video via RTP to a UDP port.

I see some data coming on UDP port 5000, so I assume that the sender part is correct.

My questions:

  1. What am I doing wrong on the receiver side?
  2. How can I setup gst-launch-1.0 to provide a RTSP stream (with the meta-information .sdp file)?

Edit (2014-03-24): Debug output of sending side:

gst-launch-1.0.exe -v videotestsrc ! x264enc ! rtph264pay ! udpsink host=localhost port=5000
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, framerate=(fraction)30/1, width=(int)320, height=(int)240, format=(string)I420, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:sink: caps = video/x-raw, framerate=(fraction)30/1, width=(int)320, height=(int)240, format=(string)I420, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
Redistribute latency...
/GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:src: caps = video/x-h264, codec_data=(buffer)01640014ffe1001967640014acd94141fb0110000003001000000303c8f142996001000568ebecb22c, stream-format=(string)avc, alignment=(string)au, level=(string)2, profile=(string)high, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)"Z2QAFKzZQUH7ARAAAAMAEAAAAwPI8UKZYA\=\=\,aOvssiw\=", payload=(int)96, ssrc=(uint)383435573, timestamp-offset=(uint)786392204, seqnum-offset=(uint)781
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)"Z2QAFKzZQUH7ARAAAAMAEAAAAwPI8UKZYA\=\=\,aOvssiw\=", payload=(int)96, ssrc=(uint)383435573, timestamp-offset=(uint)786392204, seqnum-offset=(uint)781
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:sink: caps = video/x-h264, codec_data=(buffer)01640014ffe1001967640014acd94141fb0110000003001000000303c8f142996001000568ebecb22c, stream-format=(string)avc, alignment=(string)au, level=(string)2, profile=(string)high, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: timestamp = 786392204
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0: seqnum = 781
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

The receiving side:

gst-launch-1.0.exe -vvv udpsrc port=5000 ! "application/x-rtp, media=video, clock-rate=90000, encoding-name=H264, payload=96" ! queue ! rtph264depay ! queue ! decodebin ! autovideosink sync=false
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

Thanks!

Was it helpful?

Solution

Problem #1. You are using rtph264pay on sending side but rtpmp2tdepay on the receiving. You need to use rtph264depay.

Problem #2. You need to provide capabilities for rtph264depay to correctly recognize video format.
To get correct capabilities just run sending code with -v flag and copy rtp-specific caps to the receiving pipeline.

gst-launch-1.0 udpsrc port=5000 ! "application/x-rtp, media=video, clock-rate=90000, encoding-name=H264, payload=96" ! rtph264depay ! decodebin ! autovideosink
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top