Treasured's Movie Repair Guide -- On Containers

One of the common misconception about video formats is the confusion between container and media.

The subject is complex, and people willing to learn more can start digging here:

http://wiki.multimedia.cx


To make things simple:

Audio and video can be coded in hundreds of different algorithms (codec and settings), whereas they are stored in fewer file formats (containers).


A few containers: AIFF, WAV, 3GP, ASF, AVI, Matroska, MPEG, MP4, MOV, Ogg, RealMedia, MXF, VOB, ...


Cameras and standardized mediums (DVD Video, Blu-ray) can also use a files structure to store the clips.


How do containers affect repairability?

Most of the time, Movie Repair has to deal with a broken, incomplete, or missing container: We try to recreate a container for media from scratch. 

(Only in rare cases we can take advantage of the original container. This is then a Container structure correction.)


Therefore, the original container is not really important to this regard. 

The media format (codec and settings) is far more important to set expectations of a repair.


Repair Service targets original content. In other words, video that has enough value to have a repair fee paid for.

Matroska, OGG, WMV, ASF, FLV and AVI content is usually not original: you can get it again from several sources like Internet, friends, YouTube... Repairing those video files is possible, but very little development has been done in this direction.


Specifics of repairing QuickTime .mov containers

Unless the sample tables inside the moov atom are intact, the repair is not easy.

Media data, from one or several tracks, is laid out continuously, without any header or pattern that would help determine where a frame starts and ends.

Movies with RTP packets (for streaming, webcasting applications) are easier to repair because the packets contain redundant information about audio and video frames nearby.


Specifics of repairing mp4, m4v, f4v, MPEG-4 and 3GP containers

Exactly same as QuickTime container, see above, because those containers are all derived from the same ISO standard.


Specifics of repairing AVI containers

Frames inside an AVI file have a small header, typically '00dc' and '01wc' for audio and video, with the frame length encoded on 32 bits just after. This makes reindexing of AVI files almost trivial if you have basic programming skills.


Specifics of repairing MXF containers

http://en.wikipedia.org/wiki/MXF

Media Exchange Format, a standard defined by SMPTE, is used by the production and broadcasting industry.

Along the MXF files, you will find many partition packs, with a 06 0E 2B 34 02 05 01 01 0D 01 02 header.

Those blocks are usually 0x8000 bytes long, or more.

Audio and video media is interleaved. You can even find an audio frame in the middle of a video frame. Usually those interruptions happen on addresses multiple of 0x80000.

This contributes also to make repairs from MXF containers quite hard.


Specifics of repairing MPEG and MTS containers

Transport streams like MTS should never need a repair, by definition (See also AVCHD). For Program streams, see dedicated MPEG article.