2

How can I instruct ffmpeg (v.: 3.4.5) to record only one frame per minute from my video camera at /dev/video0 and copy it to a new file with 30 frames per second? Goal is timelapse video of some months and record only one frame per minute into the out video to save space and processing power instead of just capturing the camera at 30fps and then preprocess the huge video file for speed up...

The camera delivers a 1920x1080 30fps stream with "mjpeg" selected in commandline. I would like to keep the raw frames and just copy them into the out file. I tried this command to get 1fps input to 30fps output but this seems not to work:

ffmpeg -framerate 1 -input_format mjpeg -i /dev/video0 -r 30 -c:v copy -an out.mp4

[video4linux2,v4l2 @ 0x55ece63ac360] The driver changed the time per frame from 1/1 to 1/30
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 37064.594605, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 1920x1080, 30 fps, 30 tbr, 1000k tbn, 1000k tbc

But this doesnt work.

Paul G.
  • 461
  • 6
  • 21

1 Answers1

1

I think this might be a solution. Keep the input framerate as it is but instead set the out rate to be one frame per minute and output images from the stream so that I can later put them togheter via ffmpeg with my desired target framerate:

ffmpeg -input_format mjpeg -i /dev/video0 -r 1/60 out%3d.jpeg
Paul G.
  • 461
  • 6
  • 21