John Fremlin's blog: frontpage

Redundant video bitstream

Posted 2014-10-22 17:48:58 GMT

Video has the most computationally heavy compression in widespread use. At the same time, layer after layer of abstraction with a view to incredible flexibility, where each group dreams of a container format that will carry any codec, leads to an incredible duplication of metadata.

For example, how many times is the video resolution encoded in an MP4 file with a typical MPEG4 AVC payload? The instinctive reaction of each group of architects at each point in the stack is to redefine the description of the video in some slightly inadequate schema that is not quite a superset of the others, so all are needed. For VOD or realtime video, the resolution is eagerly repeated again and again in each extra transport layer. Certainly for a standard MP4 stream, the resolution must be in the H.264 Sequence Parameter Set used by the video codec. But then also in the avcC box - the configuration of that codec in the MPEG4 stream format, and then also in the track header tkhd box. So I count at least three. Are there more?

Why is this bad? The information is unnecessary, in aggregate over the billions of videos made in the world it wastes huge amounts of not only video storage but mental bandwidth in standards texts, and a video file can now be created that is inconsistent so every implementation needs error handling for this case.

This is, I suppose, an example of a sort of bikeshedding: an issue so trivial (the resolution of a video is easily understood) so that each abstraction is eager to take responsibility for it, whereas real practical issues, like the relative placement of the indices inside the file, are left to fall through the cracks.

Post a comment

The mmap pattern

Posted twenty-five weeks ago, last comment twenty-five weeks ago

Operands to NOP on AMD64

Posted four years ago, last comment three years ago

Scala is not a better Java

Posted three years ago, last comment three years ago

Real men don't use floating point

Posted five years ago, last comment sixteen weeks ago

teepeedee2 achieves 10k requests/second

Posted five years ago, last comment forty-nine weeks ago

The halting problem is widely misinterpreted

Posted five years ago, last comment five years ago

Teepeedee2 released!

Posted five years ago, last comment four weeks ago

A code for code review

Posted one year ago, last comment twenty-one weeks ago

Rotating an image with OpenCV and Python

Posted twenty-eight weeks ago, last comment seventeen weeks ago

ULib - C++ IO framework

Posted five years ago

Subverting the OCaml type system

Posted five years ago, last comment four years ago

Complications in portably transforming Common Lisp

Posted five years ago

Conformance of Common Lisp implementations

Posted five years ago, last comment three years ago

Explaining meta-programming by analogy

Posted three years ago, last comment thirty-four weeks ago

manardb: a fast persistent object store for Common Lisp

Posted five years ago, last comment three years ago

Posts in chronological order.