Intended to help play RTSP streams from IP Cams (and some other URL types) in browsers.
Online demo: http://ipcam.stream:5080
- Run:
sudo snap install rtsp-to-webrtsp --edge
; - Open in your browser:
http://your.server.address:5080/
;
sudoedit /var/snap/rtsp-to-webrtsp/common/restreamer.conf
;- To load updated config it's required to restart Snap:
sudo snap restart rtsp-to-webrtsp
;
- In config replace
streamers
section with something like
streamers: (
{
name: "Your source name"
url: "rtsp://your.ip.cam.address:port/path"
}
)
- Restart Snap:
sudo snap restart rtsp-to-webrtsp
;
- In config file in
webrtc
section uncommentstun-server
(and maybe replace value with your preferable STUN server),min-rtp-port
andrtp-ports-count
(and provide some reasonable values)
webrtc: {
stun-server: "stun://stun.l.google.com:19302"
min-rtp-port: 6000
rtp-ports-count: 100
}
- [optional] prevent Coturn from starting (it's useless in that case) by
use-coturn: false
inagents
section
agents: {
use-coturn: false
}
- Configure port forwarding on your router for following ports:
- TCP 5080
- TCP 5554
- UDP 6000-6100 (or what you've specified in
webrtc
section)
- Restart Snap:
sudo snap restart rtsp-to-webrtsp
; - Open in your browser http://your.router.ip.address:5080/
- Install it on some VPS/VDS/Dedicated with public IP;
- [optional][recommended] Configure TLS and users in
users
section of config file; - In config file replace (or add to)
streamers
sectionproxy
streamer for Remote Agent
streamers: (
{
name: "Proxy for Remote Agent"
type: "proxy"
agent-token: "some random and pretty long string"
}
)
- Restart Snap:
sudo snap restart rtsp-to-webrtsp
; - Install app Snap package on some device on network where IP Cam is accessible directly and configure it as Remote Agent ;
- Open in your browser https://your.server.address:5443/ if you have TLS enabled and http://your.server.address:5080/ if not;
- Install it on some device (you can use something like Raspberry Pi);
- Add
signalling-server
section with the same properties you've defined on the server
signalling-server: {
host: "your.server.address"
tls: true // or `false` if you didn't configure TLS on server
uri: "Proxy for Remote Agent"
token: "some random and pretty long string"
}
- Configure streamer for IP Cam you want access to ;
- Restart Snap:
sudo snap restart rtsp-to-webrtsp
;
- In config file replace
streamers
section with something like
streamers: (
{
restream: false
name: "DVR"
type: "record"
record-token: "some-random-string"
recordings-dir: "recordings" // path relative to %SNAP_COMMON% (/var/snap/rtsp-to-webrtsp/common/) where recordings will be placed
recordings-dir-max-size: 1024
recording-chunk-size: 10
}
)
- Restart Snap:
sudo snap restart rtsp-to-webrtsp
; - Install webrtsp-record-streamer Snap package on some device on network where IP Cam is accessible directly;
- Configure
webrtsp-record-streamer
as described here; - Finally with above config recordigns will be available in
/var/snap/rtsp-to-webrtsp/common/recordings/DVR/
;
- Run:
./enableTLS.sh root@your.server.address:22 you@gmail.com
; - Open in your browser:
https://your.server.address:5443/
;
- To see application logs in realtime run:
sudo snap logs rtsp-to-webrtsp -f
;