Skip to content

feat: add AV1 format info to Matroska and MP4 containers - #39

Merged
s0up4200 merged 3 commits into
autobrr:mainfrom
Aerglonus:av1-info
Aug 11, 2026
Merged

feat: add AV1 format info to Matroska and MP4 containers#39
s0up4200 merged 3 commits into
autobrr:mainfrom
Aerglonus:av1-info

Conversation

@Aerglonus

@Aerglonus Aerglonus commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Adds AV1 (AOMedia Video 1) Format/Info recognition to both the Matroska and MP4 container parsers

Summary by CodeRabbit

  • New Features

    • Added AV1 video codec recognition for Matroska and MP4 media files.
    • AV1 files now display accurate format and codec metadata, including “AOMedia Video 1.”
    • MP4 AV1 media is parsed correctly, with unsupported codec ID details omitted when unavailable.
  • Tests

    • Added coverage verifying AV1 detection and metadata parsing across supported container formats.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The mediainfo package now recognizes AV1 in Matroska and MP4 files. It maps AV1 to the AV1 format and reports AOMedia Video 1 metadata. Tests cover codec mappings and MP4 parsing.

Changes

AV1 codec support

Layer / File(s) Summary
Matroska AV1 mapping
internal/mediainfo/matroska_codec.go, internal/mediainfo/matroska_codec_test.go
Matroska AV1 codec IDs now map to AV1 video format and AOMedia Video 1 metadata.
MP4 AV1 sample-entry support
internal/mediainfo/mp4_codec.go, internal/mediainfo/mp4_codec_test.go
MP4 av01 sample entries are recognized as video. They return AV1 format and AOMedia Video 1 metadata. The parser test validates the track data and absent codec-ID information.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: s0up4200, audionut

Poem

A rabbit maps AV1 with care,
In Matroska and MP4 air.
av01 tracks now parse bright,
AOMedia metadata reads right.
Tests hop clean from start to end.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the addition of AV1 format information support for Matroska and MP4 containers.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 31421d4 and 4bc3cf7.

📒 Files selected for processing (4)
  • internal/mediainfo/matroska_codec.go
  • internal/mediainfo/matroska_codec_test.go
  • internal/mediainfo/mp4_codec.go
  • internal/mediainfo/mp4_codec_test.go

Comment thread internal/mediainfo/mp4_codec_test.go Outdated
Aerglonus and others added 2 commits August 11, 2026 03:01
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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
internal/mediainfo/mp4_codec_test.go (1)

144-146: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Add targeted AV1 malformed-input coverage.

FuzzParseMP4Containers covers arbitrary MP4 bytes, but its seeds do not construct an av01 entry. Add regression seeds for a truncated av01 entry and an av1C box 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

📥 Commits

Reviewing files that changed from the base of the PR and between 4bc3cf7 and 1059da1.

📒 Files selected for processing (2)
  • internal/mediainfo/mp4_codec.go
  • internal/mediainfo/mp4_codec_test.go

Comment thread internal/mediainfo/mp4_codec_test.go

@s0up4200 s0up4200 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@s0up4200
s0up4200 merged commit 55db961 into autobrr:main Aug 11, 2026
2 checks passed
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.

2 participants