🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

NeHe Lesson 35 (Playing AVI) Problems

Started by
4 comments, last by llvllatrix 17 years, 5 months ago
Greetings, This is my first time posting here. I was trying to do AVI from openGL on my computer and decided to try out lesson 35 of the NeHe tutorial. Well I tried using my own video, and I tried using the vidoe (Face2.avi) he supplied, but both of them crap out on this line: pgf=AVIStreamGetFrameOpen(pavi, NULL); // Create The PGETFRAME Using Our Request Mode if (pgf==NULL) { // An Error Occurred Opening The Frame MessageBox (HWND_DESKTOP, "Failed To Open The AVI Frame", "Error", MB_OK | MB_ICONEXCLAMATION); } Always throws the error on me: "Failed To Open The AVI Frame" But the problem is...I have no idea what to do now. It won't run, and there is no explanation of why it won't get the frame. Is it a codec thing? Is it a format problem? I'm confused. If anyone could help on this I would appreciate it greatly. Thank you for your time.
Advertisement
Anyone out there? Anyone who has experience with AVIs in openGL? Beuler?
According to the following it is a codec problem. The latter seems to post a solution.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_avistreamgetframeopen.asp
http://www.gamedev.net/community/forums/topic.asp?topic_id=373379

If the solution does not work, search the Microsoft documentation in the first link for error retrieval functions. Many SDKs support mechanisms for retrieving more information from an error event.

Cheers,
- llvllatrix
Thank you for replying to me. I had written out to another forum because I was under the impression this forum was for readers and not posters. You renewed my faith in the gamedev community. I figured out that it was a codec from the other forum but still thank you for the links. They will definitely help me in my research on the subject.
Hello again,

I saw this link you posted:

http://www.gamedev.net/community/forums/topic.asp?topic_id=373379

What I am curious about now is
1) How did he (the poster in that link) get an xvid codec to work for him? Only Indeo, RLE and two other bad codecs work with VFW I thought (reading from John McGowan's site, or misreading)
2) Now that I know that it is a codec problem is there anyway to specify a certain codec/certain type of codec and if so where in that code (NeHe's Lesson 35) would I be able to specify that?
3) Does this only accept DIB compression capable codecs?
4) What does it mean to be a Device Independent Bitmap Compression codec. I mean I understand the device independent bitmap is one that can play on other devices than those it was compressed on, but that is about it. What about those particular codecs (listed on the MSDN website: http://www.microsoft.com/whdc/archive/fourcc.mspx ) makes them DIB Compression Codecs that doesn't make the other ones so. I have been looking at John McGowan's website regarding FourCCs and DIB and I'm just more and more confused about codecs as I dive in deeper
5) If there is not a viable way to manage a good looking (my videos look all pixelated depending on which codec I use...RLE seemed to look the best) codec, what other options might I have? I don't see any C++ specific coding tutorials for using something like MPEG, which might look better...I think

I know these are a lot of questions, but if someone can answer them it would greatly improve my knowledge of video in general and how it works in openGL and for the NeHe tutorial.
Unfortunately I don't know much about codecs and video. Regarding question 2, I know there is a Microsoft SDK called microsoft media encoder that lets you specify the fourcc for the codec you want. I'm sure there are other SDKs that will let you decode video as well. libavcodec, for example (http://en.wikipedia.org/wiki/Libavcodec) seems like a good place to start; their communities can probably give you better insight into your questions. Once you can decode the video, I'm sure someone on the nehe forums can help you get the video rendered in OpenGL. It should be as simple as converting the captured frames into a textures.

Sorry I couldn't be of more assistance,
- llvllatrix

This topic is closed to new replies.

Advertisement