Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/waleedahmad/node-stream
RTMP server in Nodejs for live streaming.
https://github.com/waleedahmad/node-stream
ffmpeg livestream nodejs rtmp
Last synced: 14 days ago
JSON representation
RTMP server in Nodejs for live streaming.
- Host: GitHub
- URL: https://github.com/waleedahmad/node-stream
- Owner: waleedahmad
- License: mit
- Created: 2018-10-07T13:30:27.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T04:08:12.000Z (almost 2 years ago)
- Last Synced: 2024-08-01T19:38:07.630Z (3 months ago)
- Topics: ffmpeg, livestream, nodejs, rtmp
- Language: JavaScript
- Homepage: https://quantizd.com/building-live-streaming-app-with-node-js-and-react/
- Size: 1.87 MB
- Stars: 482
- Watchers: 24
- Forks: 217
- Open Issues: 31
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
### NodeStream
See complete tutorial [here](https://quantizd.com/building-live-streaming-app-with-node-js-and-react/).
#### 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
#### MongoDBMake 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](https://docs.mongodb.com/manual/administration/install-on-linux/)
[Windows](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/)
[Mac](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/)#### 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.jsconst 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 OBSGo 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.