• Stars
    star
    489
  • Rank 89,990 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 6 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

RTMP server in Nodejs for live streaming.

NodeStream

See complete tutorial here.

Install ffmpeg for RTMP to HLS transcoding

# On Ubuntu 18.04

$ sudo add-apt-repository ppa:jonathonf/ffmpeg-4
$ sudo apt install ffmpeg

# check version
$ ffmpeg --version

# You can download Windows builds from ffmpeg site.

Prerequisites

MongoDB

Make sure you have MongoDB installed on your system. We use Mongoose for accessing database. Check MongoDB docs on how to install MongoDB on your operating system.

Linux

Windows

Mac

Python 2.7

Make sure you have python 2.x installed and added to path.

Configuration

Change ffmpeg path in node media server configuration to your own installed path.

Also change secret string. It will be used for session encryption.

cd nodeStream && nano /server/config/default.js

const config = {
    server: {
        secret: 'kjVkuti2xAyF3JGCzSZTk0YWM5JhI9mgQW4rytXc',
        port : 3333
    },
    rtmp_server: {
        rtmp: {
            port: 1935,
            chunk_size: 60000,
            gop_cache: true,
            ping: 60,
            ping_timeout: 30
        },
        http: {
            port: 8888,
            mediaroot: './server/media',
            allow_origin: '*'
        },
        trans: {
            ffmpeg: '/usr/bin/ffmpeg',
            tasks: [
                {
                    app: 'live',
                    hls: true,
                    hlsFlags: '[hls_time=2:hls_list_size=3:hls_flags=delete_segments]',
                    dash: true,
                    dashFlags: '[f=dash:window_size=3:extra_window_size=5]'
                }
            ]
        }
    }
};

Install dependencies, build code and run server

$ npm install

# run webpack and watch for changes
$ npm run watch 

# run node server with supervisor and watch for changes
$ npm run start

Streaming with OBS

Go to Settings > Stream. Select Custom service and rtmp://127.0.0.1:1935/live in server input. Enter your streaming key issued by NodeStream and click Apply. Click start streaming to broadcast your stream.

More Repositories

1

Snipper

Snipping tool built with Electron, React and Node.js
JavaScript
82
star
2

laravel-stream

Transcoding media with FFmpeg using Laravel queues
PHP
52
star
3

NodeScheduler

Post scheduler for Facebook pages built with Node.js and React
JavaScript
47
star
4

Chatter

React + Express + Socket.io Chat App with GIFs support
JavaScript
41
star
5

nverter

Video converter web app build with Node, React and React
JavaScript
27
star
6

Aww-Bot

Messenger chatbot programmed to send images of cute cats and dogs pictures
JavaScript
20
star
7

LaravelGallery

An image Gallery built with Laravel and React
PHP
18
star
8

HackerNewsApp

Hacker News cross-platform desktop app build with React and Electron
JavaScript
12
star
9

laravel-pinterest

Laravel Pinterest API Wrapper Package
PHP
9
star
10

Laravel-React-Router

React Crypto app using React + React Router v4 example code
PHP
8
star
11

laravel-google-drive

Laravel Google Drive SDK Tutorial example code
PHP
8
star
12

laravel-instagram

Laravel app with Instagram API integration
PHP
7
star
13

Laravel-Facebook-SDK

Laravel Facebook SDK Tutorial example code
PHP
4
star
14

NetLogger

Monitor your internet downtime through ICMP echo
PHP
2
star
15

ReIMG-Native

Reddit Image Search App built with React Native
JavaScript
2
star
16

webpack-MCEP-plugin

Webpack Mini CSS Extract Plugin example
JavaScript
1
star
17

ReIMG

A simple Reddit image viewer and downloader
JavaScript
1
star
18

estok

Warehouse stock management web application
PHP
1
star
19

laravel-react-infinite-scroll

Laravel React Infinite Scrolling using paginator
PHP
1
star
20

Bulletin

PHP
1
star
21

Blogbits

Content Manager Assistant for Tumblr blogs and Facebook pages
PHP
1
star