Question

I'm looking to write already compressed (h264) image data into an MPEG-4 video file. Since this code needs to be optimized to run on an embedded platform the code should be as simple as possible. Best would be to just give some header information (like height width format fourcc etc.) and a filename and the compressed data and have that transformed into a data chunck and writen to that file.

So what i need either of these:

  • MPEG-4 header information (what goes where exactly)
    • Is there a main header or are there just headers for each data chunck
    • What header information is needed for a single video stream (rectangular)
    • What header information is needed for adding audio
  • A simple MPEG-4 file writer that does not have to do the compression itself and also allows to add audio frames. (c/c++)
Was it helpful?

Solution

.MP4 file format is described in MPEG-4 Part 14 specification. It is not just main header and subheaders, it has certain hierarchy and so called boxes in there. Some of your choice to write data into .MP4 file:

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