Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate proper tkhd.width and tkhd.height with non-square pixels #35

Closed
kqyang opened this issue Aug 5, 2015 · 1 comment
Closed
Assignees
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@kqyang
Copy link
Contributor

kqyang commented Aug 5, 2015

From the spec (ISO/IEC 14496-12:2012(E)):

  • For the size in tkhd (Track Header box):

width and height specify the track's visual presentation size as fixed-point 16.16 values. These need not be the same as the pixel dimensions of the images, which is documented in the sample description(s); all images in the sequence are scaled to this size, before any overall transformation of the track represented by the matrix. The pixel dimensions of the images are the default values.

So the width/height in tkhd box should be display dimension, rather than coded dimension in pixels.

We should also consider generating PixelAspectRatio box for non-square pixels.

The pixel aspect ratio and clean aperture of the video may be specified using the ‘pasp’ and ‘clap’ sample entry boxes, respectively. These are both optional; if present, they over-ride the declarations (if any) in structures specific to the video codec, which structures should be examined if these boxes are absent. For maximum compatibility, these boxes should follow, not precede, any boxes defined in or required by derived specifications.

@kqyang kqyang added the type: bug Something isn't working correctly label Aug 5, 2015
@kqyang kqyang added this to the 1.2 milestone Aug 5, 2015
@kqyang kqyang self-assigned this Aug 5, 2015
kqyang added a commit that referenced this issue Sep 30, 2015
- Width/Height in tkhd box should be display resolution instead of
  coded resolution.
- pasp was not generated earlier.
- Assuming SAR as 1:1 if it failed to be extracted successfully.
- Also update test files for mp4_media_parser_unittest.

This fixes Issue #35.

Change-Id: Iedbe6a44465aac6723b6ea2de30aed180821eccd
@kqyang
Copy link
Contributor Author

kqyang commented Sep 30, 2015

Fixed in e5b6096

@kqyang kqyang closed this as completed Sep 30, 2015
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 19, 2018
@shaka-project shaka-project locked and limited conversation to collaborators Apr 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

2 participants