Created
June 9, 2023 02:08
-
-
Save mntone/49cc0dd2a08a32d074e8fc5ae426f055 to your computer and use it in GitHub Desktop.
This is to generate MPEG-DASH stream with MP4box on node.js. It's simply approach, but we cannot use webm container. I use ffmpeg for MPD generation now.
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
function runMP4box(files) { | |
const args = ['-dash', '2000', ...files, '-segment-name', 'seg', '-out', 'dash/test.mpd'] | |
console.log(args) | |
const mp4box = spawn('mp4box', args) | |
return mp4box | |
} | |
function runMP4boxAsPromise(files) { | |
return new Promise(resolve => { | |
const mp4box = runMP4box(files) | |
mp4box.on("close", resolve) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment