Repository navigation
Add a per-camera video format picker - #14
Closed
abort-retry-ignore wants to merge 4 commits into
Closed
abort-retry-ignore wants to merge 4 commits into
abort-retry-ignore wants to merge 4 commits into
Conversation
Monologue always records at the camera's largest advertised resolution, so a camera whose top mode is slow (a Logitech C920's 2560x1472 YUYV mode delivers 2 fps) cannot be recorded at a usable frame rate, and there is no way to choose otherwise. A Format control beside the camera lists every format the camera advertises, largest first, with resolution, pixel format, and frame rate, and marks the active one. The choice is stored per camera and survives restarts, falling back to the existing maximum-resolution default when the camera no longer offers it.
The picker listed each format's full advertised range ("5–30 fps"), which
says nothing about the rate the recording will actually use. Show the rate
the app requests instead, so a 2 fps mode is obviously the one to avoid and
every other row reads as a single rate.
Show the selected format itself beside the camera rather than the word
"Format".
A saved format that the camera stopped advertising matched nothing, so the picker landed on the first (largest) entry instead of the default pick. Choose the saved format, then the default, then the first, in one small tested function, and remove bestCameraFormat, which the picker made unused.
Give the camera name its full width back and show the selected format in a small, capped label so the two no longer overlap. Restore the original Space handler: the earlier edit was equivalent, because a take's writer is gone before the editor state is entered.
Contributor
|
Thanks for digging into this, and for the C920 PRO details. #19 now fixes the default: modes slower than 15 fps lose to a smoother one, so the C920 PRO opens at 1920×1080 MJPEG 30 fps without a picker. We'd like to keep Monologue's controls minimal, so I'm closing this. The 'encoding cannot keep up' delay you traced to Qt probing hardware encoders is fixed in #37, and the 4:2:0 encoding in #32 lets NVENC and VA-API apply. |
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.
Fixes the "no way to lower resolution" half of #3.
The problem
Monologue always records at the camera's largest advertised resolution. On a Logitech C920 PRO that is 2560×1472, which the camera only offers as uncompressed YUYV and can only sustain at 2 fps over USB 2.0. The same camera does 1920×1080 MJPEG at 30 fps, but there is no way to ask for it: the selection logic ranks formats by pixel area alone and never considers frame rate or pixel format.
A resolution-only menu would not help here either, since the unusable mode is the largest one.
The change
2 fpsinstead of hiding in a range.cameraFormat/<id>) and survives restarts. Until one is picked, behavior is unchanged. If the camera stops offering the saved format, the default pick is used (covered by a unit test).bestCameraFormathad no remaining callers, so it is removed.Testing
QT_FFMPEG_ENCODING_HW_DEVICE_TYPES=, ./bin/test: backend 20/20 and UI 3/3 pass, including new tests for the format label/key, the default pick, and saved-format fallback.realEncoding,recoveryAndSave,editingAndExport,leavingDeletesTake,staleTakeIsNotRecovered,delayedCaptureStaysInSync) fail on this machine, identically on unmodified master. See the note below.1920 × 1080 · MJPEG · 30 fps(checked withv4l2-ctl), the choice persists across restarts, and./bin/test-camerarecords a 4 s take at that format when the Qt hardware-encoder probing described below is disabled.Note: an unrelated startup delay I ran into
On my machine (Qt 6.12, FFmpeg 9.0.2, RTX 4060 Ti, Ryzen 9 7900) a take at 1080p MJPEG stopped with "Audio encoding cannot keep up". I first assumed encoder throughput, but it looks like startup latency instead:
Writergives up at ~530 ms (its 500 ms queued-audio limit), before the software encoder has been opened.QT_FFMPEG_ENCODING_HW_DEVICE_TYPESbefore launch (to one backend, a pair, or empty) makes the same take record, and the failingrealEncodingtests fail the same way at 320×240, which throughput cannot explain.I have not verified that a longer startup allowance in
Writerfixes it, and I only tried one machine, so I have left it out of this PR. It may be part of what #3 and #8 report on other machines.