#!/bin/bash export LD_LIBRARY_PATH=/usr/local/lib ffmpeg -hwaccel cuda -hwaccel_output_format cuda `# we need nvidia acceleration because of low fps without it` \ -f x11grab -r 30 -video_size 1920x1080 -i :0 `# this is screen` \ -f v4l2 -r 30 -video_size 640x480 -i /dev/video0 `# this is camera` \ -f alsa -i default `# this is audio. Why not pulse? Nvidia?` \ -c:v h264_nvenc `# this is video codec` \ -filter_complex "[0][1]overlay=main_w-overlay_w-2:main_h-overlay_h-2[v]" -map [v] -map 2 `# this is for placing camera in bottom right corner. IDK how it works` \ video.mp4 # output file