https://github.com/johndavedecano/node-rtmp-hls
NodeJS live stream server with HLS ABR support
https://github.com/johndavedecano/node-rtmp-hls
hls live nodejs srt streaming
Last synced: 2 months ago
JSON representation
NodeJS live stream server with HLS ABR support
- Host: GitHub
- URL: https://github.com/johndavedecano/node-rtmp-hls
- Owner: johndavedecano
- License: mit
- Created: 2019-12-16T03:16:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-11T17:20:43.000Z (over 3 years ago)
- Last Synced: 2025-03-17T22:08:18.116Z (about 1 year ago)
- Topics: hls, live, nodejs, srt, streaming
- Language: JavaScript
- Homepage: https://discord.gg/8vhwKyGK8X
- Size: 93.8 KB
- Stars: 68
- Watchers: 7
- Forks: 22
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NodeJS RTMP HLS Server
Based on node-media-server. A live streaming server that allow adaptive bitrate for HLS.
## Making it work using docker-compose
```
docker-compse build
docker-compose up
docker-compose down
```
## Making it work without using docker-compose
You have to make sure that you have ffmpeg installed on your machine
```
cp .env.example .env
yarn install
yarn start:dev # development
yarn start # production
```
### Environment Variables
```
NODE_ENV=development
# Where to store the playlist files
MEDIA_ROOT=./media
# Where is ffmpeg executable located. Run which ffmpeg
FFMPEG_PATH=/usr/bin/ffmpeg
# URL to notify when a stream starts.
# Usually used for authentication.
PUBLISH_START_NOTIFY_URL=
# URL to notify when a stream stoppes
PUBLISH_STOP_NOTIFY_URL=
```
### Installing FFMPEG on Centos
```
wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz
tar -xf ffmpeg-release-amd64-static.tar.xz
sudo mkdir -p /usr/local/bin/ffmpeg
sudo mv ./ffmpeg-4.2.2-amd64-static/* /usr/local/bin/ffmpeg
sudo ln -s /usr/local/bin/ffmpeg/ffmpeg /usr/bin/ffmpeg
sudo ln -s /usr/local/bin/ffmpeg/ffprobe /usr/bin/ffprobe
# Verify installation
which ffmpeg && ffmpeg -version
```
## From OBS
```
Settings -> Stream
Stream Type : Custom Streaming Server
URL : rtmp://localhost:1935/live
Stream key : STREAM_NAME
```
## Accessing the live stream
```
HLS - http://localhost:8000/live/STREAM_NAME/index.m3u8
FLV - http://localhost:8000/live/STREAM_NAME.flv
WSS - ws://localhost:8000/live/STREAM_NAME.flv
RTMP - ws://localhost:8000/live/STREAM_NAME
```
## Cluster Mode
Ask me how