_ _ (_) ___ | |_ ____ | |/ _ \| __|_ / | | (_) | |_ / / _/ |\___/ \__/___| |__/
One way to display the webcam stream in the bottom right corner of the screen:
ffplay /dev/video2 -noborder -alwaysontop -left $((1920-380)) -top $((1080-300)) -x 320 -y 240
A way to display the webcam stream half size:
ffplay -vf "scale=iw/2:-1" /dev/video2
Here's a script to display the webcam in the bottom right corner of the screen, which dynamically adapts to the screen dimensions:
#!/bin/bash
# Specify the desired camera view dimensions
cam_w=320
cam_h=240
margin=60
# Get screen dimensions
scr_dims=`xdpyinfo | grep 'dimensions' | grep -o -m 1 '[0-9]\+x[0-9]\+' | head -n 1`
# Extract screen width and height
scr_w=`grep -o '^[0-9]*' <<< $scr_dims`
scr_h=`grep -o '[0-9]*$' <<< $scr_dims`
# Print screen dimensions in terminal
echo "screen dimensions " $scr_dims
echo "screen width " $scr_w
echo "screen height " $scr_h
# Run ffplay to display the camera on screen
ffplay /dev/video2 -noborder -alwaysontop -left $(($scr_w - $cam_w - margin)) -top $(($scr_h - $cam_h - $margin)) -x $cam_w -y $cam_h