Record webcam automated with unknown duration

0

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.

Chris

Posted 2014-02-06T22:39:33.233

Reputation: 11

Answers

1

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.

Anko

Posted 2014-02-06T22:39:33.233

Reputation: 204

I'm using Win7. Sry, for not being specific enough. – Chris – 2014-02-06T23:28:20.053

@Chris Ah, ok. I don't have a Windows handy to test on, but some clues would indicate you can do something similar with vlc.exe from Windows' command line, though obviously with different flags. Worth investigating.

– Anko – 2014-02-06T23:32:14.190