Previously in the mpeg2_metadata filter. Also adds a test.
It is also used by the Dirac parsing code.