How to convert rtsp to webrtc

Eric Lapouyade

New Member
Hi all,
I would like to convert and serve (one to many) a stream from rtsp://IP1:port1/URL1 to webRTC : how do I configure that onto flashphoner ?
 

Eric Lapouyade

New Member
I put wss://localhost:8443 in "WCS URL" field, the connection is "established",
I put 1111 in "Publish" field, then
I put rtsp://x.x.x.x:55480/axis-media/media.amp?videocodec=h264 in "Play" field but it does not work : I get a "FAILED"
If I use the same URL with vlc, it is running fine (full HD stream at about 900kbs).
If I use rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov in the "Play" field, it works fine
vlc shows the axis camera rtsp stream after 13s (it's long) but in your web interface it gives up after 10s : may be there is a timeout to tune somewhere : How can I fix that ?
 
Last edited:

Max

Administrator
Staff member
Could you share your RTSP cam for external users?
If so, please send us your RTSP URL to support@flashphoner.com
We will check.

WCS works in two RTSP modes
1) Interleaved mode (TCP) - by default
2) Non-interleaved mode (UDP)
Try to turn interleaved mode off
Code:
rtsp_interleaved_mode=false
in /usr/local/FlashphonerWebCallServer/conf/flashphoner.properties
Then do
Code:
service webcallserver restart
Regarding the delay, it can be caused by RTSP session initializing. IF RTSP session is initialized, second user should be able to connect much faster.
 

Eric Lapouyade

New Member
Unfortunately, the rtsp stream is in a LAN, You cannot reach our network.
I tried rtsp_interleaved_mode=false and restart but it did not help :
Code:
# tail -f /usr/local/FlashphonerWebCallServer/logs/flashphoner_manager.log
09:39:25,675 INFO  agerRemoteRmiService - RMI TCP Connection(4)-127.0.0.1 RECEIVED REST OBJECT <==
URL:http://localhost:9091/EchoApp/StreamStatusEvent
OBJECT:
{
  "nodeId" : "3wIgrCQJCBRkkhFghoZ3Dbq2cacmRme6@192.168.1.39",
  "appKey" : "defaultApp",
  "sessionId" : "/127.0.0.1:54086/127.0.0.1:8443",
  "mediaSessionId" : "67823b34-3178-47f2",
  "name" : "rtsp://192.168.254.10:554/axis-media/media.amp?videocodec=h264&camera=1&streamprofile=Eos_low",
  "published" : false,
  "hasVideo" : true,
  "hasAudio" : true,
  "status" : "FAILED",
  "sdp" : "v=0\r\no=- 1499894241545001938 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio video\r\na=msid-semantic: WMS\r\nm=audio 44112 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 126\r\nc=IN IP4 192.168.1.39\r\na=rtcp:57836 IN IP4 192.168.1.39\r\na=ice-ufrag:0ln1y1CdPAjcq0mN\r\na=ice-pwd:YIumFgtz3YyQjlYLsFwR3CI1\r\na=fingerprint:sha-256 56:B0:57:D1:89:36:EB:BB:E5:68:15:9F:E0:49:09:EB:D2:64:8C:DB:20:92:CD:33:6A:16:35:27:20:A3:5A:81\r\na=setup:actpass\r\na=mid:audio\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=recvonly\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\na=rtcp-fb:111 transport-cc\r\na=fmtp:111 minptime=10;useinbandfec=1\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:104 ISAC/32000\r\na=rtpmap:9 G722/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:106 CN/32000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:126 telephone-event/8000\r\na=maxptime:60\r\nm=video 41784 UDP/TLS/RTP/SAVPF 100 101 116 117 96 97 98\r\nc=IN IP4 192.168.1.39\r\na=rtcp:33940 IN IP4 192.168.1.39\r\na=ice-ufrag:0ln1y1CdPAjcq0mN\r\na=ice-pwd:YIumFgtz3YyQjlYLsFwR3CI1\r\na=fingerprint:sha-256 56:B0:57:D1:89:36:EB:BB:E5:68:15:9F:E0:49:09:EB:D2:64:8C:DB:20:92:CD:33:6A:16:35:27:20:A3:5A:81\r\na=setup:actpass\r\na=mid:video\r\na=extmap:2 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:4 urn:3gpp:video-orientation\r\na=recvonly\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:100 VP8/90000\r\na=rtcp-fb:100 ccm fir\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 nack pli\r\na=rtcp-fb:100 goog-remb\r\na=rtcp-fb:100 transport-cc\r\na=rtpmap:101 VP9/90000\r\na=rtcp-fb:101 ccm fir\r\na=rtcp-fb:101 nack\r\na=rtcp-fb:101 nack pli\r\na=rtcp-fb:101 goog-remb\r\na=rtcp-fb:101 transport-cc\r\na=rtpmap:116 red/90000\r\na=rtpmap:117 ulpfec/90000\r\na=rtpmap:96 rtx/90000\r\na=fmtp:96 apt=100\r\na=rtpmap:97 rtx/90000\r\na=fmtp:97 apt=101\r\na=rtpmap:98 rtx/90000\r\na=fmtp:98 apt=116\r\n",
  "info" : "Failed to connect to rtsp stream",
  "record" : false,
  "width" : 0,
  "height" : 0,
  "bitrate" : 0,
  "quality" : 0,
  "mediaProvider" : "WebRTC"
}

How can I activate debug mode ?
 

Max

Administrator
Staff member
As I can see from logs, you are using https and websocket connection to local port 127.0.0.1:8443 is failed by timeout.

1. If you are using secure wss://127.0.0.1:8443 connection
a) You should use https:// page
b) You may need to open empty page https://127.0.0.1:8443 before testing
c) If your browser requires to accept SSL certificates, please do that.

2. You can use the RTSP player over non-secured http
a) Open the testing page via HTTP
b) Use http:// page and ws://127.0.0.1:8080

3. Make sure that ports 8443(Websocket SSL) and 8080(Websocket) are open for TCP connections and not affected by firewall or not bound by another software.
 

Eric Lapouyade

New Member
You said that local port 127.0.0.1:8443 is failed by timeout, but when I press connect button, I see "ESTABLISHED", so the timeout should be more to read the rtsp stream, on VLC it takes 13s to get started.

When I use https://127.0.0.1:8888, it still does not work with your tips.
your demo site does not accept simple http (http://127.0.0.1:8888)
On https, I tried ws://127.0.0.1:8080 but connect failed.
 

Eric Lapouyade

New Member
Now I can connect to ws://127.0.0.1:8080, but the the rtsp stream still cannot be read (timeout in the logs).
May we can force TCP to avoid to loose some time trying UDP ...
I just sent you logs and conf dirs to your email.
 

Max

Administrator
Staff member
It does not work because WCS server(192.168.1.39) could not establish TCP (RTSP) connection with your RTSP: 192.168.254.10:554
Please check if this connection available from 192.168.1.39
If you are sure that connection is valid, please make tcpdump log:
tcpdump port 554 -s 4096 -w log.pcap
This log should contain RTSP (port 554) traffic.
Please send us this log or fix connection issue between 1.39 and 254.10:554
 
Top