Skip to content
Lynne edited this page Jul 2, 2024 · 1 revision

What file extensions does AVTransport use?

AVTransport uses .avt

For subtitle-only uses, .ats may be used.

For image-only uses, .ati can be used, and for audio-only uses, .ata.

Using these extensions is recommended, but not required.

What advantages does AVTransport have over Matroska?

Timestamp rounding

Matroska has been struggling with a limitation known as timestamp rounding. This number determines when each frame must be shown on screen. When Matroska was being designed, framerates were low enough, that a decision to recommend using 1-millisecond resolution made sense, as it kept file sizes down, and was good enough.

However, this creates issues with high FPS video. Most distributed video uses a framerate of 23.976 frames per second, which requires that each frame is presented every 41.70 milliseconds. Rounding this to 42 milliseconds, as the specification recommends, results in an error of 0.7%.

For 60 frame per second video, the error grows to 2%. For 120fps, the error is 4%. Modern gaming screens can reach 360fps, which results in an error of 8%.

The issue is that this results in visible jitter. If a frame is late, then motion stops appearing smooth. This becomes more noticeable as the frame rate increases, even though there are far more frames in a single second.

Streaming

Matroska lacks any features to enable streaming. Previous experiments relied on fragmenting Matroska, in other words, splitting it into multiple chunks. This was problematic, as it resulted in very high overhead (bitrate increase due to additional signalling). It also had very high latency. Due to these issues, and due to MP4 becoming an ISO standard (ISOBMFF), which has better (but still worse compared to AVTransport) support for streaming, it has taken over.

What advantages does AVTransport have over MP4

Historical

MP4 was designed 30 years ago. Worse, most of its advancements have come as a result of it being used as a project file for non-linear editing. Which allows for jumps and cuts. This means that every player has to implement what is essentially a non-linear editing engine just to show MP4 video.

Naturally, most players don't do this. But they have to support some part of this, due to audio track timeline adjustment being done via this feature.

Due to MP4 evolving into an Itunes format, and Itunes having different ways of being able to do adjustments, there are 5 or so ways of simply trimming the start of audio for codecs such as AAC.

MOOV atom not found

[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: moov atom not found

How many times have you seen this? The issue is that MP4 implementations, by default, store ALL OF the data needed for playback at the very end of the file. If the file is cut, then it becomes literally unplayable. Recovery ways exist, but they rarely work, and require that you have another file, made at the same time, which is uncut.

But worse, you have no idea where the end of the file may be in some situations. So even for untouched MP4 streams, attempting to pass them through a pipe, or stream them directly, is just not possible.

AVTransport is extremely robust towards cuts. Players can start from anywhere. Keyframes are listed often, and are spread throughout the entire file, so accurate seeking is not a problem.

Streaming

MP4 uses the same method as Matroska for streaming. Individual files are created, one for every 2 or so seconds of video. Additional chunks are made inside each file, to allow for streaming.

And the only way players know when they can play a given file is by either checking the clock, or downloading a separate playlist over and over again.

Its so error-prone, its surprising the whole internet streaming infrastructure works as well as it does now. Even though it is very inefficient and fragile, and incompatible.