I am building a web application that consists of a web client and a server. The web client needs to play a continuous stream of MP4 files to the user, preferably through a player like video.js
. The problem is that I need to stream the MP4 files in my own protocol rather than something like DASH or HLS. The reason for this is that I cannot create a manifest file for my chunks and that I need to add more messages to the server to prepare the MP4 files.
In a nutshell, my server needs to fetch some files from some archive storage, convert them to MP4, transcode them and then send them to my client. Fetching the files can take up to 30 seconds. I also do not know all files I have available, so I cannot create a manifest that would tell the client how early this stream goes back in time.
My solution is simply to have logic on the client to fetch the MP4 files from the server and play them to the client. The problem I am facing at the moment is that when I try to play MP4 files one after another in my client player (video.js), there is slight stuttering when a file ends and a new one starts playing. So this doesn't feel like a long continuous stream.
The solution I am exploring at the moment would be to convert the MP4 files to MP4 fragments and stream them, but I do not know how this would work considering that I would try to concatenate fragments from different MP4 files.
How would you go about playing an originally continuous video stream when this stream has been fragmented in multiple MP4 files?