0
votes

I am a newbie. Hope to find some useful links or recourse to solve my puzzle. For a regular video file encoding, such as for a mp4 file, it needs to insert moov atom when the encoding ends.

For live video streaming, frames in each packet can play on themselves, without the need of the moov atom.

So what difference in the encoding between the above two?

1

1 Answers

1
votes

There are codecs and containers. Generally the codecs are the same for live and vod (video on demand). There are some exceptions to this, but irrelevant to this discussion.

The MP4 container (not codec) uses a moov atom that contains metadata about timing, frame size and position (in bytes) in the file. This makes it extremely easy to move around in the file (Just like indexing a database make it easy to search). Live containers don't do this. For example FLV uses one "tag" per frame where the metadata for the frame is stored along with the frame itself. This generally creates slightly larger files. It also make it difficult to seek within a file. Without an index, how many bytes should skip if I want to seek ahead 60 seconds? Like an unindexed database, I need to look at every record (frame) to determine this. But this makes it possible to jump into the middle and start playing, without needing prior information. This is the trait we need for live video.

There is also a hybrid approach used in fragmented ISO (mp4) files. Where there is a separate index every couple seconds. The metadata atom is called a moof in this case.