about gst-rtsp-server srtp for H264 video streaming

Sooeun Jang allmysky7 at gmail.com
Thu Feb 21 03:42:23 UTC 2019


Hello, 
I'm a newbie on gstreamer video streaming, and thanks to all of the gst
developers.

Now I'm making the streaming server to stream H.264 video SRTP via RTSP. 
It's not rely on TLS, I just want to exchange RTP / SRTP dynamically on
going streaming.

For that, I've searched them and I tried to do them but it's not working
properly.

One of them are below,

*1. using gst_rtsp_media_factory_set_launch() to compare with gst-launch CLI
command*
 
./gst-launch-1.0 -v rtspsrc
location="rtsp://192.168.0.19/onvif/profile10/media.smp" protocols=tcp
latency=50 is-live=true ! rtph264depay ! 'video/x-h264,stream-forma
t=(string)byte-stream,alignment=(string)nal' ! h264parse config-interval=1 !
rtph264pay ! capsfilter caps='application/x-rtp, payload=(int)96,
ssrc=(uint)1356955624' ! srtpenc key="0123456789012345678901234567890123456
78901234567890123456789" ! udpsink host=127.0.0.1 port=5000

and it shows running well on CLI commands (gst-launch-1.0) with putting out
the logs.

but my application needs to implement srtp into source code.

So, I modified example test codes imported gst-rtsp-server source package
(examples/test-video.c) to test srtp streaming.

--- serverside logs

sooeun at garbiter> ./test-video                                                                         
~/Dev/cerbero/build/sources/linux_x86_64/gst-rtsp-server-1.0-1.15.0.1/examples
stream ready at rtsps://127.0.0.1:1936/test
GST_PIPELINE grammar.y:455:gst_parse_element_set: could not set property
"key" in element "enc" to
"012345678901234567890123456789012345678901234567890123456789)"
GST_PIPELINE grammar.y:1061:priv_gst_parse_yyparse: syntax error
GST_PIPELINE grammar.y:1178:priv_gst_parse_launch: Unrecoverable syntax
error while parsing pipeline ( videotestsrc !
video/x-raw,width=352,height=288,framerate=15/1 ! x264enc ! rtph264pay
name=pay0 pt=96 ! application/x-rtp, payload=(int)8, ssrc=(uint)1356955624 !
srtpenc name=enc
key=012345678901234567890123456789012345678901234567890123456789)

** (lt-test-video:32285): CRITICAL **: 11:39:57.050: could not parse launch
syntax (( videotestsrc ! video/x-raw,width=352,height=288,framerate=15/1 !
x264enc ! rtph264pay name=pay0 pt=96 ! application/x-rtp, payload=(int)8,
ssrc=(uint)1356955624 ! srtpenc name=enc
key=012345678901234567890123456789012345678901234567890123456789)): could
not set property "key" in element "enc" to
"012345678901234567890123456789012345678901234567890123456789)"

** (lt-test-video:32285): CRITICAL **: 11:39:57.050: could not create
element
rtspclient rtsp-client.c:1049:find_media: client 0x13ae0e0: can't create
media
rtspclient rtsp-client.c:2894:handle_describe_request: client 0x13ae0e0: no
media

--- client log
PS D:\gstreamer\1.0\x86_64\bin> ffprobe -i rtsp://192.168.0.15:1936/test
-hide_banner -show_format -v verbose -print_format json
{
[tcp @ 00000215243ad500] Starting connection attempt to 192.168.0.15 port
1936
[tcp @ 00000215243ad500] Successfully connected to 192.168.0.15 port 1936
rtsp://192.168.0.15:1936/test: Server returned 400 Bad Request

}

2. using gst_rtsp_media_factory_set_profiles () for set default AVP profile
to SAVP

I found "gst_rtsp_media_factory_set_profiles (factory,
GST_RTSP_PROFILE_SAVP);" code in test example source. But if I set this, it
shows log like below, it seems going further than previous one.

rtspstream rtsp-stream.c:2220:caps_notify: stream 0x7f8dfc034fa0 received
caps 0x7f8dec002770, appl                                    ication/x-srtp,
media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264,
packetization-mode=(string)1, profile-level-id=(string)4d002a,
sprop-parameter-sets=(string)"Z00AKpWoHgCJ+WbgICAgQA\=\=\,aO4xsg\=\=",
payload=(int)97, ssrc=(uint)2755208647, timestamp-offset=(uint)954903586,
seqnum-offset=(uint)19607,
*srtp-key*=(buffer)e3785ceab9647d0ace040e707d4fe1425e6c89fb8a325c922ff635fc6a16,
srtp-cipher=(string)aes-128-icm, *srtp-auth*=(string)hmac-sha1-80,
*srtcp-cipher*=(string)aes-128-icm, *srtcp-auth*=(string)hmac-sha1-80

But finally, it's procedure was failed during handle SETUP request after
client connected to server. 
It shows log like this,

rtspclient rtsp-client.c:2232:rtsp_ctrl_timeout_remove: rtsp control session
removed timeout id=4.
rtspclient rtsp-client.c:1895:parse_transport: parsing transports
RTP/AVP/TCP;unicast;interleaved=0                                    -1
rtspstream rtsp-stream.c:770:gst_rtsp_stream_is_transport_supported:
*unsupported profile* 1
rtspclient rtsp-client.c:1911:parse_transport: unsupported transport
RTP/AVP/TCP;unicast;interle 
rtspclient rtsp-client.c:2678:handle_setup_request: client 0xf9e560:
*unsupported transports*
 rtspclient rtsp-client.c:3354:client_session_removed: client 0xf9e560:
session 0x7f8e1c05d750 remov                                    ed

I guess,  gst_rtsp_transport_init() function set profile to default
GST_RTSP_PROFILE_AVP whenever it called. 

/* we have a transport, see if it's supported */
    if (!gst_rtsp_stream_is_transport_supported (stream, tr)) {
      GST_WARNING ("unsupported transport %s", transports[i]);
      goto next;
    }

So, my question is
Q. Are there any further elements or properties that have to be added to run
gst-rtsp-server with srtp ?

P.S) Any little advice must be pleased to me. :)



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list