MayaPosch/NymphCast

MP4 Playback (files >100mb)

Closed this issue · 2 comments

The current approach is to stream MP4 files as whole since the header is appended to the end of the file.

Why don't we just read the file on the requesting side and send the metadata first so the protocol can decide what to do with those files and - if the file is unsupported, reject early.

This would have the benefit, that files don't need to get streamed before and also reduce computing load on server's end.

In case of remote resources this approach will not work, for MP4 files. But maybe there also a way to do that.

Only the first N bytes of the MP4 file are currently streamed (until the buffer is full). Ffmpeg will attempt a seek action if it hasn't found the header. Seeking support has currently been implemented (though untested), which should allow for MP4 files that are larger than buffer size to play back successfully.

This will be tested the coming time.

Seeking support has been fully implemented and tested. Files of (in theory) unlimited size can be played back, including MP4s.

Feel free to test it and create a new ticket if any issues have been encountered :)