Recover MP4 file from fragmented MP4 atom "mdat"?

I am trying to rebuild a video file from a Smooth Streaming server. Smooth Streaming is for fMP4 files, which are regular MP4 files without their FTYP or their MOOV atoms.

All the information stored in these atoms is placed in the XML manifest file that I have.

Is there a way to programmatically rebuild the original MP4 file, either:

  • restore a new file directly from the contents of H264 / AAC located in the MDAT (and image format information); or
  • atom reduction FTYP and MOOV

Or else, is there a tool that can integrate fMP4?

+6
source share
2 answers

Yes. It is possible.

You can do this with ffmpeg. Examine mov.c [MP4 demultiplexer] from libavformat.

You will need to fill MP4 in memory with all the data that is "missing" in fMP4. In other words, if you need an atom that does not exist in fMP4 [almost all], you will have to enter all the hardcoded information (such information, most of it comes from the manifest).

It’s not easy ... but it’s probably possible. I did it myself. Unfortunately, the code is not my property.

Good luck !; -)

UPDATE: the PIFF format specification will be very useful ( http://go.microsoft.com/?linkid=9682897 ) so that you can understand what is already in fMP4 and what is not!

+3
source

Just rebuild the mp4 file if there is an ism and ismc file that is associated with fragmented mp4 files.

Please know the type of media, the type of codec, specific codec data, and the timeline of each track for restoring the moov and ftyp atom.

this information can be obtained from the ism and ismc file.

You can get the media type of each track from the ism file. you can get the codec type, specific codec data and the timeline of each track from the ismc file.

just the ism / ismc files are the metadata for the server and client, so you can rebuild the metadata (ftyp, moov atom) for the mp4 file.

0
source

Source: https://habr.com/ru/post/922562/


All Articles