how to create mp4 file chunks with File.Sink.Multi and ISOM
My goal is to create a file every few seconds of every few buffers. My approach was to modify File.Sink.Multi and ISOM, and I think I’m close but I’m seeing issues in all but the first file. All the secondary files have the wrong duration and are empty for the first portion of it. Has someone implemented this before? Is there a plugin I can use for this?
Otherwise could someone give me some pointers on how to finish this? I believe I modified Multi correctly to handle Seek Sink events. Now with ISOM I finalize the mp4 whenever I get enough buffers, and send the actions. I believe the issue I have is around figuring out how to reset some of the state in the pad tracks so that the timing is correct without restring the tracks completely. Could I get some pointers around this and possibly the actions to send?
1 Reply
Hello! Could you share some code with us? What's especially interesting is how you have modified the ISOM muxer.
What I suspect that might be happening is that metadata (
:moov
atom of an .mp4 file) is present only in the first file.
Is there a plugin I can use for this?It depends on what you try to achieve. There is a plugin: https://github.com/membraneframework/membrane_http_adaptive_stream_plugin that is capable of creating an HLS playlist with fragmented MP4 chunks, which seems to be a similar scenario to yours. The main difference is that it generates fMP4 chunks, and it also generates playlist's manifest along the way.
GitHub
GitHub - membraneframework/membrane_http_adaptive_stream_plugin: Pl...
Plugin generating manifests for HLS (DASH support planned) - membraneframework/membrane_http_adaptive_stream_plugin