Question

I am workin' on a Computer Vision project that we need to score videos according to inclusion of some objects, animals or such defined by queries. But for this mission we firstly aim to retrieve some key frames form the video to process with. Do you know any way to do that extraction? I am very newbie on this subjects.

Was it helpful?

OTHER TIPS

Have you looked at using ffmpeg? It is an incredibly powerful utility for all sorts of video manipulation. If you are happy with entering commands directly you can do the following...

Extract a single frame (using -vframes 1) at a specific time in the video (in this case 12 seconds in), type:

ffmpeg -i trial.flv -ss 00:00:12 -vframes 1 -f image2 frame.png

Or, to convert an entire video into individual frames - starting at 31 sec and sampling at the frame-rate specified (-r 5 for 5Hz), type:

ffmpeg -i trial.flv -ss 00:00:31 -y -sameq -r 5 -f image2 frame%03d.png

The flag -y will overwrite existing files and the flag -sameq will enforce the same quality per image file. The bit at the end is the name to give the output frames (with 3 zero-padded decimal numbers to distinguish each in order - %03d).

Just make sure you have got enough space to store all those frames!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top