rtsp-ws-proxy allows to transfer rtsp-stream from ip-camera to a web browser via websockets. The output video stream is broadcast in the MPEG1 video-format (the audio decoding not implemented. You can add audio-decoding options if it needed). ffmeg is used to decode the input rtsp-stream (https://www.ffmpeg.org/).
- copy streams.yml into /etc/rtsp-ws-proxy/
- fill streams.yml like this
server:
port: 8080
cameras:
- name: camera1
stream: rtsp://91.191.213.49:554/live_mpeg4.sdp
wsPort: 8081
protocol: tcp #optional. Default: tcp
fps: 25 #optional. Default: 25
bitrate: 5000k #optional. If does not set, parametr not usung.
- name: camera2
stream: rtsp://195.46.114.132/live/ch00_0
wsPort: 8082
protocol: udp
fps: 20
...
- start rtsp-ws-proxy.js via node.js or start rtsp-ws-proxy
- on web page you can use jsmpeg.js or similar.
Example with jsmpeg
<script src="jsmpeg.min.js"></script>
<div class="camera" data-url="ws://localhost:8081"></div> <!--stream from first camera-->
<div class="camera" data-url="ws://localhost:8082"></div> <!--stream from second camera-->