A library for streaming images from an rtsp stream
Go to file
2020-11-01 20:31:10 -05:00
.vscode Adding very basic library to emit image events from ffmpeg rtsp stream 2020-11-01 16:50:24 -05:00
src Adding very basic library to emit image events from ffmpeg rtsp stream 2020-11-01 16:50:24 -05:00
.gitignore Updating build 2020-11-01 20:31:10 -05:00
package-lock.json Adding very basic library to emit image events from ffmpeg rtsp stream 2020-11-01 16:50:24 -05:00
package.json Adding very basic library to emit image events from ffmpeg rtsp stream 2020-11-01 16:50:24 -05:00
README.md Added readme 2020-11-01 17:02:25 -05:00
tsconfig.json Updating build 2020-11-01 20:31:10 -05:00

RTSP-Stream

A quick and dirty library to stream images or from a local RTSP stream

Installation

  1. Download FFMPEG

  2. Clone library into a directory with git clone ssh://git@thebword.ddns.net:3122/watsonb8/rtsp-stream.git

  3. Build library with npm run build

  4. Install library into project with npm install <path_to_library>

Sample

    import { Rtsp } from "rtsp-stream/lib/rtsp"

    const rtsp = new Rtsp("rtsp://example_username:example_password@192.168.1.1/live", {
        quality: 3,
        resolution: "1920x1080",
        codec: "libx264",
    })

    rtsp.on("data", (data: Buffer) => {
        fs.writeFile("path_to_output/file.jpeg", data, 'base64', (err) => {
            if(err){
                console.log(err)
            }
        });
    })