kevinGodell/mp4frag

Is there any way of handling "mdat not found" error cleanly

karlbrowns opened this issue · 1 comments

I haven't found what in my stream causes this error to occur, but occasionally it does. At which point my web server crashes. I need to a) handle it so that the webserver doesn't crash and b) handle it so that mp4frag can restart and continue to play the video once it does find a valid mdat.

mp4frag.on('error'). The server will crash if you do not have an 'error' event listener as that is the nature of nodejs. If you get any error from mp4frag, it cannot continue due to corrupted or missing data. The best thing to do is call mp4frag.resetCache() which will put it back to its default state and clear all of the internal buffers. Then start your video feed new and pipe it in the mp4frag. That is my best guess without having a sample of your code or ffmpeg commands. Also, you can try using my unreleased version of mp4frag. You would have to do a npm install kevinGodell/mp4frag and that will give you the latest version that I have not had time to clean up and release. But, it has been fully field tested by my friends at nodered.org where i am developing an experimental streaming video solution. Currently it works great for me with 14 ip cams that run 24/7 and are available to watch in all modern browsers.