I'm trying to rebuild a video file from a Smooth Streaming server. Smooth Streaming serves fMP4 files which are regular MP4 files without neither their FTYP nor their MOOV atoms.
All the informations stored in those atom are placed into a Manifest XML file, which I have.
Is there a way to programmatically rebuild the original MP4 file, either by:
Or else, is there a tool which can merge fMP4?
A fragmented MP4 file consists of the usual MovieBox with the TrackBoxes to signal which media streams are available. A Movie Extends Box (mvex) is used to signal that the movie is continued in the fragments. Another advantage is that fragments can be stored in different files.
MOOV Relocator is a well documented small library written in PHP to relocate (or move) the MOOV-Atom of MP4-Files from the end to the beginning of a file. In H. 264-based video formats (mp4, m4v) the metadata is called a "moov atom".
The MDAT atom contains actual audio and video data. The MOOV atom contains information about how to extract data from MDAT, it gives references to chunks (samples).
An atom is a self-contained data unit containing information about the video file. The moov atom, aka movie atom, defines the timescale, duration, and display characteristics of the movie, as well as sub-atoms containing information for each track in the movie.
Yes. It is completely possible.
You can do this with FFmpeg. Study the mov.c [MP4 demuxer] from libavformat.
You will need to complete the MP4 in memory with all data that is "missing" in the fMP4. In other words, when you need an atom that doesn't exist in fMP4 [almost all], you will have to input all information hard-coded (such information, most of them come from the manifest).
It's not easy... but for sure it's possible. I've done by 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 one can understand what is already in the fMP4 and what is not!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With