angelu2001 / php-reader

Automatically exported from code.google.com/p/php-reader
0 stars 0 forks source link

Add support for progressive download of QuickTime (QT) and other ISO14496 files #23

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
From: Ben.C

1. the moov-atom is often located at the end of a mp4 file. as you can read
in the spec. the following lines are taken from ISO-14496 PDF:

page 10:
...It is recommended that the progressive download information box be
placed as early as possible in 
files, for maximum utility...

and page 26:...
The metadata for a presentation is stored in the single Movie Box which
occurs at the top-level of a file. 
Normally this box is close to the beginning or end of the file, though this
is not required. 
...

So it's not required to have this box at the begin of a file (page 26) but
its recommended that it's placed there (page 10) for progressive download
(i.e. pseudo-streaming with a Flash-Player).

This is what the Flow-Player-Dev-Team (http://flowplayer.org/) says:
----------------------------------
H.264 files and metadata
In H.264-based video formats (mp4, m4v) the metadata is called a "moov
atom". The moov atom is a part of the file that holds the index information
for the whole file.

Many encoding software programs such as FFMPEG will insert this moov atom
information at the end of the video file. This is bad. The moov atom needs
to be located at the beginning of the file, or else the entire file will
have to be downloaded before it begins playing.

Fortunately, Renaun Erickson at Adobe has kindly created a small AIR
application that will take a standard H.264 file and relocate the moov atom
to the front of the file, and then progressive downloading works properly.
Running your video file through this application makes your MP4 files ready
for pseudostreaming. Of course you need to have those keyframes in place
(see above). 
----------------------------------

so as you can read many tools put the moov at the end of file (i.e. ffmpeg,
all Adobe Products! ...). i think quicktime is the only Software that puts
the moov at the begin of a mp4 file.

thanks for the fast reply and the offer to integrate such a feature. i
think that it's very helpful to many people developing online applications
with video-integration.

best regards,
ben

Original issue reported on code.google.com by svollbehr on 20 Nov 2009 at 5:53

GoogleCodeExporter commented 8 years ago

Original comment by svollbehr on 20 Nov 2009 at 5:53

GoogleCodeExporter commented 8 years ago
I think this suggestion was very good. I've now finished implementing it.

This feature has now been implemented into php-reader-1.8-zf package. Upon 
write in
addition normal write routines the method also checks whether moov is before 
mdat and
if not then moves mdat to the end of the file and writes moov where mdat used 
to be.
Please check if the fix corresponds to what you required.

Original comment by svollbehr on 7 Mar 2010 at 8:59