Skip to content

tkhd should parse track height and width as fixed point numbers #178

Open

Description

@jfenton-tsc

the tkhd parser currently parses the width and height fields of a track as u32.

According to the MPEG4 spec, these fields are fixed-points.

This leads to the parsed values being off by a factor of 65536.

It looks like this is handled in the C API by shifting the number right 16 bits

Unfortunately, Rust doesn't provide built-in fixed-point support but it looks like a couple of crates implement it (see fixed), but this would require adding a dependency. I'm also not sure if that crate provides an interface for parsing fixed-point numbers from binary.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    complianceSpecification compliance

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions