I'm just trying to get an RTP sample working, but every example I've seen doesn't execute due to missing plugins or incorrect pins.
This seems the most promising, but, although the server and client seem to launch properly and go to "PLAYING", nothing happens:
Server:
gst-launch -v videotestsrc ! \
video/x-raw-rgb, format=\(fourcc\)RGB, width=4, height=4, frame-rate=1/1 ! rtpvrawpay !
udpsink host=127.0.0.1
Server output:
/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)RAW, sampling=(string)RGB, depth=(string)8, width=(string)4, height=(string)4, colorimetry=(string)SMPTE240M, payload=(int)96, ssrc=(uint)3779397700, clock-base=(uint)1161131286, seqnum-base=(uint)43390
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
Client:
gst-launch-0.10 -v udpsrc caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)RAW, sampling=(string)RGB, depth=(string)8, width=(string)4, height=(string)4, colorimetry=(string)SMPTE240M, payload=(int)96, ssrc=(uint)3779397700, clock-base=(uint)1161131286, seqnum-base=(uint)43390" ! rtpvrawdepay ! xvimagesink
Client output:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstRtpVRawDepay:rtpvrawdepay0.GstPad:src: caps = video/x-raw-rgb, width=(int)4, height=(int)4, format=(fourcc)0x00000000, framerate=(fraction)0/1, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, bpp=(int)24, depth=(int)24
/GstPipeline:pipeline0/GstRtpVRawDepay:rtpvrawdepay0.GstPad:sink: caps = application/x-rtp, media=(string)video, payload=(int)96, clock-rate=(int)90000, encoding-name=(string)RAW, sampling=(string)RGB, depth=(string)8, width=(string)4, height=(string)4, colorimetry=(string)SMPTE240M, ssrc=(uint)3779397700, clock-base=(uint)1161131286, seqnum-base=(uint)43390
These work:
Server:
gst-launch-0.10 -v \
gstrtpbin name=rtpbin1 \
videotestsrc ! x264enc ! rtph264pay ! rtpbin1.send_rtp_sink_0 \
rtpbin1.send_rtp_src_0 ! udpsink host=127.0.0.1 port=5011 \
rtpbin1.send_rtcp_src_0 ! udpsink host=127.0.0.1 port=5012 \
udpsrc port=5013 ! rtpbin1.recv_rtcp_sink_0
Client:
gst-launch-0.10 -v \
videomixer name=mix ! ffmpegcolorspace ! autovideosink sync=false async=false \
gstrtpbin name=rtpbin1 \
udpsrc port=5011 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)\"Z0LAFdkBQfsBEAAAAwAXc1lAAPFi5IAA\\,aMuMsg\\=\\=\", ssrc=(uint)595281375, payload=(int)96, clock-base=(uint)3105254905, seqnum-base=(uint)59233" ! rtpbin1.recv_rtp_sink_0 rtpbin1. ! rtph264depay ! queue ! ffdec_h264 ! videobox border-alpha=0 top=0 left=0 ! mix. \
udpsrc port=5012 ! rtpbin1.recv_rtcp_sink_0 \
rtpbin1.send_rtcp_src_0 ! udpsink port=5013 host=127.0.0.1
Related
I'm trying to stream a video encoded in H264 over RTP/UDP.
Sending:
gst-launch-1.0 \
videotestsrc ! \
video/x-raw,format=RGBx,width=960,height=540,framerate=25/1 ! \
videoconvert ! \
x264enc bitrate=2000 ! \
rtph264pay config-interval=1 pt=96 ! \
udpsink port=5000
Receive:
gst-launch-1.0 \
udpsrc port=5000 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! \
rtph264depay ! \
decodebin ! \
videoconvert ! \
ximagesink
If I start receiving the video before sending it, then everything works as intended.
However, if I start receiving video after the start of sending, then the image "breaks".
An example of a corrupted image
How to fix this problem?
The problem was solved by specifying caps after videoconvert
...
videoconvert ! video/x-raw,format=I420
...
I've have a gstreamer pipeline that is playing back RTP stream received from udpsrc:
udpsrc port=6000 caps=\"application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H265, payload=(int)96, seqnum-offset=(uint)5331, timestamp-offset=(uint)2500093283, ssrc=(uint)2046637718, a-framerate=(string)1\" ! rtph265depay ! avdec_h265 ! videoconvert ! autovideosink sync=false
That works fine, however if I replace udpsrc with appsrc, it stops working. The only error I'm seeing is:
... Segment with non-TIME format not supported
non-working pipeline with appsrc:
appsrc name=appsrc caps=\"application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H265, payload=(int)96, seqnum-offset=(uint)5331, timestamp-offset=(uint)2500093283, ssrc=(uint)2046637718, a-framerate=(string)1\" ! rtph265depay ! avdec_h265 ! videoconvert ! autovideosink sync=false
Turns out that appsrc needs to have its format property set to time.
Here is the fixed pipeline:
appsrc name=appsrc format=time caps=\"application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H265, payload=(int)96, seqnum-offset=(uint)5331, timestamp-offset=(uint)2500093283, ssrc=(uint)2046637718, a-framerate=(string)1\" ! rtph265depay ! avdec_h265 ! videoconvert ! autovideosink sync=false
tried the below but cant hear audio
gst-launch-1.0 udpsrc port=6000 ! "application/x-srtp,media=(string)audio, clock-rate=(int)44100, encoding-name=(string)L16, channels=(int)2, payload=(int)96, srtp-key=(buffer)012345678901234567890123456789012345678901234567890123456789, srtp-cipher=(string)aes-128-icm, srtp-auth=(string)hmac-sha1-80, srtcp-cipher=(string)aes-128-icm, srtcp-auth=(string)hmac-sha1-80, roc=(uint)0" ! srtpdec ! rtpL16depay ! audioconvert ! alsasink
gst-launch-1.0 -v alsasrc ! audioconvert ! audio/x-raw,channels=2,depth=16,width=16,rate=44100 ! rtpL16pay ! srtpenc key="012345678901234567890123456789012345678901234567890123456789" ! udpsink host=3.204.26.22 port=6000
That is because you havent set ssrc, try the following pipelines
Sender pipeline as:
gst-launch-1.0 -v alsasrc ! audioconvert ! audio/x-raw,channels=2,depth=16,width=16,rate=44100 ! rtpL16pay ! 'application/x-rtp, ssrc=(uint)3412089386' ! srtpenc key="012345678901234567890123456789012345678901234567890123456789" ! udpsink host=3.204.26.22 port=6000
Receiver pipeline as:
gst-launch-1.0 udpsrc port=6000 ! "application/x-srtp,media=(string)audio, clock-rate=(int)44100, encoding-name=(string)L16, channels=(int)2, payload=(int)96,ssrc=(uint)3412089386, srtp-key=(buffer)012345678901234567890123456789012345678901234567890123456789, srtp-cipher=(string)aes-128-icm, srtp-auth=(string)hmac-sha1-80, srtcp-cipher=(string)aes-128-icm, srtcp-auth=(string)hmac-sha1-80, roc=(uint)0" ! srtpdec ! rtpL16depay ! audioconvert ! alsasink
I used gstreamer-1.2.4 to send stream from v4l2src to multicast and to write it in shared memory. Pipeline is:
v4l2src device=${device} do-timestamp=true blocksize=400000 typefind=true \
! "video/x-h264, width=(int)${width}, height=(int)${height}, framerate=(fraction)${framerate}, interlace-mode=(string)progressive, pixel-aspect-ratio=(fraction)1/1" \
! h264parse \
! "video/x-h264, alignment=(string)au, stream-format=(string)avc, parsed=(boolean)true" \
! tee name=video1tee \
video1tee. ! queue \
! rtph264pay config-interval=1 \
! application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96 \
! queue \
! udpsink multicast-iface=${IFACE_OUT} host=${MULTICAST_OUT_IP_ADDR} port=${VIDEO_OUT_UDP_PORT} ttl-mc=10 auto-multicast=false sync=true async=false
video1tee. ! queue leaky=downstream \
! shmsink socket-path=\"/tmp/camera_shmsink\" shm-size=20000000 wait-for-connection=false max-lateness=5000000000 sync=false async=false > ${logfile} 2>&1
Now, I updated it to gstreamer-1.8.3 and this pipeline doesn't work. Then I try to view this multicast stream, I don't get anything. Hardware has not changed.
Also I have warnings:
v4l2src gstv4l2src.c:862:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 18446744073709551615 - ts: 0:00:09.8444373543
h264parse gsth264parse.c:1205:gst_h264_parse_handle_frame:<h264parse0> broken/invalid nal Type: 1 Slice, Size: 22638 will be dropped
Then I delete
! h264parse \
! "video/x-h264, alignment=(string)au, stream-format=(string)avc, parsed=(boolean)true" \
I get a green screen.
Pipeline to view video:
udpsrc do-timestamp=true buffer-size=30000000 address=227.1.1.11 auto-multicast=true port=51012 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264" ! rtph264depay ! h264parse ! avdec_h264 output-corrupt=false ! autovideoconvert ! videocrop ! videoscale ! videobalance ! video/x-raw, format=(string)YV12, colorimetry=(string)bt601 ! autovideoconvert ! fpsdisplaysink
Why did it work in the old version, but does not work in the new one?
Can someone paste a working pair of gst-launch pipelines that use rtpvrawpay and rtpvrawdepay?
Here's my first stab at it:
gst-launch-1.0 videotestsrc ! videoconvert ! video/x-raw,width=128,height=128,format=BGR ! rtpvrawpay ! application/x-rtp,payload=96 ! udpsink host=... port=...
gst-launch-1.0 udpsrc port=9999 ! application/x-rtp,media=video,payload=96,clock-rate=90000,encoding-name=RAW,sampling=BGR,depth=16 ! rtpvrawdepay ! video/x-raw,width=128,height=128,format=BGR,framerate=30/1 ! videoconvert ! ximagesink
Pay: gst-launch-1.0 -v videotestsrc ! rtpvrawpay ! udpsink host="127.0.0.1" port="5000"
Depay: gst-launch-1.0 udpsrc port="5000" caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)RAW, sampling=(string)YCbCr-4:2:0, depth=(string)8, width=(string)320, height=(string)240, colorimetry=(string)BT601-5, payload=(int)96, ssrc=(uint)1103043224, timestamp-offset=(uint)1948293153, seqnum-offset=(uint)27904" ! rtpvrawdepay ! videoconvert ! queue ! xvimagesink sync=false
Check the caps on your pipeline again.