Repository navigation
Conversation
Cameras that offer their top resolution only as MJPEG delivered Format_Jpeg frames, which Qt's FFmpeg encoder decoded to 4:4:4. Hardware H.264 encoders reject that, so Qt fell back to software x264 at 4:4:4 10-bit, which cannot keep up at 1080p on modest CPUs and produced files most players cannot play. Decode those frames in Writer on a small worker pool (libavcodec MJPEG, then libswscale to NV12) and keep them ordered before they reach the encoder, so the GUI thread and camera delivery are no longer blocked. Output is standard High-profile yuv420p. Add a Resolution menu beside Camera and Microphone listing the sizes the camera offers. The maximum stays the default; an explicit choice is stored in settings and falls back to the maximum if the camera lacks it. Fixes omacom#3 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
|
Thanks for working through this. The MJPEG-to-4:2:0 half landed in #32, which now decodes MJPEG with libjpeg-turbo, and also handles YUYV and RGB, so NVENC and VA-API apply. The wrong-default half was fixed by #19, which skips 2 fps still sizes. That leaves the resolution menu, which overlaps the format picker in #14, so I'm closing this one. |
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 #3.
What
Cameras that only offer their top resolution as MJPEG could not be recorded at that resolution on modest hardware ("Video encoding cannot keep up..."). This makes them work, and gives people a way to pick a lower resolution.
Writernow decodesFormat_Jpegframes itself (libavcodec MJPEG, then libswscale to NV12) and hands the encoder ordinary 8-bit 4:2:0 frames. Before, Qt decoded them to 4:4:4 inside the encoder, which hardware H.264 encoders reject, so it fell back to software x264 at 4:4:4 10-bit. The output is now standard High-profile yuv420p.camera/resolutionand falls back to the maximum if the camera lacks that size.libavcodecandlibswscalecome with theffmpegpackage that is already a dependency.Testing
./bin/test: backend 15/15 and UI 3/3 pass (the UI test's stand-in backend gained the newresolutionsproperties)../bin/test-camera, went from failing to completing at about 29 fps, producingHigh/yuv420pH.264. Switching to 1280x720 in the menu also works.🤖 Generated with Claude Code