Problem connecting to camera via RTSP

Francois Nel

New Member
We having trouble connecting to an RTSP feed from a camera (which we want to stream to a web page via WebRTC).
We get the following in flashphoner.log:
upload_2017-4-24_13-27-47.png


The RTSP feed definitely works, because if we use VLC, it plays the video feed from the same RTSP URL

We can also telnet to the camera's RTSP port and do manual RTSP commands to it for which we get valid responses, eg:
upload_2017-4-24_13-25-47.png


Is there a way we can better debug the issue? Maybe a trace of what RTSP responses flashphoner get from the camera? Or anything that will show us what causes the issue?
 

Max

Administrator
Staff member
Please zip and send logs and conf to logs@flashphoner.com:
Code:
/usr/local/FlashphonerWebCallServer/conf
/usr/local/FlashphonerWebCallServer/logs/server_logs
tcpdump -s 4096 -w log.pcap
Please also open your RTSP stream in VLC and check used codecs.
Tools - Codec information:

codec-info.jpg
 

Francois Nel

New Member
Here is the codec information:

upload_2017-4-24_15-12-20.png


I have done a tcpdump (only of the second network card where the camera is located and only of IP 14.196.202.21), and I sent it to logs@flashphoner.com

We probably should note that we have 2 interfaces:
10.196.204.52/24 (def gw 10.196.204.1)
14.196.202.52/24 (no gw)

Network 10.196.204.0/24 does not route to 14.196.202.0/24 network, therefor the second network (only used for cameras)
 

Max

Administrator
Staff member
According logs your WCS server is bound on IP address 10.196.204.52
To get this working you can try to bind
Code:
ip = 14.196.202.52
ip_local=14.196.202.52
in flashphoner.properties
then do
Code:
service webcallserver restart
 

Francois Nel

New Member
that made the RTSP work, but wont stream the feed to the browser. Your demo app actually says "PLAYING" this time round, but no video:
upload_2017-4-24_17-20-57.png



The image grab above (where we loaded the demo app) is on a machine also with 2 network cards:
10.196.204.35/24 (def gw 10.196.204.1)
14.196.202.50/24 (no gw)

I have sent updated logs
 

Francois Nel

New Member
Also, when the server will be used it would be used from machines on 10.196.204.0/24 (without any card on 14.196.202.0/24). So it kind of does not make sense to have flashphoner (only) bind to 14.196.202.52, because only the cameras are on 14.196.202.0/24. The "local" network is seen as 10.196.204.0/24
 

Max

Administrator
Staff member
Please send pcap log. It is more helpful.

If your server is 10.196.204.35
It should have a route and connection to the cam 14.196.202.21, port 8557
What is your IP?
If your IP is 10.196.204.36 (for example), you should be able to receive UDP traffic from 10.196.204.35 [ports 31000-32000 by default] and send UDP packets to server 10.196.204.35 [the same range of ports].

On your first dump I see that server 10.196.204.35 can't connect to cam 14.196.202.21:8557.
Please provide the second dump.
My assumption is RTSP ports should be bound on IP 14.196.202.52 but WebRTC ports should be bound on IP 10.196.204.3.
However you say that WCS should be in the network 10.196.204.0/24. If so, you have to investigate why connection 10.196.204.52 -> 14.196.202.21:8557 was failed.
 
Last edited:

Francois Nel

New Member
We are in a very restrictive environment and we cannot use flash (or at least we cannot update it so that it will work)
We solved the whole RTSP issue by setting the following properties:
ip =10.196.204.52
ip_local =0.0.0.0

Setting ip_local to 0.0.0.0 makes WCS not bind sockets to a specific network card and then RTSP connections are done on the network card that has the route for the 14.196.202.0/24 (second nic) network while still serving WebRTC peers on the 10.196.204.0/24 network (first nic)

The problem now is that we can see the video is streamed to the browser via the chrome://webrtc-internals, but the video is simply not rendered:

upload_2017-4-25_9-8-8.png
 

Max

Administrator
Staff member
Try to change codec priority and set vp8 before h264 in flashphoner.properties
Replace
Code:
codecs=opus,alaw,ulaw,g729,speex16,g722,mpeg4-generic,telephone-event,h264,vp8,flv,mpv
With
Code:
codecs=opus,alaw,ulaw,g729,speex16,g722,mpeg4-generic,telephone-event,vp8,h264,flv,mpv
Then do
Code:
service webcallserver restart
 

Max

Administrator
Staff member
If you have a chance to share your RTSP stream, please send RTSP url to logs@flashphoner.com. We will test and debug.
If you can't share the stream, please provide
1. Pcap file
Code:
tcpdump -s 4096 -w log.pcap
2. Output of ffprobe command
Code:
ffprobe -loglevel debug -i 'rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov'
You have to install ffmpeg to get this probe.
3. Debug logs
To prepare debug logs,
1) Cleanup content of folder
Code:
/usr/local/FlashphonerWebCallServer/logs/client_logs
2) Set in flashphoner.properties
Code:
client_log_level=debug
3) Do
Code:
service webcallserver restart
4) Make a test and zip folder /usr/local/FlashphonerWebCallServer/logs/client_logs
4. Camera specification
Name, product URL, etc.
 

Max

Administrator
Staff member
Did you play with chrome flags? If yes, you might touch some flags affecting WebRTC features.
 
Top