Skip to content

Start in a third of a second by probing only CUDA and VA-API - #37

Merged
dhh merged 1 commit into
masterfrom
faster-startup
Nov 12, 2026
Merged

dhh merged 1 commit into
masterfrom
faster-startup

Conversation

@dhh

@dhh dhh commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Monologue took more than two seconds to show its window. Qt's FFmpeg backend opens a context for every hardware API it knows (vdpau, CUDA, VA-API, Vulkan) when it first loads. That is 1.9 s on this machine, Vulkan alone 0.8 s, and it all happens in Backend's constructor before QML even loads.

Recording only needs the APIs behind the hardware H.264 encoders: CUDA for NVENC and VA-API for Intel and AMD. media::useFfmpeg() now sets Qt's QT_FFMPEG_ENCODING_HW_DEVICE_TYPES and QT_FFMPEG_DECODING_HW_DEVICE_TYPES to cuda,vaapi alongside the backend choice, unless they're already set. Qt then skips the up-front probe and checks the device when a recording starts.

master this branch
Backend constructed 1.89 s 0.02 s
First paint 2.09 s 0.30 s
First camera frame 2.34 s 0.39–0.53 s

A real take through bin/test-camera still opens h264_nvenc, and h264_vaapi remains the next candidate. The app, camera_check, and both test binaries share the one function, so they all load the backend the same way.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were established.

Summary

Centralizes Qt FFmpeg setup in media::useFfmpeg().

  • Monologue starts its Qt media backend without probing unrelated hardware APIs.

No actionable issues were established. No build or runtime tests were run.

Reviews (1) · Last reviewed commit: "Start in a third of a second by probing ..." · Reviewed by Greptile

@dhh
dhh merged commit 8cf5daf into master Nov 12, 2026
2 checks passed
@dhh
dhh deleted the faster-startup branch November 12, 2026 15:43
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.

1 participant