Skip to content

Instantly share code, notes, and snippets.

@crazyoptimist
Last active March 3, 2023 22:25
Show Gist options
  • Save crazyoptimist/bc8824acb83b5bbd694f345ec0a8382c to your computer and use it in GitHub Desktop.
Save crazyoptimist/bc8824acb83b5bbd694f345ec0a8382c to your computer and use it in GitHub Desktop.
Live Stream Server Deployment
const NodeMediaServer = require('node-media-server');
const config = {
rtmp: {
port: 1935,
chunk_size: 10000,
gop_cache: true,
ping: 30,
ping_timeout: 60
},
http: {
port: 8000,
mediaroot: './media',
allow_origin: '*'
},
trans: {
ffmpeg: '/usr/bin/ffmpeg',
tasks: [
{
app: 'live',
hls: true,
hlsFlags: '[hls_time=2:hls_list_size=4:hls_flags=delete_segments]',
dash: true,
dashFlags: '[f=dash:window_size=3:extra_window_size=5]'
}
]
}
};
const nms = new NodeMediaServer(config)
nms.run();
@crazyoptimist
Copy link
Author

crazyoptimist commented Jun 6, 2020

Remux to HLS/DASH live stream

In redmux senario, you MUST install ffmpeg 4.x version on your server first!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment