From af564ed07d7a7babc90517b37905118ebb01f6a0 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Fri, 10 Oct 2025 21:37:57 -0400 Subject: [PATCH] Fix webcam to select 16:9 on FW13 and others --- bin/omarchy-cmd-screenrecord | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/bin/omarchy-cmd-screenrecord b/bin/omarchy-cmd-screenrecord index f3b377d0..62bf951d 100755 --- a/bin/omarchy-cmd-screenrecord +++ b/bin/omarchy-cmd-screenrecord @@ -33,8 +33,19 @@ start_webcam_overlay() { # Target width (base 360px, scaled to monitor) local target_width=$(awk "BEGIN {printf \"%.0f\", 360 * $scale}") - # Scale maintaining aspect ratio (-1 means auto-calculate to maintain ratio) - ffplay -f v4l2 -framerate 30 /dev/video0 \ + # Try preferred 16:9 resolutions in order, use first available + local preferred_resolutions=("640x360" "1280x720" "1920x1080") + local video_size_arg="" + local available_formats=$(v4l2-ctl --list-formats-ext -d /dev/video0 2>/dev/null) + + for resolution in "${preferred_resolutions[@]}"; do + if echo "$available_formats" | grep -q "$resolution"; then + video_size_arg="-video_size $resolution" + break + fi + done + + ffplay -f v4l2 $video_size_arg -framerate 30 /dev/video0 \ -vf "scale=${target_width}:-1" \ -window_title "WebcamOverlay" \ -noborder \