Capture a JPEG photo with a specific resolution from video device

v4l2-ctl

v4l2-ctl --device {{path/to/video_device}} --set-fmt-video=width={{width}},height={{height}},pixelformat=MJPG --stream-mmap --stream-to={{path/to/output.jpg}} --stream-count=1

click the source code to copy install v4l2-ctl on any operating system with command-not-found.com