GNOME Bugzilla – Bug 786304
srtpenc / srtpdec don't work
Last modified: 2018-05-14 14:06:10 UTC
to reproduce: (tested on 1.8.3 and 1.12.1) gst-launch-1.0 -v v4l2src ! 'video/x-raw,width=640,height=480' ! jpegenc ! rtpjpegpay ! 'application/x-rtp, payload=(int)26, ssrc=(uint)1356955624, encoding-name=JPEG' ! srtpenc key="987654321001234567890123456789012345678901234567890123456789" ! udpsink host=127.0.0.1 port=5200 gst-launch-1.0 -v v4l2src ! 'video/x-raw,width=640,height=480' ! jpegenc ! rtpjpegpay ! 'application/x-rtp, payload=(int)26, ssrc=(uint)1356955624, encoding-name=JPEG' ! srtpenc key="987654321001234567890123456789012345678901234567890123456789" ! udpsink host=127.0.0.1 port=5200 I get wall of WARNs with GST_DEBUG=*:2 [...] 0:00:06.902930684 3661 0x2363320 WARN srtpdec gstsrtpdec.c:770:request_key_with_signal:<srtpdec0> Could not get caps for stream with SSRC 1356955624 0:00:06.902956565 3661 0x2363320 WARN srtpdec gstsrtpdec.c:1212:gst_srtp_dec_chain:<srtpdec0> Invalid buffer, dropping [...] Regards, Daniel
gst-launch-1.0 udpsrc port=5200 caps='application/x-srtp, encoding-name=JPEG, ssrc=(uint)1356955624, srtp-key=(buffer)987654321001234567890123456789012345678901234567890123456789' ! srtpdec ! 'application/x-rtp, encoding-name=JPEG, payload=26' ! rtpjpegdepay ! jpegdec ! autovideosink proper sink (duplicated src above by accident)
These srtp element don't seem to allow use through gst-launch as they require implementing some signals, notably the soft-limit and hard-limit signals.
1. so... examples included here [1] are wrong? 2. how to encrypt 1-1 RTP pipe with SRTP without using rtsp-server? [1] https://github.com/GStreamer/gst-plugins-bad/blob/master/ext/srtp/gstsrtpdec.c Cheers, Daniel
(In reply to Matthew Waters (ystreet00) from comment #2) > These srtp element don't seem to allow use through gst-launch as they > require implementing some signals, notably the soft-limit and hard-limit > signals. The will indeed stop working when they reach the hard limit, but that should take quite some time, and they should work from the command line.
We are running into the same issue. SRTP works fine on pre 1.8.3 versions but from 1.8.3 onwards the decoding doesn't work as expected and we only get constant invalid buffers. Has a fix for this been planned? Is there a way to work around this for now?
This was broken by 73ebdb888e047b14cee73ebdb888e047b14cee, you now need to also add the roc to the caps, so something like: gst-launch-1.0 udpsrc port=5200 caps='application/x-srtp, encoding-name=JPEG, ssrc=(uint)1356955624, 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 ! rtpjpegdepay ! jpegdec ! autovideosink So I fixed the documentation: commit 67ae35813bff9362065bbfec770f3fdbb89165a3 Author: Olivier Crête <olivier.crete@collabora.com> Date: Fri May 11 20:54:35 2018 +0200 srtp: Add "roc" caps field to the gst-launch example The currrent example was broken since 1.8.3 it seems. https://bugzilla.gnome.org/show_bug.cgi?id=786304