VLC can be used to record a timelapse video with a USB webcam. I have just done this and it worked a treat when I tried this. Connect your webcam to your computer and run this command to begin recording. A VLC timelapse can be fun to watch.
cvlc v4l2:// :v4l2-dev="/dev/video0" --video-filter=scene --vout=dummy --aout=dummy\ --intf=dummy --scene-format=jpg --scene-ratio=400 --scene-prefix=snap \ --scene-path=/home/homer/Videos/shots v4l2:// vlc://quit |
I am using the /home/homer/Videos/shots directory to hold the screenshots. Once I have recorded enough footage, I need to build a list of all the files.
homer@deep-thought ~/Videos/Webcam $ ls -Ltr > files.txt |
Now I create a video file using the files listing.
homer@deep-thought ~/Videos/Webcam $ mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4 -o test.avi -mf type=jpeg:fps=15 mf://@files.txt |
That is how easy it is!
If VLC will not open the video device, edit the /etc/group file and add your username to the video group, then log out and back in again. This will fix the permissions issue easily if you get a permission denied error when trying to access /dev/video0. Below is another way to generate a nice video from all of the jpg files created in the first step.
(base) jason@jason-Lenovo-H50-55:~/Videos/shots$ ffmpeg -framerate 30 -pattern_type glob -i '*.jpg' -c:v libx264 -pix_fmt yuv420p out.mp4 |
This is very fast and easy to do.
will this still work in 2022?
I can easily see my security cams on VLC and want to make a timelapse of one of them.
Any tips?
thanks!
sorry the ” — ” in the command I just posted got merged ….
Hi John Great pointer and has helped me set up 2 timelapse cams… I have one problem tho’
I set up a /home/jonnix/Pictures/shots directory and inserted that in your command above:
but the images from the video1 cam defaults to being saved in the /Pictures dir. and not /Pictures/shots – I can’t find out why that is?
This is problematic as in the end I want to run the 2 cams to 2 folders, say /shots and /shots1, to then generate 2 films to use on a split screen
I’ve been through vlc looking for how to change the default directory in some other way but tbh I can’t find why/where its set to /home/jonnix/Pictures as the default…. so any advice gratefully received
Try this instead and see how you go.
yes that did it !! (just added back the ‘vo’ I dropped to ‘….. –ut=dummy –aout=dummy …’) many many thanks John!
Cool, I never thought that VLC could have such useful function. I will try it later. Aside from using VLC, I’d also recommend Acethinker Online Screen Recorder which I have been using for many years. It is a free web-based tool that lets you record your screen right from your browser. You don’t have to install any additional plug-ins or add-ons.
Try –scene-ratio=300 for faster interval and –scene-ratio=600 for a slower interval.
Thanks.
How do you adjust the time between pictures?
Thanks!