TIKA-4838: Expose the MP4 audio and video track codecs (audio:format, video:format) - #3062
Open
dschmidt wants to merge 3 commits into
Open
TIKA-4838: Expose the MP4 audio and video track codecs (audio:format, video:format)#3062dschmidt wants to merge 3 commits into
dschmidt wants to merge 3 commits into
Conversation
dschmidt
force-pushed
the
TIKA-audio-format
branch
2 times, most recently
from
August 24, 2026 13:52
5452bf9 to
cc7b684
Compare
dschmidt
marked this pull request as ready for review
August 24, 2026 14:31
Contributor
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Expose MP4/QuickTime track codec FourCCs as audio:format and video:format, including recovery of original codecs for protected streams via nested frma boxes.
Changes:
- Add new
Audio.FORMATandVideo.FORMATmetadata properties and register schema keys. - Populate
audio:format/video:formatfrom sample description entries, withfrmafallback for protected streams. - Add parser tests asserting the new metadata for audio-only and video+audio MP4s.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tika-parsers/.../MP4ParserTest.java | Adds assertions/tests for audio:format and video:format. |
| tika-parsers/.../TikaMp4VideoHandler.java | Extracts video codec FourCC and recovers original FourCC for protected video streams. |
| tika-parsers/.../TikaMp4SoundHandler.java | Extracts audio codec FourCC and recovers original FourCC for protected audio streams. |
| tika-metadata-schema/.../metadata-keys.json | Registers audio:format and video:format keys. |
| tika-metadata-schema/.../metadata-key-fields.json | Maps Audio.FORMAT/Video.FORMAT fields to the new keys. |
| tika-core/.../Video.java | Adds Video.FORMAT property with Javadoc. |
| tika-core/.../Audio.java | Adds Audio.FORMAT property with Javadoc. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
… video:format) TikaMp4SoundHandler/TikaMp4VideoHandler read the sample-entry format fourcc but only use it for other purposes (audio: DRM detection; video: nothing). Expose it as audio:format and video:format, each the track's four-character codec identifier (e.g. mp4a/alac/ac-3, avc1/hev1). This gives the per-track codec for video/* files, where xmpDM:audioCompressor does not fire and xmpDM:videoCompressor carries the compressor name. For protected streams the value is the protection scheme fourcc (drms/enca/encv/drmi); audio also sets audio:has-drm. Follows TIKA-4779, TIKA-4800 and TIKA-4802.
dschmidt
force-pushed
the
TIKA-audio-format
branch
from
August 24, 2026 16:53
cc7b684 to
957f037
Compare
…ormats, not protection schemes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
audio:formatandvideo:format, each the track's four-character codec identifier from the MP4/QuickTime sample description (audio:mp4a/alac/ac-3; video:avc1/hev1).TikaMp4SoundHandler/TikaMp4VideoHandleralready read the sample-entry format fourcc (audio uses it to detectdrms/encaprotected streams; video ignored it); this exposes it as metadata. Because it comes from the track, both are set forvideo/*files, wherexmpDM:audioCompressordoes not fire andxmpDM:videoCompressorcarries the compressor name (encoder string, e.g. "Lavc… libx264"), not the codec fourcc.For protected streams the value is the protection scheme fourcc (
drms/enca/encv/drmi); audio additionally setsaudio:has-drm. Both are per-stream values: with several tracks they reflect the last one, likeaudio:bitrate/video:bitrate.Verified against an M4A (
mp4a), avideo/mp4with H.264 video + AAC audio (avc1+mp4a), and a DRM-protected M4A (drms); metadata schema registries updated.https://issues.apache.org/jira/browse/TIKA-4838
Follows TIKA-4779, TIKA-4800 and TIKA-4802.