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?

  • I feel that's more a programming challenge that should go on Stackoverflow than a video production question.
    – Matt
    Feb 9, 2021 at 18:16
  • @Matt I am not yet at the programming challenge part. At the moment, I am simply trying to figure out what format I should be sending to my client so that I can merge my chunk together in some sort of byte array to play a seamlessly continuous video. Can I take two different MP4 files, fragment them, and then just join the bytes in my client to play a continuous video? Those are the sort of questions I am facing at the moment. Feb 9, 2021 at 18:23
  • I'm not sure I get your use case, but it might be useful to take a look at the nginx-vod-module by Kaltura. It features a mapped/remote mode where you can specify, through a JSON file, sequences of clips that are then concatenated and JIT-transmuxed to produce HLS/DASH/progressive download streams.
    – mcont
    Feb 12, 2021 at 23:22


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.