After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 786304 - srtpenc / srtpdec don't work
srtpenc / srtpdec don't work
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.12.x
Other Linux
: Normal normal
: 1.14.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-08-15 06:40 UTC by daniel.smoczyk
Modified: 2018-05-14 14:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description daniel.smoczyk 2017-08-15 06:40:35 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
Comment 1 daniel.smoczyk 2017-08-15 06:42:34 UTC
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)
Comment 2 Matthew Waters (ystreet00) 2017-08-15 07:42:20 UTC
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.
Comment 3 daniel.smoczyk 2017-08-15 07:53:31 UTC
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
Comment 4 Olivier Crête 2017-08-18 18:57:35 UTC
(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.
Comment 5 Michiel Sioen 2018-05-11 10:36:49 UTC
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?
Comment 6 Olivier Crête 2018-05-11 18:57:51 UTC
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