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}} --duration {{duration_in_seconds}}
wacaw --width {{width}} --height {{height}} {{filename}}
wacaw --to-clipboard
wacaw --list-devices