Repository navigation
Conversation
Co-authored-by: Kyzer <kyzer1023@users.noreply.github.com>
Co-authored-by: Kyzer <kyzer1023@users.noreply.github.com>
|
@kyzer1023 is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
| let decoder = spawn_decoder(clip.name, path, 30, 0.0, true) | ||
| .await | ||
| .unwrap_or_else(|error| panic!("{} decoder: {error}", clip.name)); | ||
| assert_eq!( | ||
| decoder.decoder_type(), | ||
| DecoderType::FFmpegSoftware, | ||
| "{} should use the software decoder the editor and export share", | ||
| clip.name | ||
| ); |
There was a problem hiding this comment.
If VideoToolbox decoding succeeds, this test fails before checking any colors. Passing true to spawn_decoder forces FFmpeg, not software decoding: the macOS branch still enables hardware decoding and can return FFmpegHardware. Start the test with hardware decoding explicitly disabled, or check both decoder types without requiring FFmpegSoftware.
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/rendering/tests/untagged_color.rs
Line: 58-66
Comment:
**Color test fails on Macs**
If VideoToolbox decoding succeeds, this test fails before checking any colors. Passing `true` to `spawn_decoder` forces FFmpeg, not software decoding: the macOS branch still enables hardware decoding and can return `FFmpegHardware`. Start the test with hardware decoding explicitly disabled, or check both decoder types without requiring `FFmpegSoftware`.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Fixed in 8b8faf4. The check now accepts FFmpeg software and FFmpeg hardware. On macOS, spawn_decoder(..., true) still enables VideoToolbox, and those frames still take their matrix in process_cpu, so the colour checks are unchanged. This was also the cause of the macOS sync-tests failure.
Co-authored-by: Kyzer <kyzer1023@users.noreply.github.com>
…2 fixes pushed, ID2 Sway running
Why
Untagged HD video decoded as BT.601 in the editor and on export. FFmpeg's default for an untagged stream is BT.601, and browsers play that stream as BT.709. Preview GIFs already follow the browser (commit a550cdb). Untagged frames under 720 px stay BT.601, and an explicit BT.601 tag stays BT.601 at any height.
What changed
YuvMatrix::from_color_spacetakes the frame height. An untagged frame at least 720 px tall uses BT.709. The editor decoder, the swscale converter, the export track, the header probe, the macOS fallback, the Windows probe, and import's untagged arm all call that function.Scope
Editor preview and export of timeline video that arrives untagged. Cap's own tagged BT.709 encodes are unchanged.
Tradeoffs
An untagged HD file that was actually mastered as BT.601 will shift. Named spaces other than BT.709 and BT.601 keep the previous fallback, BT.601 in the decoder and the existing import catch-all. Untagged SD will not match the share GIF, which forces BT.709 even for a short clip.
Blast Radius
Every caller of
from_color_spacenow passes height. Files under 720 px, including the existing 64 by 48 header fixture, stay BT.601 when untagged. Import's explicit-tag arms are unchanged.Verification
cargo test -p cap-rendering --test untagged_colorgenerates an untagged 1280x720 clip, an untagged 640x480 clip, and a 1280x720 clip tagged SMPTE170M, then decodes them with the software decoder. Before the fix the HD clip came out BT.601 at[211, 115, 50]. After the fix all three land within 8 of source orange[224, 122, 48], and the frame tags stay Unspecified or SMPTE170M.untagged_height_selects_the_matrix_swscale_usespassed.cargo clippy -p cap-rendering --test untagged_color -- -D warningsandcargo clippy -p cap-export --lib --no-deps -- -D warningspassed.On macOS 26.6.2 arm64 at
8b8faf422, AVAssetReader and FFmpeg with VideoToolbox selected BT.709 for untagged 720p video and BT.601 for untagged 480p and explicitly tagged BT.601 video. All decoded color channels matched the source within the test's tolerance of 8.On Windows Server 2022 x64, Cap's Media Foundation decoder returned
DXGI_ERROR_UNSUPPORTED(0x887A0004) on both base and head. The VM exposed no D3D11 video device, so Windows pixel verification remains open.The desktop import test
source_matrix_follows_the_tag_and_the_sd_hd_conventionand an on-screen editor comparison still need verification.

Confidence Score: 5/5
The PR appears safe to merge; the previous macOS test failure is fixed.Summary
The PR makes untagged video at least 720 pixels tall use BT.709 while keeping untagged SD and explicitly tagged BT.601 video on BT.601.
Reviews (6) · Last reviewed commit: "test: accept the hardware ffmpeg decoder..." · Reviewed by Greptile