{"library":"node-rtsp-stream","title":"RTSP to WebSocket Stream for JSMpeg","description":"node-rtsp-stream is a Node.js package designed to convert real-time streaming protocol (RTSP) video feeds into WebSocket streams for consumption by client-side libraries like JSMpeg, enabling HTML5 video playback in browsers. The package, currently at version 0.0.9, was last published in February 2020. It acts as a wrapper around the `ffmpeg` executable, which must be independently installed on the system, to handle the heavy lifting of decoding and re-encoding video. Its primary differentiation lies in its direct integration with JSMpeg for low-latency, canvas-based browser playback, making it suitable for basic live video surveillance or embedded system applications. Due to its age, it primarily supports CommonJS and has not seen active development or major releases in several years, indicating a static or abandoned status.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install node-rtsp-stream"],"cli":null},"imports":["const Stream = require('node-rtsp-stream')","const myStream = new Stream({...})"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const Stream = require('node-rtsp-stream');\n\nconst stream = new Stream({\n  name: 'my-rtsp-stream',\n  streamUrl: 'rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov', // Replace with your RTSP URL\n  wsPort: 9999,\n  ffmpegOptions: { // Options passed directly to ffmpeg\n    '-stats': '', // Show ffmpeg stats\n    '-r': 30,     // Output framerate (important for JSMpeg compatibility)\n    '-vcodec': 'mpeg1video', // Ensure output is MPEG1 video\n    '-f': 'mpegts' // Output format as MPEG Transport Stream\n  }\n});\n\nconsole.log(`RTSP stream starting on ws://localhost:${stream.wsPort}`);\nconsole.log('Ensure ffmpeg is installed and accessible in your system PATH.');\nconsole.log('A client (e.g., JSMpeg) can connect to this WebSocket port.');\n\n// Basic error handling for the stream process\n// Note: This package has limited direct error event exposure beyond ffmpeg process exit\n// More robust error handling might involve monitoring the ffmpeg child process.\nprocess.on('SIGINT', () => {\n  console.log('Stopping stream...');\n  // In a real application, you might want a .stop() method or similar\n  // As this package doesn't expose a direct stop, the process will exit.\n  process.exit(0);\n});","lang":"javascript","description":"Sets up a Node.js server to convert an RTSP stream into a WebSocket stream for client-side consumption, requiring a pre-installed `ffmpeg`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}