Record video from webcam using cli

I would like capture from my usb webcam video like dashcamera or CCTV but using only cli. Video would have only 1FPS (with timestamps) and movies will be splited (depends of movie length or file size) if is longer than ex. 1 hour or 1GB. Is there any application which can be run from cmd line to achive that effect?

You could use either ffmpeg or vlc. The exact arcane incantation will also depend on your video source.

If the camera doesn’t overlay the date and time on the video stream, both vlc and ffmpeg are supposed to be able to do that and I suppose you could also pipe extracted images to ImageMagick/GraphicsMagick and then pipe them back to your final output file.

My webcamera don’t have feature to add timestamp. Thank you for your solution but its complicated. I will try.