voelin-media: MJPEG cameras for the Stream Studio
Many USB cameras offer their large sizes only as MJPEG (the Fifine K420: 2560x1440 and 1920x1080 compressed, raw only up to 1280x720), and the studio camera offered PipeWire raw formats only, so it was stuck at 720p. MJPEG is now offered and decoded with zune-jpeg (already in the tree through `image`) straight into pooled RGBA frames, on a thread of its own: the camera thread copies each picture into a recycled buffer and hands it over latest-wins, so a slow decode drops pictures instead of holding up the camera, and nothing is allocated per picture once running. The offers come from what V4L2 lists for the camera: the wanted size at the wanted rate in a raw format first (no decoding), then the wanted size with MJPEG first, then every format at the sizes it lists; PipeWire's V4L2 source otherwise took a size on trust and failed to set NV12 at 1440p. zune-jpeg is built optimised in dev builds like the other per-pixel code: unoptimised, a 1440p picture took most of a second. Tested on the Fifine K420: 2560x1440, 1920x1080 and 1280x720 arrive at the right size at 10 fps, which is what the camera sends in this light (v4l2-ctl measures the same); a camera-like 1440p picture decodes in about 30 ms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2a1279ee7b
commit
8519199c6b
5 files changed
+479
-78
No files matched your search
@@ -111,6 +111,9 @@ opt-level = 3
|
||||
opt-level = 3
|
||||
[profile.dev.package.wayland-client]
|
||||
opt-level = 3
|
||||
# MJPEG cameras: unoptimized, a 1440p picture takes most of a second.
|
||||
[profile.dev.package.zune-jpeg]
|
||||
opt-level = 3
|
||||
|
||||
[profile.dev]
|
||||
# Line tables (for backtraces) for workspace crates, no debug info for
|
||||
|
||||
Reference in new issue
Block a user