1.1.7 • Published 1 month ago

rtsp-to-hls-server v1.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

RTSP Stream to HLS Server Library

This Node.js library allows you to easily stream RTSP video to a HLS server. It supports H264 and is highly optimized and customizable.

Installation

To install this library, simply run:

npm install rtsp-to-hls-server

Usage

This code initializes a new instance of the Stream class with the specified parameters. The Stream class represents a video stream and is responsible for starting and stopping the stream.

This is a really simple abstraction for starting ffmpeg and use it with your own hls server

import * as HlsStream from "rtsp-to-hls-server";

const stream = await new HlsStream({
	name: `${port}`,
	ip: body.ip,
	streamUrl: rtspURL,
	streamMetadata: streamData,
	channel: channel,
	tempDir: tempPath,
	shouldStop: true, //boolean variable to indicate if timeout should kill the stream
	killTimeout: 10, // value in minutes for timeout to kill the stream
	customLogger: (message: string) => this.logger.log(message),
	ffmpegOptions: {
		"-c:v": "h264_amf",
		"-r": 25,
		"-threads": 1,
		"-flush_packets": 1,
		"-reconnect": 5,
		"-reconnect_at_eof": 1,
		"-timeout": 60,
		"-reconnect_streamed": 1,
		"-fflags": "nobuffer",
		"-rtsp_transport": rtspTransport ? rtspTransport : "tcp",
	},
});

License

This library is licensed under the MIT License.

1.1.7

1 month ago

1.1.6

1 month ago

1.1.5

1 month ago

1.1.4

1 month ago

1.1.3

2 months ago

1.1.2

6 months ago

1.1.1

9 months ago

1.1.0

9 months ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago