12.yakir
12.yakir

Reputation: 323

Record from camera, save to file, and acess last recorded frame

I want to record video from a camera, save it to file, and at the same time have access to the last frame recorded.

One idea would be to use ffmpeg's Multiple Outputs functionality where I split the stream into two, one gets saved to file, one spits out the last recorded frame (ideally, the frames won't need to be written to disk, but piped onwards for processing).

What I don't know is how to get ffmpeg to spit "the last frame" from a stream.

Any ideas?

Upvotes: 0

Views: 559

Answers (1)

llogan
llogan

Reputation: 133873

Output a video and continuously update an image every second

ffmpeg -i input.foo outputvideo.mp4 -r 1 -update 1 image.jpg

Output a video and output a new image every second

ffmpeg -i input.foo outputvideo.mp4 -r 1 images_%04d.jpg
  • Output will be named images_0001.jpg, images_0002.jpg, etc.

Also see

Upvotes: 1

Related Questions