Skip to content

Conversation

@Brendonovich
Copy link
Contributor

@Brendonovich Brendonovich commented Oct 13, 2025

Summary by CodeRabbit

  • New Features
    • MP4 exports on macOS now embed Rec.709 color profiles (transfer function, primaries, YCbCr matrix) for more accurate, consistent colors across players.
  • Refactor
    • Recording startup errors now use clearer, structured formatting, improving readability of error messages without changing behavior.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 13, 2025

Walkthrough

Two areas changed: error string formatting in desktop recording actor spawn paths, and AVFoundation MP4 encoder output settings gained explicit Rec.709 color properties with corresponding extern bindings updates.

Changes

Cohort / File(s) Summary of changes
Recording error message formatting
apps/desktop/src-tauri/src/recording.rs
Replaced e.to_string() with pretty Debug formatting ({e:#}) in two map_err branches for studio and instant recording actor spawns; no logic or control-flow changes.
MP4 encoder color properties and externs
crates/enc-avfoundation/src/mp4.rs
Added color_props dictionary to video output settings with Rec.709: AVVideoTransferFunctionKey, AVVideoColorPrimariesKey, AVVideoYCbCrMatrixKey. Updated/added extern bindings for these keys and their ITU-R 709-2 constants; adjusted AVVideoAverageBitRateKey type to ns::String.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

A rabbit taps keys in a gentle groove,
Tweaks errors to speak with a polished move.
Colors aligned in Rec.709 light,
Frames now dance in truer sight.
Hop, compile, and softly cheer—
Crisp bits bloom, the release draws near. 🐰✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title accurately and concisely summarizes the main change, which is the addition of Rec.709 color space support in the AVFoundation encoder component, and it clearly reflects the modifications made in the enc-avfoundation crate without extraneous details.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch avfoundation-encoder-color-space

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
apps/desktop/src-tauri/src/recording.rs (1)

488-490: Apply consistent error formatting to the instant recording branch.

The studio recording branch now uses pretty Debug formatting ({e:#}), but the instant recording branch at lines 523-526 still uses e.to_string(). For consistency and better debugging output, apply the same formatting to both branches.

Apply this diff to the instant recording branch:

                         .map_err(|e| {
-                            error!("Failed to spawn instant recording actor: {e}");
-                            e.to_string()
+                            error!("Failed to spawn instant recording actor: {e:#}");
+                            format!("{e:#}")
                         })?;
crates/enc-avfoundation/src/mp4.rs (1)

390-398: Consider using consistent type syntax for extern declarations.

The color property keys (lines 391-393) use ns::String while the color constants (lines 395-397) use cidre::ns::String. Since both resolve to the same type, prefer consistent syntax throughout the extern block.

Apply this diff for consistency:

-    static AVVideoTransferFunction_ITU_R_709_2: &'static cidre::ns::String;
-    static AVVideoColorPrimaries_ITU_R_709_2: &'static cidre::ns::String;
-    static AVVideoYCbCrMatrix_ITU_R_709_2: &'static cidre::ns::String;
+    static AVVideoTransferFunction_ITU_R_709_2: &'static ns::String;
+    static AVVideoColorPrimaries_ITU_R_709_2: &'static ns::String;
+    static AVVideoYCbCrMatrix_ITU_R_709_2: &'static ns::String;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 880d584 and d4b98b5.

📒 Files selected for processing (2)
  • apps/desktop/src-tauri/src/recording.rs (1 hunks)
  • crates/enc-avfoundation/src/mp4.rs (2 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,js,jsx,rs}

📄 CodeRabbit inference engine (CLAUDE.md)

Do not add inline, block, or docstring comments in any language; code must be self-explanatory

Files:

  • apps/desktop/src-tauri/src/recording.rs
  • crates/enc-avfoundation/src/mp4.rs
**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

**/*.rs: Format Rust code using rustfmt and ensure all Rust code passes workspace-level clippy lints.
Rust modules should be named with snake_case, and crate directories should be in kebab-case.

Files:

  • apps/desktop/src-tauri/src/recording.rs
  • crates/enc-avfoundation/src/mp4.rs
crates/**/src/**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

For desktop IPC, use tauri_specta derive/macros on Rust types/events; do not hand-roll bindings

Files:

  • crates/enc-avfoundation/src/mp4.rs
crates/*/src/**/*

📄 CodeRabbit inference engine (AGENTS.md)

Rust crates should place tests within the src/ and/or a sibling tests/ directory for each crate inside crates/*.

Files:

  • crates/enc-avfoundation/src/mp4.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build Desktop (aarch64-apple-darwin, macos-latest)
  • GitHub Check: Build Desktop (x86_64-pc-windows-msvc, windows-latest)
  • GitHub Check: Analyze (rust)
🔇 Additional comments (1)
crates/enc-avfoundation/src/mp4.rs (1)

128-143: LGTM! Explicit Rec.709 color space configuration added.

The addition of explicit Rec.709 color properties (transfer function, primaries, and YCbCr matrix) ensures correct color representation for HD/4K SDR video content. This is the standard color space for screen recordings and aligns with the PR objectives.

@Brendonovich Brendonovich merged commit 7369e1f into main Oct 13, 2025
15 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