command line - Record webcam automated with unknown duration

06
2014-04
  • Chris

    I need to record (not stream) from my webcam, convert it to H.264 and store it in a mp4-container. With VLC media player I can do this manually with the Open Capture Device menu where I just have to press "convert" and set destination file and video codec.

    But I need to do this automated, e.g. with command line or as batch - so that I can start recording from another program - and I don't know how to do that. Second problem is that I don't know the duration beforehand so I need also a possibility to stop recording (maybe a start and stop command ?).

    EDIT: I'm using Windows 7.

  • Answers
  • Anko

    Assuming you're on a UNIXy system,

    ffmpeg -f video4linux2 -i /dev/video0 out.mpeg
    

    works for me. You can press q or send SIGTERM to the process to stop recording.


  • Related Question

    software rec - Application to record Webcam images
  • darthvader

    I am looking for a light webcam application to take photos. Any suggestions?


  • Related Answers
  • joe

    http://dorgem.sourceforge.net/

    if you have logitech web cam or some brand webcame has own software. Those will do this operation

    Microsoft have a webcam timed capture app as part of the WindowsXP power toys. I use it, it's good.

  • Adam Matan

    Microsoft Webcam Timershot, a part of the poertoys pack. Works for windows XP.

  • Bruce McLeod

    If you are looking to do time lapse photography, I have used Gawker to great effect to video the entire one hour drive to work into a 2 min movie, using my Macbook and a cheap Microsoft webcam.

  • mas

    On GNU/Linux, Gnome cheese works with many webcams.