Giter Site home page Giter Site logo

node-rtmp-hls's Introduction

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

node-rtmp-hls's People

Contributors

johndavedecano avatar ltlabsdev1 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.