From a3d64fb00b2e1cadbfbc3f34138488f21e9791cc Mon Sep 17 00:00:00 2001 From: watsonb8 Date: Sun, 1 Nov 2020 17:02:25 -0500 Subject: [PATCH] Added readme --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..82d070b --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# RTSP-Stream + +A quick and dirty library to stream images or from a local RTSP stream + +## Installation + +1. Download FFMPEG + +1. Clone library into a directory with `git clone ssh://git@thebword.ddns.net:3122/watsonb8/rtsp-stream.git` + +1. Build library with `npm run build` + +1. Install library into project with `npm install ` + +## 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) + } + }); + }) +```