Question

I have two MP4 files I need to concatenate and I need to do this programmatically - i.e. command line tools are not going to cut it. ffmpeg is not a possibility from a licensing point of view.

For clarity, there is no preview, poster, edit or any other complexity. The MOVs are about the simplest they could be (H.264 encoded, video only - no audio, one TRAK per file).

I believe that "all" I need to do is to : - concatenate the MDATs into a single block - update all elements of the STBL box/atom i.e. STSZ, STCO, etc. to reflect the new sample structure - propagate the new duration throughout MVHD, TKHD, MDHD atoms.

In particular, I don't think I need to examine or process the internals of the MDAT atom at all.

Is this correct or am I missing something ?

Was it helpful?

Solution

So the answer here seems to be yes. I've manually constructed a file in this way and provided all the sample table entries are ok, the MDATs can simply be concatenated. This is based on the assumption (true in my case) that the config of the two files is consistent, i.e. frame size, avcC box etc.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top