Score:1

crop webcam output

mz flag

I am using Ubuntu 20.04.3. I have a USB webcam. I can control various aspects of the webcam output using v4l2-ctl e.g.

v4l2-ctl --set-ctrl focus_auto=1,white_balance_temperature_auto=1,backlight_compensation=1,brightness=64

What I would like to be able to do is crop the webcam output for use in online meetings (it currently shows too much background). But none of the parameters returned by v4l2-ctl -l seem to relate to cropping. I also notice that the sliders in the "Cropping & Compose" settings of qv4l2 don't move, and nothing relating to cropping appears when I run guvcview. Is it possible to crop the webcam output?

Here are the details of the webcam from lsusb

Bus 005 Device 002: ID 1bcf:2cb4 Sunplus Innovation Technology Inc. Webcam

And here are details of the driver from v4l2-ctl -d /dev/video0 -D

Driver Info:
    Driver name      : uvcvideo
    Card type        : Webcam: Webcam
    Bus info         : usb-0000:09:00.3-1
    Driver version   : 5.11.22
    Capabilities     : 0x84a00001
        Video Capture
        Metadata Capture
        Streaming
        Extended Pix Format
        Device Capabilities
    Device Caps      : 0x04200001
        Video Capture
        Streaming
        Extended Pix Format
Score:0
mz flag

I've figured out that I can crop the webcam output using another loopback device and ffmpeg. The following zooms in by a factor set in the variable "fac".

fac=1.4
ffmpeg -vcodec mjpeg -r 30 -s 1920x1080 \
       -i /dev/video0 \
       -vf "scale=$fac*iw:-1, crop=iw/$fac:ih/$fac","format=yuv420p" \
       -f v4l2  /dev/video10

I can then choose the relevant video as input before I join my meeting.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.