-
Notifications
You must be signed in to change notification settings - Fork 8
FFmpeg
FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations.
Specifically for CAM2 database team, we want to prepare enough image data for the image processing team. Since most of the network cameras are video steams, of course we can manually do a screenshot every second to get the image but this is clearly not an efficient way. Life becomes much easier with FFmpeg, you can simply use one command to extract thousands of frames from a given video in a short time. It can also handle multiple video inputs at the same time.
For Linux user: sudo apt install ffmpeg
For Mac user: brew install ffmpeg
For Windows user: install linux and then do sudo apt install ffmpeg
ffmpeg -i input.mp4 -vf fps=1/60 output_frame_%0d.bmp
This example allows you to extract 1 frame every 60 seconds from the input.mp4 video and store the frame images into the current folder.
input.mp4 is the name of the input video.
fps=1/60 is the number of frames you want to extract every 60 seconds and it can be modified.
output_frame_%0d.bmp is the name of the output frame image. You can change .bmp to .jpg to reduce the image size.
ffmpeg -i input.flv -ss 00:00:14.435 -vframes 1 out.bmp
This example will seek to the position of 0h:0m:14sec:435msec and output one frame from that position into a BMP image file.
input.mp4 is the name of the input video.
00:00:14.435 is the position where you want the image.
out.bmp is the name of the output image.
Check out the official FFmpeg website.FFmpeg website
©️ 2016 Cam2 Research Group