Converting videos to images
I just wanted to split a video file in each single frame and did not find a program that solves this problem. A colleague recommended videodub, but when I see DLL’s or a .exe
I get insane! I’ve been working a little bit with OpenCV before and coded my own solution, containing only a few lines.
The heart of my solution consists of the following 13 lines:
It just queries each frame of the AVI and writes it to an image file. Thus, not a big deal.
The complete code can be downloaded here. All you need is OpenCV and a C++ compiler:
Just start it with for example:
If you prefer JPG images (or other types) just change the extension string form .png
to .jpg
.
Leave a comment
There are multiple options to leave a comment: