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

Add support for Video sample description extensions (COLR / GAMA / PASP / FIEL) #694

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Shootfast
Copy link

This patch introduces support for handling colr, gama, pasp, and fiel atoms.

These atoms are part of the Video Sample Description Extensions - documented here:
https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-124374

To access these atoms, additional handling of ProRes, mjpeg, and DNxHR /DNxHD codecs was added. Other codecs may need similar treatment, but these are the ones I most frequently encounter.

This pull request satisfies my very ancient feature request #167 .

The new functionality was tested via the following workflow:

# Extract an existing colr atom from a qt into a new file 'colr':
mp4extract 'moov/trak/mdia/minf/stbl/stsd/ap4h/colr' input.mov colr

# Or

# Generate a new colr atom from scratch (This one is rec2100 NCL)
echo -n -e '\x00\x00\x00\x12colrnclc\x00\x09\x00\x10\x00\x09\x0a' > colr

# Patch the colr atom from input.mov with the contents of the file 'colr' and write to output.mov
mp4edit --replace 'moov/trak/mdia/minf/stbl/stsd/ap4h/colr':colr input.mov output.mov

I've tried to adhere to the style of the surrounding library, but please let me know if I should change anything.

These atoms are part of the Video Sample Description Extensions,
and provide additional information and/or display hints for decompressors.
By explicitly handling these video codecs as VisualSampleEntry(s),
we are able to decend past their initial outer atom and access any
extension atoms that may be present.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant