Advertisement

ffMPEG VS C++ example

Started by November 03, 2011 06:11 PM
2 comments, last by Zahlman 13 years, 3 months ago
The last few days, I've been searching for a simple method to display video files in my program. I am coding an engine of sorts using Visual Studio / C++, utilizing OpenGL through the SFML group of libraries. I am well-versed in OpenGL itself and I understand how to use it in addition to the basic SFML functionality. So now I am looking for a way to display video through these methods and I've looked at Theora, SFML's ogv playback, and then finally ffMPEG. I decided on ffMPEG based on what it is capable of playing and I started looking for all development code and examples I could find, but I'm reaching a problem.

Any example code I find is laid out for building in linux or has make options I don't fully understand. I could probably figure them out, but my engine is being made specifically for visual studio to be used by a small group of people that I don't want to have to learn special build commands and procedures. I was hoping there was a simpler way to implement the ffMPEG functionality to play videos. I found an example.c file online and attempted to use it, but then I get unresolved external symbols even when I know my library includes are correct and I have the proper headers...

I was hoping someone had a working Visual Studio project example for ffMPEG or could quickly create one using the example code they provide. I am currently using Visual Studio 2008 (AKA VC9).
This man made my day: http://www.gamedev.net/community/forums/topic.asp?topic_id=523021
Alright, after a few hours of scrounging, I managed to get one of the examples running for Theora. I then altered it to not utilize the GLUT setting it was in, but that brings up a whole new problem. In the GLUT example, there seems to be no problem at all. (GLUT example attached [GLUTExample.zip]) but in my basic OpenGL example any video with sound will fail to replay (OpenGL example attached [Example.zip]). Could someone look over this code and tell me what I'm doing wrong?

Both attached examples should have all of the files within them that are needed so nobody will have to install libraries or include file folders... if anything is missing please tell me.
This man made my day: http://www.gamedev.net/community/forums/topic.asp?topic_id=523021
Advertisement
I decided to go through and try to make these two examples as similar as possible, and I found the issue. I had a discrepancy in the Update function, and when I made them equal they both worked. Although I didn't receive any reply to this topic, thank you to anyone who looked into it. (to anyone looking for this solution, take the update() function from the GLUT Example and copy it over to the normal openGL example...)
This man made my day: http://www.gamedev.net/community/forums/topic.asp?topic_id=523021
Closed per OP request.

This topic is closed to new replies.

Advertisement