Reputation: 3797
What exactly distinguishes streaming-enabled container file formats like Matroska and MPEG-4 Part 14 from the ones that are supposedly not "streaming-ready", like AVI?
Do they just provide an ordering of metadata and data that enables decoding software to work without random access to the media file or large buffers, or do they include some synchronization headers to enable a client to tolerate some amount of packet loss (with reduced fidelity)?
Or is that even a feature that has to be provided by the audio and video codecs instead of the container? (I guess not, because MPEG-4 (A)SP seems to be streamable (whatever that means) inside MPEG-4 Part 14 containers, but not inside AVI.)
I'm wondering if it's possible to send a "streaming-ready" file over a lossy connection (UDP without any additional synchronization or metadata layers), and reasonably expect a client to tolerate moderate packet corruption and/or loss without permanently losing synchronization, or if some intermediate layer would be necessary.
Update: I've found that MPEG transport streams seem to provide features like periodic synchronization and metadata frames to enable a client to recover from data loss or corruption, while MP4 and Matroska only seem to provide that information in the header of the file.
Are there really two kinds of streaming formats, "streamable" ones that still require a reliable transport protocol (e.g. HTTP) underneath like MP4 and Matroska, and "proper" streaming formats like MPEG-TS that can tolerate data loss in mid-stream, and enable clients to tune in at any point in time by periodically including headers and metadata?
How does RTP fit in here? It seems to provide a lot of features (frame numbering, format description headers, hints for the codec on how to interpret a frame (B- or I-frame)) that are also present in MPEG-TS, but absent in MP4 and Matroska.
Upvotes: 4
Views: 957
Reputation: 2160
File format like AVI puts a complete compilation of different media chunk offset and lengths in a dedicated Index. this index is placed at the end of the file. Hence, if you want to play AVI, the player needs to first reach the end of the file to get this index before any play can happen. This is what makes AVI streamable.
In a streamable file formats the meta data (type of media, position in time, encoding and length) is interleaved mostly in the form of headers of the segments.
Second important aspect of streambale content is to have timestamps. Each media segment must have an accurate time stamp to ensure that if you play a session for say 5 hours - it should not result in gradual loss of LipSync due to relative slip between Audio and video playout rates. AVI typically assumes that there is a standard rate (25 fps) of display and audio playout and leaves upto device to manage that over time. This makes it horrible!
Upvotes: 4