Advertisement
smeech

Zoom-crop.sh

Mar 19th, 2024 (edited)
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.82 KB | None | 0 0
  1. #!/bin/sh
  2. # Crops output of camera to zoom in for Zoom sessions
  3.  
  4. # apt install v4l2loopback-dkms v4l2-ctl ffmpeg
  5.  
  6. # Check if v4l2loopback not running
  7. if ! v4l2-ctl -D -d 5 >/dev/null 2>&1; then
  8.    echo "Create virtual video device (requires sudo)"
  9.    sudo modprobe v4l2loopback video_nr=5 card_label="Loopback video"
  10. fi
  11.  
  12. # Camera resolution is 1920x1080
  13.  
  14. echo "Activating loopback video device - press <q> to exit"
  15. # ffmpeg -hide_banner -loglevel error -s 1920x1080 -i /dev/video0 -f v4l2 -pix_fmt yuv420p -filter:v "crop=1280:720" /dev/video5
  16.  
  17. ffmpeg -hide_banner \
  18.    -loglevel error \
  19.    -s 1920x1080 \
  20.    -i /dev/video0 \
  21.    -f v4l2 \
  22.    -pix_fmt yuv420p \
  23.    -vf "crop=1280:720, lenscorrection=k1=-0.1:k2=-0, eq=brightness=-0.1" \
  24.    /dev/video5
  25.    
  26. echo "Loopback video device feed closed"
  27. kill -9 $PPID
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement