Professional Documents
Culture Documents
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no
registration required.
Tell me more
I would like to ask you to help me with getting all the frames from video file using Emgu CV. I know I can
use Capture class and its QueryFrame() method, but this only returns one frame. What is the
easiest way to get all the frames? (and save it for example to Image<Bgr, Byte>[]) I need all the
frames to do some more processing (to be more specific: key frame extraction for video summarization).
Thanks a lot for your help.
c#
video
emgucv
2 Answers
See my answer here for reference Emgu Capture plays video super fast
But this should do as you ask I've used a list to store the images you can use an array but you will need
to know how big your avi file is.
1/4
08/06/13
}
This was designed to allow playback of the video file at a responsible rate but as your simply converting
you could use the Application.Idle method just as easily like this...
[EDIT]
As requested this is a method version of retrieving all frames from a video file I have not tested this on a
large video file as I expect that the program would crash since it will require a lot of memory.
stackoverflow.com/questions/8472946/emgu-cv-get-all-frames-from-video-file
2/4
08/06/13
3/4
08/06/13
while (Reading)
{
Image<Bgr, Byte> frame = _capture.QueryFrame();
if (frame != null)
{
image_array.Add(frame.Copy());
if (SW.ElapsedMilliseconds >= Time_millisecounds) Reading = false;
}
else
{
Reading = false;
}
}
return image_array;
}
and this would be called like this:
List<Image<Bgr, Byte>> Image_Array = GetVideoFrames(10000); //10 Secounds
Thanks, I just don't want to use it in Application.Idle. I simply want to have a function that I can call
whenever I want and it returns me list of Image<Bgr,Byte> frames from given video input. tom Jan 6 '12 at
20:17
Hi I've added to code in a method that you could call, I hope this is what your after if no let me know Cheers
Chris Jan 9 '12 at 17:01
Even i faced the same issue.So i initialised another timer and provided the video save code in there.And
this timer is enabled only when the record button[The button on the form which on click record the video]
is clicked.Now i can capture video but the audio is not getting recorded.
answered Nov 10 '12 at 9:51
Ahammed
31 2
Not the answer you're looking for? Browse other questions tagged c# video emgucv
or ask your own question.
stackoverflow.com/questions/8472946/emgu-cv-get-all-frames-from-video-file
4/4