Hi,
I am working on displaying a H.264 RTSP stream in Chrome. It works very well when I use a test stream generated by gst-rtsp-server
gst-rtsp-launch -p 8558 "videotestsrc ! x264enc aud=false ! rtph264pay name=pay0"
and this Janus configuration:
[rtsp-test]
type = rtsp
id = 99
description = RTSP Test
audio = no
video = yes
url=rtsp://localhost:8558/test
However, finally I will have an RTP stream sent to the RTSP server. So I wanted to test it with the following commands:
gst-launch-1.0 -v videotestsrc ! x264enc aud=false ! rtph264pay ! udpsink host=127.0.0.1 port=5001
gst-rtsp-launch -p 8558 "( udpsrc name=pay0 port=5001 caps=\"application/x-rtp, media=video, clock-rate=90000, encoding-name=H264, payload=96\" )"
But it doesn't work. Janus server doesn't show any warnings, just "WebRTC media is now available". Chrome console doesn't display any warnings either. I can see in Wireshark that RTP stream is being sent from Janus server to the browser. So I compared SDPs received by Janus Javascript client. This one I got when everything was working ok:
v=0
o=- 1516196977147479 1 IN IP4 172.17.0.8
s=Mountpoint 131841
t=0 0
a=group:BUNDLE video
a=msid-semantic: WMS janus
m=video 9 UDP/TLS/RTP/SAVPF 96
c=IN IP4 172.17.0.8
a=sendonly
a=mid:video
a=rtcp-mux
a=ice-ufrag:P3d6
a=ice-pwd:holpSuZgvwdSHiIfSajgCx
a=ice-options:trickle
a=fingerprint:sha-256 D2:B9:31:8F:DF:24:D8:0E:ED:D2:EF:25:9E:AF:6F:B8:34:AE:53:9C:E6:F3:8F:F2:64:15:FA:E8:7F:53:2D:38
a=setup:actpass
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=42c015;sprop-parameter-sets=Z0LAFdkBQfsBagwCC0oAAAMAAgAAAwB5HixckA==,aMuMsg==
a=rtcp-fb:96 nack
a=rtcp-fb:96 goog-remb
a=ssrc:2640041175 cname:janusvideo
a=ssrc:2640041175 msid:janus janusv0
a=ssrc:2640041175 mslabel:janus
a=ssrc:2640041175 label:janusv0
a=candidate:1 1 udp 2013266431 172.17.0.8 59797 typ host a=candidate:2 1 udp 2013266431 10.0.2.5 44970 typ host a=end-of-candidates
And this one when I added udpsink and udpsrc:
v=0
o=- 1516197514486623 1 IN IP4 172.17.0.8
s=Mountpoint 131841
t=0 0
a=group:BUNDLE video
a=msid-semantic: WMS janus
m=video 9 UDP/TLS/RTP/SAVPF 96
c=IN IP4 172.17.0.8
a=sendonly
a=mid:video
a=rtcp-mux
a=ice-ufrag:eunW
a=ice-pwd:SqX4FdM0txn2AtX4kKwKJ0
a=ice-options:trickle
a=fingerprint:sha-256 D2:B9:31:8F:DF:24:D8:0E:ED:D2:EF:25:9E:AF:6F:B8:34:AE:53:9C:E6:F3:8F:F2:64:15:FA:E8:7F:53:2D:38
a=setup:actpass
a=rtpmap:96 H264/90000
a=fmtp:96
a=rtcp-fb:96 nack
a=rtcp-fb:96 goog-remb
a=ssrc:2011230882 cname:janusvideo
a=ssrc:2011230882 msid:janus janusv0
a=ssrc:2011230882 mslabel:janus
a=ssrc:2011230882 label:janusv0
a=candidate:1 1 udp 2013266431 172.17.0.8 44404 typ host a=candidate:2 1 udp 2013266431 10.0.2.5 44647 typ host a=end-of-candidates
I made differences bold. I think that only this difference matters: a=fmtp:96 vs a=fmtp:96 packetization-mode=1;profile-level-id=42c015;sprop-parameter-sets=Z0LAFdkBQfsBagwCC0oAAAMAAgAAAwB5HixckA==,aMuMsg==. So I created those commands to force those settings:
gst-launch-1.0 -v videotestsrc ! x264enc aud=false ! rtph264pay ! capssetter caps='application/x-rtp,packetization-mode=1,profile-level-id=42c015,sprop-parameter-sets="Z0LAFdkBQfsBagwCC0oAAAMAAgAAAwB5HixckA==,aMuMsg=="' ! udpsink host=127.0.0.1 port=5001
gst-rtsp-launch -p 8558 "( udpsrc name=pay0 port=5001 caps=\"application/x-rtp, media=video, clock-rate=90000, encoding-name=H264, payload=96, packetization-mode=1, profile-level-id=42c015, sprop-parameter-sets=\\\"Z0LAFdkBQfsBagwCC0oAAAMAAgAAAwB5HixckA\\\=\\\=\\\,aMuMsg\\\=\\\=\\\"\"\" )"
It got better, because now I can see at least some vertical green and black stripes. But it is not the stream I wanted, so I checked the SDP once again and packetization-mode=1 was still missing: a=fmtp:96 profile-level-id=42c015;sprop-parameter-sets=Z0LAFdkBQfsBagwCC0oAAAMAAgAAAwB5HixckA==,aMuMsg==. I am not sure if this missing packetization-mode=1 in the SDP is the root cause of the problem, but I don't have other ideas. I also tried other settings from this post https://github.com/meetecho/janus-gateway/issues/1123#issuecomment-355214342 but with no luck.
Can you help me with this problem?
Rafał