A little command-line tool for macOS that allows you to capture both still pictures and video from an attached camera. More information: http://webcam-tools.sourceforge.net.
wacaw {{filename}}
wacaw --video {{filename}} -D {{duration_in_seconds}}
wacaw -x {{width}} -y {{height}} {{filename}}
wacaw --to-clipboard
wacaw -L