I’ve set Janus up to broadcast the RTSP feed of a remote IP camera, integrated Janus.js into my FE code and everything works fine on my local machine. Things get awry when I deploy to my digital ocean private server. Looking at the logs, everything looks ok:
[6515144168136924] There's a message for JANUS Streaming plugin
Request to watch mountpoint/stream 1
Going to offer this SDP:
v=0
o=- 1694158225743616 1 IN IP4 127.0.0.1
s=Mountpoint 1
t=0 0
m=video 1 RTP/SAVPF 96
c=IN IP4 1.1.1.1
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=4d0029;sprop-parameter-sets=Z00AKeKQCgC3YC3AQEB4eJEV,aO48gA==
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtcp-fb:96 goog-remb
a=sendonly
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
[6515144168136924] Audio has NOT been negotiated
[6515144168136924] Video has been negotiated
[6515144168136924] SCTP/DataChannels have NOT been negotiated
[6515144168136924] Setting ICE locally: got ANSWER (0 audios, 1 videos)
[6515144168136924] Creating ICE agent (ICE Full mode, controlling)
[6515144168136924] Adding 161.35.193.14 to the addresses to gather candidates for
[6515144168136924] Adding 10.19.0.10 to the addresses to gather candidates for
[6515144168136924] Adding 10.135.0.3 to the addresses to gather candidates for
[6515144168136924] Adding 172.20.0.1 to the addresses to gather candidates for
-------------------------------------------
>> Anonymized
-------------------------------------------
-------------------------------------------
>> Merged (1042 bytes)
-------------------------------------------
v=0
o=- 1694158225743616 1 IN IP4 161.35.193.14
s=Mountpoint 1
t=0 0
a=group:BUNDLE video
a=msid-semantic: WMS janus
m=video 9 UDP/TLS/RTP/SAVPF 96 97
c=IN IP4 161.35.193.14
a=sendonly
a=mid:video
a=rtcp-mux
a=ice-ufrag:LyJb
a=ice-pwd:sfGIG5fuwmKXmi6SaszaUd
a=ice-options:trickle
a=fingerprint:sha-256 65:30:61:58:F2:3C:F5:84:72:A1:78:E9:74:1E:0C:37:81:99:DB:4D:67:A7:A0:22:68:00:BA:C2:07:A2:23:EF
a=setup:actpass
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=4d0029;sprop-parameter-sets=Z00AKeKQCgC3YC3AQEB4eJEV,aO48gA==
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtcp-fb:96 goog-remb
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
a=ssrc-group:FID 2229731912 88611554
a=msid:janus janusv0
a=ssrc:2229731912 cname:janus
a=ssrc:2229731912 msid:janus janusv0
a=ssrc:2229731912 mslabel:janus
a=ssrc:2229731912 label:janusv0
a=ssrc:88611554 cname:janus
a=ssrc:88611554 msid:janus janusv0
a=ssrc:88611554 mslabel:janus
a=ssrc:88611554 label:janusv0
[6515144168136924] Sending event to transport...
>> Pushing event: 0 (Success)
[6515144168136924] Discovered new local candidate for component 1 in stream 1: type=host
[6515144168136924] Address: 161.35.193.14:45716
[6515144168136924] Priority: 2015363327
[6515144168136924] Foundation: 1
[6515144168136924] 1 1 udp 2015363327 161.35.193.14 45716 typ host
[6515144168136924] Sending trickle event (candidate) to transport...
[6515144168136924] Discovered new local candidate for component 1 in stream 1: type=host
[6515144168136924] Address: 10.19.0.10:50656
[6515144168136924] Priority: 2015363583
[6515144168136924] Foundation: 2
[6515144168136924] 2 1 udp 2015363583 10.19.0.10 50656 typ host
[6515144168136924] Sending trickle event (candidate) to transport...
[6515144168136924] Discovered new local candidate for component 1 in stream 1: type=host
[6515144168136924] Address: 10.135.0.3:57624
[6515144168136924] Priority: 2015363839
[6515144168136924] Foundation: 3
[6515144168136924] 3 1 udp 2015363839 10.135.0.3 57624 typ host
[6515144168136924] Sending trickle event (candidate) to transport...
[6515144168136924] Discovered new local candidate for component 1 in stream 1: type=host
[6515144168136924] Address: 172.20.0.1:44994
[6515144168136924] Priority: 2015364095
[6515144168136924] Foundation: 4
[6515144168136924] 4 1 udp 2015364095 172.20.0.1 44994 typ host
[6515144168136924] Sending trickle event (candidate) to transport...
[6515144168136924] Gathering done for stream 1
[6515144168136924] Sending trickle event (end-of-candidates) to transport...
Got a Janus API request from janus.transport.http (0x7f5964001090)
Session 1371811771448677 found... returning up to 10 messages
Got a keep-alive on session 1371811771448677
Got a Janus API request from janus.transport.http (0x7f5964007180)
Got a Janus API request from janus.transport.http (0x7f5964002f20)
Handle 6515144168136924 supports trickle even if it didn't negotiate it...
[6515144168136924] Still processing the offer, queueing this trickle to wait until we're done there...
Transport task pool, serving request
[6515144168136924] There's a message for JANUS Streaming plugin
[6515144168136924] Remote SDP:
v=0
o=- 823027768964608648 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE video
a=msid-semantic: WMS
m=video 9 UDP/TLS/RTP/SAVPF 96 97
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:PI80
a=ice-pwd:7k+qcNHP2eNJ56E+pdtQEgqJ
a=ice-options:trickle
a=fingerprint:sha-256 FE:58:FE:9E:11:28:A3:A2:6A:D6:0C:93:AC:7D:0B:E4:A0:D9:AE:22:BA:87:EE:B5:A8:D2:50:10:7D:72:CD:7C
a=setup:active
a=mid:video
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=recvonly
a=rtcp-mux
a=rtpmap:96 H264/90000
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=fmtp:96 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d001f
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
[6515144168136924] Video mid: video
[6515144168136924] Audio has NOT been negotiated, Video has been negotiated, SCTP/DataChannels have NOT been negotiated
[6515144168136924] Parsing video candidates (stream=1)...
[6515144168136924] ICE ufrag (local): PI80
[6515144168136924] ICE pwd (local): 7k+qcNHP2eNJ56E+pdtQEgqJ
[6515144168136924] Fingerprint (local) : sha-256 FE:58:FE:9E:11:28:A3:A2:6A:D6:0C:93:AC:7D:0B:E4:A0:D9:AE:22:BA:87:EE:B5:A8:D2:50:10:7D:72:CD:7C
[6515144168136924] DTLS setup (local): active
[6515144168136924] Setting accept state (DTLS server)
[6515144168136924] Video mid: video
[6515144168136924] Setting remote credentials...
[6515144168136924] -- Processing 1 pending trickle candidates
[6515144168136924] Trickle candidate (video): candidate:3737360767 1 udp 2113937151 ec6a42c5-468e-4e5b-a6cd-6b94a8bd1ca8.local 48008 typ host generation 0 ufrag PI80 network-cost 999
[6515144168136924] Resolving mDNS address (ec6a42c5-468e-4e5b-a6cd-6b94a8bd1ca8.local) asynchronously
[6515144168136924] -- ICE Trickling is supported by the browser, waiting for remote candidates...
Will remove payload type 97 (97 rtx/90000)
-------------------------------------------
>> Anonymized
-------------------------------------------
Starting the streaming
This is involving a negotiation (but we really don't care) as well (answer):
v=0
o=- 823027768964608648 2 IN IP4 1.1.1.1
s=-
t=0 0
m=video 9 UDP/TLS/RTP/SAVPF 96
c=IN IP4 1.1.1.1
a=recvonly
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=rtpmap:96 H264/90000
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=fmtp:96 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d001f
[6515144168136924] Sending event to transport...
>> Pushing event: 0 (Success)
[WARN] [6515144168136924] Error resolving mDNS address (ec6a42c5-468e-4e5b-a6cd-6b94a8bd1ca8.local): Error resolving “ec6a42c5-468e-4e5b-a6cd-6b94a8bd1ca8.local”: Temporary failure in name resolution
[6515144168136924] Discovered new remote candidate for component 1 in stream 1: type=prflx
[6515144168136924] Stream #1, Component #1
[6515144168136924] Address: 146.241.77.84:38844
[6515144168136924] Priority: 1845501695
[6515144168136924] Foundation: remote1
[6515144168136924] Adding remote candidate component:1 stream:1 type:prflx 146.241.77.84:38844 --> 146.241.77.84:38844
[6515144168136924] Transport: UDP
[6515144168136924] ICE already started for this component, setting candidates we have up to now
[6515144168136924] ## Setting remote candidates: stream 1, component 1 (1 in the list)
[6515144168136924] Queueing candidate 0x7f5950003500 (startup)
[6515144168136924] Component state changed for component 1 in stream 1: 2 (connecting)
[6515144168136924] Processing candidate 0x7f5950003500
[6515144168136924] 1 remote candidate added
Got a Janus API request from janus.transport.http (0x7f5964001090)
Session 1371811771448677 found... returning up to 10 messages
Got a keep-alive on session 1371811771448677
Got a Janus API request from janus.transport.http (0x7f5964001090)
[6515144168136924] Trickle candidate (video): candidate:3819752924 1 udp 1677729535 146.241.77.84 38843 typ srflx raddr 0.0.0.0 rport 0 generation 0 ufrag PI80 network-cost 999
[6515144168136924] Adding remote candidate component:1 stream:1 type:srflx 0.0.0.0:0 --> 146.241.77.84:38843
[6515144168136924] Transport: UDP
[6515144168136924] Queueing candidate 0x7f59500033c0
[6515144168136924] Processing candidate 0x7f59500033c0
[6515144168136924] 1 remote candidate added
Got a Janus API request from janus.transport.http (0x7f5964005dd0)
No more remote candidates for handle 6515144168136924!
Got a Janus API request from janus.transport.http (0x7f5964001090)
Session 1371811771448677 found... returning up to 10 messages
Got a keep-alive on session 1371811771448677
[6515144168136924] New selected pair for component 1 in stream 1: 1 <-> remote1
[6515144168136924] Component is ready enough, starting DTLS handshake...
[6515144168136924] Component state changed for component 1 in stream 1: 3 (connected)
[6515144168136924] Component state changed for component 1 in stream 1: 4 (ready)
[6515144168136924] Creating retransmission timer with ID 10
[6515144168136924] DTLS established, yay!
[6515144168136924] Computing sha-256 fingerprint of remote certificate...
[6515144168136924] Remote fingerprint (sha-256) of the client is FE:58:FE:9E:11:28:A3:A2:6A:D6:0C:93:AC:7D:0B:E4:A0:D9:AE:22:BA:87:EE:B5:A8:D2:50:10:7D:72:CD:7C
[6515144168136924] Fingerprint is a match!
[6515144168136924] SRTP_AEAD_AES_256_GCM
[6515144168136924] Key/Salt/Master: 44/32/12
[6515144168136924] Created inbound SRTP session for component 1 in stream 1
[6515144168136924] Created outbound SRTP session for component 1 in stream 1
[6515144168136924] The DTLS handshake for the component 1 in stream 1 has been completed
[6515144168136924] The DTLS handshake has been completed
[6515144168136924] Telling the plugin about it (JANUS Streaming plugin)
[janus.plugin.streaming-0x7f596800d8f0] WebRTC media is now available
[6515144168136924] Sending event to transport...
>> Pushing event: 0 (Success)
[6515144168136924] Sending event to transport...; 0x7f5980003880
Video SSRC changed, 0 --> 3958561180
[6515144168136924] DTLS already set up, disabling retransmission timer!
On the front-end I see the “webrtcup” event and the track being attached to the player but soon after it gets removed:
What is going on? The server is still connected to the RTSP feed and with wireshark I still see UDP packets coming from it.