Skip to content

Fix photo resolution, recording quality, and blank preview for raw-only cameras - #307

Closed
PlugMyLife wants to merge 3 commits into
elementary:mainfrom
PlugMyLife:fix/raw-only-cameras
Closed

Fix photo resolution, recording quality, and blank preview for raw-only cameras#307
PlugMyLife wants to merge 3 commits into
elementary:mainfrom
PlugMyLife:fix/raw-only-cameras

Conversation

@PlugMyLife

Copy link
Copy Markdown

What this does

Three small fixes to CameraView.vala (20 lines total), each independent:

  1. Consider raw caps when picking photo resolution. Photo sizing only
    inspected image/jpeg capabilities. A camera that exposes only raw
    formats always fell through to the 640×480 default, and photos from a
    16:9-only sensor were stretched to 4:3. Now video/x-raw structures
    are scanned too, so photos use the sensor's native resolution.

  2. Configure vp8enc for realtime capture. The encoder was created
    with its defaults (256 kbps target, best-quality/slowest deadline),
    which can't encode an HD stream in real time — the encoder falls
    behind, the leaky preview queue drops frames, and recordings come out
    choppy at ~80 kbps for 720p30. This sets the realtime deadline,
    spreads work across the available CPU cores, and scales the target
    bitrate with frame size (~3.7 Mbps at 720p).

  3. Handle a missing gtk4paintablesink. Every element in the
    recording path reports a missing-plugin message, but the preview sink
    was used unchecked. Without the GTK4 GStreamer plugin the preview
    silently stayed black while photos and recording kept working. This
    adds the same missing-plugin handling and surfaces the existing
    "Unable To View Camera" dialog.

Why

I hit all three on a 2015 MacBook Pro (MacBookPro11,4), whose FaceTime HD
webcam is a PCIe device driven by the out-of-tree
facetimehd driver and exposes
only raw (non-JPEG) formats. The bugs are general, though — any raw-only
camera hits #1 and #2, and #3 affects any host missing the GTK4 sink.

Before / after (measured on that machine)

before after
photo resolution 640×480, wrong aspect 1280×720, correct
recording bitrate (720p30) ~80 kbps ~2 Mbps
recording smoothness drops frames smooth
preview, GTK4 sink missing silent black screen clear error dialog

Testing

Built against current main (meson + ninja, compiles clean) and run
on the hardware above: photos now save at native resolution, recordings
are smooth, and removing the GTK4 sink produces the error dialog instead
of a black screen.

Jonathan Lindstrom and others added 3 commits July 5, 2026 19:40
Cameras that expose no image/jpeg caps (e.g. the PCIe FaceTime HD in
2015 MacBook Pros using the out-of-tree facetimehd driver) always fell
back to 640x480, and photos from 16:9-only sensors were stretched to
4:3. Scan video/x-raw structures too so photos use the sensor's native
resolution.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
vp8enc's defaults (256 kbps target bitrate, best-quality deadline)
cannot encode HD webcam streams in real time. The encoder falls behind,
the leaky preview queue drops frames, and recordings come out choppy at
extremely low quality (measured ~80 kbps for 720p30).

Use the realtime deadline, spread work across the available CPU cores,
and scale the target bitrate with the frame size (~3.7 Mbps at 720p).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Every element in the recording path reports a missing-plugin message,
but the preview sink was used unchecked. On systems without the GTK4
GStreamer plugin the preview silently stayed black while photos and
recording kept working. Prompt for plugin installation and surface the
existing 'Unable To View Camera' dialog instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@stsdc

stsdc commented Jul 6, 2026

Copy link
Copy Markdown
Member

This project does not allow contributions generated by large languages models (LLMs) and chatbots. This ban includes tools like ChatGPT, Claude, Copilot, DeepSeek, and Devin AI. We are taking these steps as precaution due to the potential negative influence of AI generated content on quality, as well as likely copyright violations.

@stsdc stsdc closed this Jul 6, 2026
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