Skip to content

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

Open
Shootfast wants to merge 3 commits intoaxiomatic-systems:masterfrom
Shootfast:video_sample_description_extensions
Open

Add support for Video sample description extensions (COLR / GAMA / PASP / FIEL)#694
Shootfast wants to merge 3 commits intoaxiomatic-systems:masterfrom
Shootfast:video_sample_description_extensions

Conversation

@Shootfast
Copy link
Copy Markdown

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.
@fnordware
Copy link
Copy Markdown
Contributor

Thanks for this, @Shootfast! Works for me.

Let's merge it!

@barbibulle
Copy link
Copy Markdown
Contributor

I'll merge the PR shortly (I need to update some of the platform-specific project/build files to ensure that the new .cpp files are compiles and linked)

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.

3 participants