Jun 19
Movie Module Progress: Week 5
So this is it, week 5 of 12/13 weeks. Almost halfway through the summer of code!
So, I managed to get sound working properly, with only minimal skips of quality issues.
- I fixed the buffer issues I mentioned before, so sound sounds great.
- As well, I worked on several other issues within the source code, various bugs, things of that sort.
- On Wednesday, I had a few important questions which I sent to my mentors for help. Those questions were:
-
- Main python was hanging, due to the movie threads not really releasing the GIL. This was solved by examining the source of pgreloaded as directed to do so by Marcus, which required me to come up with a new way of working with Python’s thread primitives.
- Redirecting the output of a video player to a surface of the programmer’s choice. Marcus had some code for that as well, but I have yet to implement that.
- Once I had the GIL issue fixed, I was able to test the surface code, and I discovered that for some reason, the YUV to RGB conversion code was making everything blue. While neat looking, its not very useful. I discovered this was due to an endian assumption, where the code had assumed little-endian and the platform used big-endian. I fixed this by having an endian check, and executing a different bit packing scheme depending on the endianness.
So with those problems fixed, I set about making a backend wrapper around VLC(at the suggestion of Rene), which was some fun working. Some issues with subprocess, which as it turned out, was due to VLC itself, not subprocess. So the current VLC wrapper uses subprocess to execute VLC, and a socket to communicate back and forth with VLC’s remote control interface. As well, I made a dummy module to simulate a movie class, with the appropriate behaviour and members. Then I made a nice front end module which tries to first import my ffmpeg wrapper, then if that fails, to import the VLC backend, and if that fails as well, then it imports the dummy module. I keep the namespaces nice and clean, and hopefully it all behaves properly cross-platform.
So with that, I am announcing an alpha release of basic, untested functionality for the movie module. If you want to help test it, please do so. I’m going to be spending the next week working on more in-depth test cases, and testing every possible code-path(where reasonable…). I prefer to test the module on as many different kinds of movie files possible.
Process to install
If you would like to help test the module(on Linux), here is the process. I assume you have all the necessary libraries to compile a normal svn release of pygame:
- Download ffmpeg-0.5: ffmpeg
- Unpack the package, and fire up a terminal.
- Navigate to the directory, and in the main ffmpeg folder, and type:
./configure --enable-shared --prefix="/usr" - Type make.
- Type
sudo make install - navigate to the libswscale subdirectory.
- type make, then
sudo make install - Now wherever you like, type
svn co svn://seul.org/svn/pygame/branches/tylerthemovie/ pygame_movie - navigate into pygame_movie, and type ./configure
- That done, type
python setup.py build - Last step! Type
sudo python setup.py install
And voila, you have just installed the new movie module for testing. Be aware that this is not the branch most of the 1.9 development occurs on, so you may end up overwriting that, or having conflicts from left behind files. I do try to be good about keeping up on merges between my branch and the trunk. If you have any questions you can email me at trinioler at gmail.com
Comments are off for this post