3 Replies - 10585 Views - Last Post: 27 June 2010 - 12:23 PM Rate Topic: -----

#1 maldiyani  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 08-November 08

How to capture frames from video using c++?

Posted 27 June 2010 - 08:46 AM

Hi fellas,

I have a problem about capturing frames from an avi video file. How can i do that in my program using c++ and maybe opengl?
Is This A Good Question/Topic? 0
  • +

Replies To: How to capture frames from video using c++?

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: How to capture frames from video using c++?

Posted 27 June 2010 - 09:06 AM

Sorry but we can not give you the entire code to solve your problem. We are here to assist in solving problems with code you have written, with any error messages you are getting or what isn't working the way that you expect it to, we would be more than happy to help you with those problems. If there is a topic that you don't understand we would be more than happy to help you with that as well. Make sure to post any code with in code tags like below.

:code:

Be sure to visit our tutorial and snippet areas or read the FAQS at the top of the forums. Also, take a moment to read the rules about posting topics.

Thank you for helping us to help you solve your problem.
Was This Post Helpful? 0
  • +
  • -

#3 Salem_c  Icon User is offline

  • void main'ers are DOOMED
  • member icon

Reputation: 2130
  • View blog
  • Posts: 4,196
  • Joined: 30-May 10

Re: How to capture frames from video using c++?

Posted 27 June 2010 - 09:13 AM

A lot of reading and a lot of hard work ;)
http://www.jmcgowan.com/avi.html

Depends if you can find a suitable library (or codec as they're called) which can extract frame data for you (you didn't mention OS/Compiler).

One thing to remember about AVI files (and video files in general) is that not all the information necessary for every frame is encoded in every frame. To render a specific frame, you have to locate the previous 'key' frame, then apply all the deltas which follow up to and including the frame you want.


The source code for http://www.videolan.org/vlc/ might tell you how to do it.
Was This Post Helpful? 1
  • +
  • -

#4 Aphex19  Icon User is offline

  • Born again Pastafarian.
  • member icon

Reputation: 617
  • View blog
  • Posts: 1,873
  • Joined: 02-August 09

Re: How to capture frames from video using c++?

Posted 27 June 2010 - 12:23 PM

First of all, understand how pixels are represented in AVI files (looking at the header of the file might help), as in, how many bytes, or bits each pixel uses. For example, RGB, BGR, RGBA etc... ignoring sound data of course.

Then it's a case of finding the relevant pixel data in the AVI file. The problem really is finding info on the AVI file format, I have looked everywhere and I cann't find any, or maybe it's just my bad research skills?

Maybe if you have never done something like this before, you could try with the bitmap (image) format, which has plenty of documentation to help you.

As for reading binary files, I wrote a simple tutorial on reading binary files in C/C++ if this helps...

This post has been edited by Aphex19: 27 June 2010 - 12:23 PM

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1