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

AV1 encoding missing color metadata #1202

Closed
cosmin opened this issue Apr 25, 2023 · 2 comments · Fixed by #1261 or #1312
Closed

AV1 encoding missing color metadata #1202

cosmin opened this issue Apr 25, 2023 · 2 comments · Fixed by #1261 or #1312
Assignees
Labels
status: archived Archived and locked; will not be updated

Comments

@cosmin
Copy link
Contributor

cosmin commented Apr 25, 2023

Given any AV1 encoding in MP4 format, the output MPD is missing color information from the dash codec string, and the output mp4 is missing the color information in av1C (the entire colr box is missing).

For example, codecs="av01.0.04M.10.0.112.09.16.09.0" represents AV1 Main Profile, level 3.0, Main tier, 10-bit content, non-monochrome, with 4:2:0 chroma subsampling co-located with (0, 0) luma sample, ITU-R BT.2100 color primaries, ITU-R BT.2100 PQ transfer characteristics, ITU-R BT.2100 YCbCr color matrix, and studio swing representation.

The parameters sample entry 4CC, profile, level, tier, and bitDepth are all mandatory fields. If any of these fields are empty, or not within their allowed range, the processing device SHOULD treat it as an error. All the other fields (including their leading '.') are optional, mutually inclusive (all or none) fields. If not specified then the values listed in the table below are assumed.

The color fields are optional, so the current output is a valid MPD. Previously packager used to output only partial color information which was incorrect, as the optional fields are mutually inclusive (all or none). Related issue was #453 and this was fixed in 53aa775 by removing all the optional fields.

Instead we should properly parse the color information from av1C/colr, populate the dash codec string, and then also pass down the colr atom in av1C.

@joeyparrish
Copy link
Member

Thank you for the detailed write-up! PRs are very welcome.

joeyparrish pushed a commit that referenced this issue Aug 30, 2023
This PR is an extension of the full AV1 codec string feature: [PR
1205](#1205) and
relates to [Issue
1007](#1007) and
[Issue
1202](#1202).

As per the AV1 spec, the codec string may contain optional color values.
These color values are critical for detecting HDR video streams - see
[Issue
1007](#1007).
Color information is extracted from the input mp4's `colr` atom and used
to generate the full AV1 codec string. This PR preserves the color
information by writing the `colr` atom to the muxed mp4.

**References**:
- [AV1 Codec ISO Media File Format
Binding](https://aomediacodec.github.io/av1-isobmff/#codecsparam)
- [AV1 Bitstream & Decoding Process
Specification - Section 6.4.2 Color config semantics (page
117)](https://aomediacodec.github.io/av1-spec/av1-spec.pdf)
- [QuickTime File Format
Specification](https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-125526)
@joeyparrish
Copy link
Member

Closed by #1261

@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Oct 29, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 29, 2023
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
Projects
None yet
2 participants