Sign in to follow this  
CoderGuy

Questions on Python, C++, and ffmpeg

Recommended Posts

CoderGuy    130
Hi everybody, I have just a couple of questions about Python and game development. My teammates and I last Winter and Spring programmed a game framework similar to PyGame for our senior project. It used SDL, C, and OpenGL, while using PyGame just for reading from the keyboard. What we're doing now is starting over from scratch and using what we learned at school to be a learning experience. Not that our project wasn't successful, just that we felt that we could do a better job with the knowledge we gained to write better code, and know what to avoid this time around. I am the graphics programmer on the team and the graphics library that we'll be using is OpenSceneGraph, which is a C++ 3D graphics toolkit. We will be using Python for the game engine. The last time we extended Python with C, but I am wondering if embedding Python in C++ will give any advantages over extending Python with C++. I know quite a bit of games use scripting languages with C,C++, and Java, and I'm wondering which is the route to go. I'm not trying to start a flame war or anything, I'm just not wanting to have us pick one and then wish that we picked the other down the line. For embedding Python, I was figuring on using Boost.Python. Also, I would like to use Ogg Theora video files. I really like using ffmpeg2theora, but I know that it has the mpeg license to deal with. Would it be ok if I converted say an avi file to Ogg Theora using it? We would like to eventually sell our game so commercial use does come into play. We wouldn't be embedding ffmpeg into our software, just using it to convert avi or or other proprietary free codecs into Theora. Does OpenML work on the Mac?

Share this post


Link to post
Share on other sites
mikeman    2942
Personally, I'm towards extending Python with C++. That is, write the most intensive modules in C++ and then use Python to "drive" those modules and write the main logic. That has the advantage that,well, you're writing the higher-level logic in Python and not C++. That gives you all the goodies that come with Python(expressiveness,automatic memory management,easier refactoring,etc). Having C++ executing small Python scripts doesn't give that much. IMO, pretty much the only thing embedding gives you is that you don't have to recompile the scripts. Also, extending with Boost.Python is easier and more straightforward than embedding.

Share this post


Link to post
Share on other sites
Oluseyi    2103
Quote:
Original post by mikeman
Personally, I'm towards extending Python with C++. That is, write the most intensive modules in C++ and then use Python to "drive" those modules and write the main logic. That has the advantage that,well, you're writing the higher-level logic in Python and not C++. That gives you all the goodies that come with Python(expressiveness,automatic memory management,easier refactoring,etc). Having C++ executing small Python scripts doesn't give that much. IMO, pretty much the only thing embedding gives you is that you don't have to recompile the scripts. Also, extending with Boost.Python is easier and more straightforward than embedding.

QFE&T.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this