Posted: . At: 6:29 PM. This was 10 years ago. Post ID: 7418
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

How to use VLC to record a timelapse video for fun.

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

My completed video file.

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.

8 thoughts on “How to use VLC to record a timelapse video for fun.”

  1. 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!

    Reply
  2. 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:

     $ cvlc v4l2:// :v4l2-dev="/dev/video1" --video-filter=scene --ut=dummy --aout=dummy 
    --intf=dummy --scene-format=jpg --scene-ratio=400 --scene-prefix=snap 
    --scene-path=/home/jonnix/Pictures/shots v4l2:// vlc://quit

    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

    Reply
    • Try this instead and see how you go.

      cvlc v4l2:// :v4l2-dev="/dev/video1" --video-filter=scene --ut=dummy --aout=dummy 
      --intf=dummy --scene-format=jpg --scene-ratio=400 --scene-prefix=snap 
      --scene-path=/home/jonnix/Pictures/shots/ v4l2:// vlc://quit
      Reply
  3. 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.

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.