Request MJPG for the webcam overlay when the camera offers it - #9306
Open
atavacron wants to merge 1 commit into
Open
Request MJPG for the webcam overlay when the camera offers it#9306atavacron wants to merge 1 commit into
atavacron wants to merge 1 commit into
Conversation
ffmpeg's v4l2 demuxer picks YUYV if input_format is unset. On common UVC cameras that format is 5-10 fps at 720p while MJPG is 30 fps at the same size. Probe list-formats-ext, prefer a compressed 30 fps mode, and pass input_format into mpv. Closes omacom#7300 Co-Authored-By: Grok 4.6 (high) <noreply@x.ai> Co-Authored-By: atavacron <8923127+atavacron@users.noreply.github.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.
What
Pick the v4l2 size/format for
omarchy screenrecord --with-webcamfromv4l2-ctl --list-formats-extinstead of asking ffmpeg to guess.ffmpeg's v4l2 demuxer selects YUYV when
input_formatis unset. On common UVC cameras that raw mode is 5–10 fps at 720p, while MJPG at the same size is 30 fps. The overlay then looks choppy regardless of--webcam-size.omarchy-capture-webcam-formatnow:input_format) or toframerate=30if probing failsstart_webcam_overlay()passes that string to mpv's--demuxer-lavf-o.Closes #7300
Tests
test/shell.d/capture-webcam-format-test.sh— stubbedv4l2-ctlfixtures for:input_format=yuyv422framerate=30./test/clipassed, including command metadata for the new hidden helper.Hardware check (no media attached)
UVC camera with both MJPG and YUYV. mpv launched with the same
--demuxer-lavf-othe overlay uses; format read back withv4l2-ctl --get-fmt-video/--get-parmwhile mpv held the device:--demuxer-lavf-ovideo_size=640x360,framerate=30,input_format=mjpeg)video_size=640x360,framerate=30video_size=1280x720,framerate=30(#7300 path)video_size=1280x720,framerate=30,input_format=mjpegNo screenshots or recordings attached.