#!/bin/bash export LD_LIBRARY_PATH=/usr/local/lib ffmpeg -vsync 0 -hwaccel cuda -hwaccel_output_format cuda `# we need nvidia acceleration because of low fps without it` \ -r 30 -video_size 640x480 -i /dev/video0 `# this is camera` \ -f alsa -i default -async 1 `# this is audio. Why not pulse? Nvidia?` \ -c:v h264_nvenc `# this is video codec` \ video.mp4 # output file #-filter_complex 'overlay=main_w-overlay_w:main_h-overlay_h' `# this is overlay` \ #-f x11grab -framerate 30 -video_size 1920x1080 -i :0 `# this is screen` \