A couple of sample commands for ffmpeg
sudo /usr/bin/ffmpeg -f alsa -i hw:0,0 -f v4l2 -input_format h264 -i /dev/video0 -t 00:00:18 -strict -2 /var/www/html/tmp/temp.mp4
sudo /usr/bin/ffmpeg -f alsa -ac 2 -i hw:2,0 -f v4l2 -input_format mjpeg -i /dev/video0 -t 5 -strict -2 /var/www/html/tmp/temp.mp4 2>&1
ffmpeg -f v4l2 -input_format h264 -t 18 -i /dev/video0 -strict -2 /var/www/html/tmp/temp.mp4 2>&1
ffmpeg -f alsa -i hw:0,0 -f mp4 -input_format h264 -i /dev/video0 -r 30 -vcodec libx264 -acodec libmp3lame -ab 96k -t 00:00:10 -strict -2 /var/www/html/tmp/temp.mp4 2>&1
ffmpeg -f video4linux2 -s 400x300 -i /dev/video0 -f alsa -i hw:0,0 -acodec libmp3lame -ab 96k -async 1 /var/www/html/tmp/temp.mp4
ffmpeg -f alsa -r 16000 -i hw:0,0 -f video4linux2 -s 800x600 -i /dev/video0 -r 30 -f avi -vcodec mpeg4 -vtag xvid -acodec libmp3lame -ab 96k /var/www/html/tmp/temp.avi
ffmpeg -f pulse -ac 2 -i alsa_input.pci-0000_00_1b.0.analog-stereo -f v4l2 -i /dev/video0 -t 5 -vcodec libx264 -strict -2 /var/www/html/tmp/temp.mp4 2>/var/www/html/log/ffmpeg.log
ffmpeg -f pulse -ac 2 -i default -f v4l2 -i /dev/video0 -t 00:00:10 -vcodec libx264 -strict -2 /var/www/html/tmp/temp.mp4 2>/var/www/html/log/ffmpeg.2018-10-30.log
sudo -u username /usr/bin/ffmpeg -f pulse -ac 2 -i default -f v4l2 -i /dev/video0 -t 00:00:18 -vcodec libx264 -strict -2 /var/www/html/tmp/temp.mp4 2>/var/www/html/log/ffmpeg.2010-10-31.log