fix(desktop): upload videos without ffmpeg on macOS - #6532
Conversation
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Use macOS's built-in AVFoundation converter when ffmpeg is unavailable, including the extensionless temp-file shape used by deferred uploads. The fallback strips source metadata by default and produces fast-start H.264 MP4 accepted by the relay. Co-authored-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Carl <32a2e2c9d428ee08902cab75d956da2c1d235a22d4766b0dd4138bf6e2e5db1d@buzz.block.builderlab.xyz> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Remove partial staged sources when a fallback copy fails, and honor cancellation before starting AVFoundation conversion. Co-authored-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Carl <32a2e2c9d428ee08902cab75d956da2c1d235a22d4766b0dd4138bf6e2e5db1d@buzz.block.builderlab.xyz> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Run the extensionless QuickTime conversion against a tiny checked-in H.264 fixture on every macOS test pass, and validate all AVFoundation output with the relay's production video validator before upload. Co-authored-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Carl <32a2e2c9d428ee08902cab75d956da2c1d235a22d4766b0dd4138bf6e2e5db1d@buzz.block.builderlab.xyz> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Keep the macOS production dependency for avconvert validation while retaining the dev dependency used by cross-platform snapshot contract tests. Co-authored-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Carl <32a2e2c9d428ee08902cab75d956da2c1d235a22d4766b0dd4138bf6e2e5db1d@buzz.block.builderlab.xyz> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
wesbillman
left a comment
There was a problem hiding this comment.
Carl, an automated reviewer, commenting via Wes’s GitHub account.
Reviewed base f7942167372501576c9f0f589cf2c166882668bb through exact head d10c1b5352c1370d6006810bd577205563740d80.
No blocking correctness finding. I traced both picker and deferred raw-byte upload paths through video detection, ffmpeg/avconvert selection, extensionless source staging, process cancellation/timeout, temp-file cleanup, relay-format validation, upload, composer recovery, and raw Tauri error presentation.
The macOS fallback uses the absolute system binary with a cleared environment, preserves the existing ffmpeg path where available, cleans staged/output files on failure and cancellation, and validates avconvert output with the relay's actual video validator before upload. The checked-in extensionless QuickTime fixture exercises avconvert and that validator. The frontend change correctly preserves non-empty raw string rejections while retaining the fallback for empty or non-text values.
git diff --check passed and the review worktree was clean at the exact head. The PR's focused macOS fixture/live-relay evidence and pre-push results cover the changed behavior. GitHub CI was still running when this review completed, so I am not claiming a final CI result and did not duplicate its broad suites locally.
jedwards27
left a comment
There was a problem hiding this comment.
:bot: Jude’s code review agent
Verdict: COMMENT — no blocking correctness finding
Reviewed: f7942167372501576c9f0f589cf2c166882668bb..d10c1b5352c1370d6006810bd577205563740d80 (exact head d10c1b5352c1370d6006810bd577205563740d80)
Risk: high — this changes macOS native process/filesystem handling, cancellation and cleanup, media-format enforcement, a production dependency edge, and user-visible upload failure reporting.
Behavior/contracts traced: picker and deferred paste/drop paths through detection, fd lifetime, staging, ffmpeg/avconvert selection, cancellation/timeout, process reaping, relay-format validation, upload, cleanup, and raw Tauri error presentation. I also checked the platform fence, dependency target gate, and the change against VISION.md / TESTING.md; I found no conflicting product or test-policy expansion.
Findings: no blocking issue.
- The fallback invokes absolute
/usr/bin/avconvertwith a cleared environment and no shell/PATH lookup, a finite 600s timeout, kill-and-reap cancellation, UUID temporary names, and cleanup across success/error/cancellation (desktop/src-tauri/src/commands/media_transcode.rs:450-577). Extensionless deferred sources are staged with a magic-derived extension using hard-link then bounded copy fallback; the original picker fd remains pinned. - Converted output is passed through the relay's production validator before upload (
media_transcode.rs:489-516,568-569;crates/buzz-media/src/validation.rs:290-416,847-943), enforcing size, MP4/H.264/AAC, duration/resolution, fast-start, track shape, and metadata constraints. Existing ffmpeg selection remains first, while non-macOS retains the prior ffmpeg-required error (media_transcode.rs:589-600). - Non-empty raw string rejections now remain actionable instead of becoming
Unknown error(desktop/src/features/messages/ui/useMentionSendFlow.helpers.ts:84-91). - Native macOS probes normalized Apple-generated HEVC MOV/M4V/MP4 and ProRes MOV to H.264 MP4. VP9 WebM and one ffmpeg-authored HEVC MOV were rejected with actionable stderr rather than uploading unsupported bytes. A separate generated HEVC QuickTime source produced H.264/
avc1output verified withffprobe. Temp residue scans found nobuzz-avconvert-*,buzz-avconvert-source-*, orbuzz-drop-*files.
Validation at matching clean head:
just desktop-tauri-test— pass; primary Tauri target2744 passed, 0 failed, 18 ignored, plus integration/workspace targets and both new avconvert tests.cd desktop && pnpm test/ repositoryjust desktop-testpath — pass;5354 passed, 0 failed.git diff --check— pass.- GitHub CI at submission: macOS Desktop Build, Rust Lint, all Desktop smoke/integration lanes, release-candidate contract, and DCO pass. Desktop Core and Windows Rust remain in progress, so this review does not claim final CI clearance.
Non-blocking risk / residual evidence limits:
- The macOS-target-gated normal
buzz-mediadependency adds roughly 23 production graph packages versus base, including storage/XML/system-information dependencies, solely to reuse the validator (desktop/src-tauri/Cargo.toml:61). This is packaging weight and coupling rather than a demonstrated functional defect; a validator-only feature or crate would be a useful follow-up. - The new avconvert regression test invokes
validate_avconvert_outputseparately after conversion (media_transcode.rs:659-675), so it would not fail if the production validation call at line 568 were removed. The production call is correct, but the test is not mutation-grade coverage of that wiring. - The fallback intentionally returns no generated poster (
media_transcode.rs:596). Stock macOS users without ffmpeg get a playable, validated upload with dimensions/duration but noBlobDescriptor.image; that is a visible quality degradation, not data loss or a blocker for the stated fix. - I did not independently exercise an installed/signed DMG upload or repeat the author-reported live-relay upload. The native conversion boundary was exercised directly on macOS with codec probes and the full Tauri suite; installed-artifact handoff remains residual risk.
Because the PR author's GitHub identity is also the review identity available here, this is filed as a comment rather than a self-approval. Final merge remains gated on the two running CI jobs.
Preserve both the new address-locked mention coverage from main and the deferred upload error regression coverage from this branch. Co-authored-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Carl <32a2e2c9d428ee08902cab75d956da2c1d235a22d4766b0dd4138bf6e2e5db1d@buzz.block.builderlab.xyz> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Summary
Unknown error.avconvertwhenffmpegis unavailable, while keeping the existing ffmpeg path on configured systems.Related issue
N/A. No matching open issue or PR found.
Testing
avconvert, and runs the result throughvalidate_video_file.896768fbf0f387d4cf092927b88f7a1e46321bd5: file-size gate plus Tauri clippy and full Tauri Rust tests. The prior push atec68dccf3379363bd31d1b729730fc7e27bfec18also passed desktop Biome, typecheck, and JavaScript tests.