Lock video focus once instead of hunting continuously#29
Open
spollard wants to merge 1 commit into
Open
Conversation
The video recording pipelines build a droidcamsrc element but never set its focus-mode, so it falls back to the GstPhotography default of CONTINUOUS_NORMAL. On the Android camera HAL this re-runs autofocus for the entire recording, making the lens visibly hunt in and out and degrading every video. Set focus-mode=auto (single-shot autofocus, then hold) on droidcamsrc in both the front and back record pipelines so the camera focuses once at the start of the recording and then keeps that focus steady. Measured on a FuriPhone (radon): per-frame sharpness jitter after the first second dropped from ~0.56 (continuous) to ~0.02 (auto), with a higher mean sharpness since the image no longer racks through blur. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The video recording pipelines in
Camera.qmlbuild adroidcamsrcelement but never set itsfocus-mode. It therefore falls back to the GstPhotography defaultCONTINUOUS_NORMAL, which on the Android camera HAL re-runs autofocus for the entire recording. The lens visibly hunts in and out, degrading every video.Fix
Set
focus-mode=auto(single-shot autofocus, then hold) ondroidcamsrcin both the front and back record pipelines, so the camera focuses once at the start of recording and then keeps that focus steady. Two-line change, no behavioural change to stills or the viewfinder.Measurements (FuriPhone radon)
Recorded the same scene through the existing back-record pipeline with the only difference being
focus-mode, then computed a per-frame sharpness metric (Brenner gradient):droidcamsrc focus-modecontinuous-normal(current default)auto(this PR)autoalso has a higher mean sharpness, since the image no longer repeatedly racks through blur.If a fully fixed lens is ever preferred (e.g. for landscapes),
focus-mode=infinity/manualare the alternatives — butautokeeps a sharp starting focus, which is the better general-purpose default.🤖 Generated with Claude Code