Last active
March 3, 2023 22:25
-
-
Save crazyoptimist/bc8824acb83b5bbd694f345ec0a8382c to your computer and use it in GitHub Desktop.
Live Stream Server Deployment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Remux to HLS/DASH live stream
In redmux senario, you MUST install ffmpeg 4.x version on your server first!!