Streampunk / beamcoder

Node.js native bindings to FFmpeg.
GNU General Public License v3.0
399 stars 76 forks source link

"movflags" for segmented mp4 support #23

Open gmislan opened 5 years ago

gmislan commented 5 years ago

At the moment I'm trying to a setup where build a setup where beamcoder can be used to dynamically create portions of a fragmented mp4 stream for HLS and DASH playback. It seems I have encountered a potential non-started, however -- in order to correctly format the segmented mp4 container, movflags needs to be set to +frag_keyframe+empty_moov+default_base_moof.

It seems that at the moment, trying to set movflags in beamcoder returns unmapped type: flags to the muxer object. Is this not currently supported or is there a trick to being able to set the flags on the underlying muxer instance?

scriptorian commented 4 years ago

To set the movflags on the muxer, before calling writeHeader() you will need to call the asynchronous initOutput() method of the muxer with the object: `{ movflags: "frag_keyframe+empty_moov+default_base_moof`". I hope this does what you need!