Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Crops output of camera to zoom in for Zoom sessions
- # apt install v4l2loopback-dkms v4l2-ctl ffmpeg
- # Check if v4l2loopback not running
- if ! v4l2-ctl -D -d 5 >/dev/null 2>&1; then
- echo "Create virtual video device (requires sudo)"
- sudo modprobe v4l2loopback video_nr=5 card_label="Loopback video"
- fi
- # Camera resolution is 1920x1080
- echo "Activating loopback video device - press <q> to exit"
- # ffmpeg -hide_banner -loglevel error -s 1920x1080 -i /dev/video0 -f v4l2 -pix_fmt yuv420p -filter:v "crop=1280:720" /dev/video5
- ffmpeg -hide_banner \
- -loglevel error \
- -s 1920x1080 \
- -i /dev/video0 \
- -f v4l2 \
- -pix_fmt yuv420p \
- -vf "crop=1280:720, lenscorrection=k1=-0.1:k2=-0, eq=brightness=-0.1" \
- /dev/video5
- echo "Loopback video device feed closed"
- kill -9 $PPID
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement