It would be probably better to use some webcam-specific software that simply takes screenshots of the webcam images on a fixed schedule. These software are made specifically for this task.
If you want to create a time lapse video with very long interval, you can use OBS Studio for it, but it's a bit tedious and you need postprocessing software.