feat: add AV1 format info to Matroska and MP4 containers - #39
Conversation
📝 WalkthroughWalkthroughThe mediainfo package now recognizes AV1 in Matroska and MP4 files. It maps AV1 to the ChangesAV1 codec support
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/mediainfo/mp4_codec_test.go`:
- Line 141: Update the test setup around buildTrackWithStsd("vide", "av01") to
add exactly one minimal av1C child box to the AV1 sample entry, producing a
conformant track while preserving the existing test structure.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 037abae9-cc05-4413-8117-6731698884ab
📒 Files selected for processing (4)
internal/mediainfo/matroska_codec.gointernal/mediainfo/matroska_codec_test.gointernal/mediainfo/mp4_codec.gointernal/mediainfo/mp4_codec_test.go
Official MediaInfo prints no Codec ID/Info for av01: the info column in MediaInfoLib CodecID_Video_Mpeg4.csv is empty, unlike avc1/hvc1. Format/Info on the same track already carries "AOMedia Video 1". Verified against official v23.04 on a real AV1 mp4.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
internal/mediainfo/mp4_codec_test.go (1)
144-146: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winAdd targeted AV1 malformed-input coverage.
FuzzParseMP4Containerscovers arbitrary MP4 bytes, but its seeds do not construct anav01entry. Add regression seeds for a truncatedav01entry and anav1Cbox whose declared size exceeds the sample entry. Assert panic-free parsing and no fabricated codec-configuration fields.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/mediainfo/mp4_codec_test.go` around lines 144 - 146, Extend the AV1 test setup around FuzzParseMP4Containers with regression seeds for a truncated av01 sample entry and an av1C box whose declared size exceeds the containing entry. Parse each input while asserting no panic and verify that malformed data does not populate fabricated codec-configuration fields.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/mediainfo/mp4_codec_test.go`:
- Around line 187-189: Extend the av01 assertions in the relevant test to
separately verify that findField(info.Tracks[0].Fields, "Codec ID") is absent,
while retaining the existing "Codec ID/Info" assertion. Ensure the test fails if
either codec identifier or codec information is emitted.
---
Nitpick comments:
In `@internal/mediainfo/mp4_codec_test.go`:
- Around line 144-146: Extend the AV1 test setup around FuzzParseMP4Containers
with regression seeds for a truncated av01 sample entry and an av1C box whose
declared size exceeds the containing entry. Parse each input while asserting no
panic and verify that malformed data does not populate fabricated
codec-configuration fields.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1e2472bb-9d4f-4623-8451-c8eb24a25737
📒 Files selected for processing (2)
internal/mediainfo/mp4_codec.gointernal/mediainfo/mp4_codec_test.go
Adds AV1 (AOMedia Video 1) Format/Info recognition to both the Matroska and MP4 container parsers
Summary by CodeRabbit
New Features
Tests