rtsp2mjpeg
v1.5.7
Published
turn an rtsp stream into a localhost jsmpeg stream
Downloads
111
Readme
rtsp2mjpeg
This is a simple RTSP to MJPEG proxy server. It can be used to convert an RTSP stream to MJPEG stream. The stream works with jsmpeg.
Installation
[sudo] npm install -g rtsp2mjpeg
Install ffmpeg: https://ffmpeg.org/download.html
Usage
rtsp2mjpeg <rtsp-stream-url> \
<ws-url> (optional; default=null) \
<test-port> (optional; default=3000) \
<internalPort> (optional; default=9999) \
<fps> (optional; default=30) \
<size> (optional; default=1920x1080)
Example
rtsp2mjpeg rtsp://192.168.0.247:8554/live \
ws://localhost:3000 \
3000 \
9999 \
30 \
1920x1080
Dependencies
- ffmpeg
- nodejs
- npm
- forever-monitor
Running in Background
nohup rtsp2mjpeg rtsp://........... &
To view nohup output:
tail -f nohup.out -f
To see nohup jobs:
jobs
To kill a nohup job:
kill %1
Integration into any website via jsmpeg
<!DOCTYPE html>
<html>
<head>
<title>RTSP to MJPEG</title>
</head>
<body>
<canvas id="video-canvas"></canvas>
<script src="https://cdn.jsdelivr.net/npm/jsmpeg@2"></script>
<script>
var canvas = document.getElementById('video-canvas');
var player = new JSMpeg.Player('ws://localhost:[WebSocket Port]', {canvas: canvas});
</script>
</body>
</html>
Known Issues
- May need to install forever-monitor globally
[sudo] npm install -g forever-monitor