Archive for June, 2009

Movie Module Progress: Week 6

June 29th, 2009 | Category: Uncategorized,programming

So, week six. I devoted this entire week to exhaustive testing and bug fixing. Its just good software development to take some time, and test and fix bugs. No new features, nothing. I also took the time in the process to refactor a section of code I felt was extremely hacky and brittle. The benefit is that I ended up creating a couple of special-purpose functions which can be reused in multiple areas in the code for the future, possibly. As I found small bugs or issues, like deadlocks, I fixed them. There were a few that remained by Friday:

  • Unpausing doesn’t work right. The video would jerk and stutter after unpausing.
  • Audio and Video would drift out of sync within about 8 minutes on my test video.
  • Sound would not restart on a replay

As of today(Monday), I fixed the sound restart issue, thanks to Rene’s advice, and the unpausing issue. Ironically enough, the unpausing issue was an extremely simple fix. The sound restart issue required me to simply play sound buffers of no sound while the sound was stopped. For the audio and video drift issue, I know why its happening, which is because I unlinked video timing from being synced to the audio. I knew I would have to fix this eventually, but it was an issue for later on. I implemented a first kind of draft solution today, which caused the video+audio to jerk and stutter. Very strange.

Once I have these issues fixed, and a lot of the slightly jury-rigged code from various attempts to fix or examine the various issues, I’ll begin adding new features.
I will add for the Beta release:

  • Subtitle support. This way you can have your in-game video with subtitles for the deaf and hard of hearing. Trust me on this, its necessary. I’m hard of hearing myself, and I’m seeing more and more games that don’t have subtitles as an option.
  • Rect assignation support. You can assign a rect, along with the surface of choice, to dictate which portion of the video image will be written to the surface you give.
  • Seeking support. Now, you should be able to seek to (somewhat depending on the format) arbritary points in the video file
  • Fix a couple of minor issues, like delayed resizing of the image
  • Begin working on a sound api, for developers that choose to redirect the sound samples to the sound system of their choice.
  • Adding more backends(like mplayer), and updating the backends we currently have to work better and faster
  • With the mplayer backend, the plan is to have the video streamed as frames over pipes, so the smart programmer can do…whatever they want with those.
  • Try to clean up the code, make it more readable, add a lot more updated documentation, including flow-charts!
  • And other features as requested by the community members. If there’s a feature you want, email me at either zeroth AT oddco.ca or trinioler AT gmail.com. They both go to the same mailbox. :)

And checking with the schedule I gave the mentors, it appears I’m actually a week ahead of schedule! Granted, I’ve had to change my plans and ideas for the module as I learned more, but thats how the world works. :) I will predict Beta release in 3-4 weeks, including this week, which will give me time to update and fix bugs in all the other backends, as well as testing and bug fixing, after the beta release. In addition, after that I will begin the work of making the code work and compile on Windows and with Python 3.

Comments are off for this post

Science Fiction predicts the future?

June 24th, 2009 | Category: Uncategorized

I’m watching a documentary on the parallels between the market crash of 1929, and the market crash in 2008(last year). I was reminded of the exploits of Adam Zimmerman, of Brian Stableford’s Emortality series, where Adam used his brilliance in the stock markets to cause a massive market crash, while the masters of the business world buy everything up cheaply for pennies on the dollar.

This bears frightening parallels to what happened last year. The only real difference is that Adam engineered the collapse in 2025. One has to wonder if maybe Stableford was right, but just a bit wrong as to when it would happen?

Comments are off for this post

Intelligence Gathering Issues

June 23rd, 2009 | Category: Uncategorized

All too often we see reporters miss the real questions or lob easy ones at the Powers That Be. This isn’t enough to make me paranoid, as generally, people do good. But one particular line in this Time article about missing boy Danny Barter really got me interested. The line in question is this:

Their hope has been bolstered by investigators with the FBI and the Baldwin County Sheriff’s Office, which reopened the case last year after hearing of a recent conversation.

“A lead was sparked when someone was sitting in a public area talking about what happened,” FBI spokeswoman Joyce Riggs wrote in an e-mail to the media.

Who was talking? What role did they play? Are they an informant? Random speculation by random strangers caused a lead? Or are the people having the conversation now suspects? This is a serious, serious issue. Some random public conversation sparks a lead? How did the FBI get the conversation?

1 comment

Movie Module Progress: Week 5

June 19th, 2009 | Category: Uncategorized

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:

  1. Download ffmpeg-0.5: ffmpeg
  2. Unpack the package, and fire up a terminal.
  3. Navigate to the directory, and in the main ffmpeg folder, and type: ./configure --enable-shared --prefix="/usr"
  4. Type make.
  5. Type sudo make install
  6. navigate to the libswscale subdirectory.
  7. type make, then sudo make install
  8. Now wherever you like, type svn co svn://seul.org/svn/pygame/branches/tylerthemovie/ pygame_movie
  9. navigate into pygame_movie, and type ./configure
  10. That done, type python setup.py build
  11. 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

Champions Online Contest Entry

June 13th, 2009 | Category: Uncategorized

So apparently Tim Absath of Ctrl-alt-delete comic is running a contest for five beta keys for Champions Online, being produced by the excellent Cryptic Studios. The contest requires inventing a superhero, and here’s my entry:

Once a support technician for a tech startup, Max Kellder is now unrecognizeable. Following the clues of a new mysterious, and difficult ARG, Max trekked to a mountain range deep in the wilds of Canada. There, he discovered he was being pursued by a mysterious organization that calls themselves CROSS, an acronym for something. Desperately hiding from his pursuers, Kellder hides deep within a cave. Within the cave, he finds the entire purpose for the ARG and the whole reason CROSS is hunting him: a dark jewel, with lightning of all the colors deep within. Staring inside the jewel, Kellder is visited by a being that claims to be God, and that in finding the jewel,Kellder has proven himself worthy. The jewel Kellder had found was once the centerpiece jewel of the Ark of the Covenant, long since hidden by the Knights of the Templar. The Holy Spirit tells Kellder that he is to become one of God’s mortal archangels, representatives of His power. Though doubtful, Kellder has no choice but to accept. And from that point on, his life was never the same.

Hearing voices of both genders, young and old, and in varied accents, and seeing people no one else can see, he quickly becomes homeless, dressed in rags and living under a bridge. But when he hears the Call, he transforms in a burst of lightning to a man wearing silvery-white armor, without a helmet, and a large gold cross across the breastplate. At the center of the cross lies the black jewel Kellder found so long ago. His hair in this form is long and flowing, grey, like that of a prophet out of the wilderness. Taking the name of the organization that pursued him, and the symbol that appears on his chest, he calls himself the Cross. Wielding a longsword, Cross works at the bidding of the voices and people he sees, to bring divine retribution to those whom deserve it.

His methods are cruel, and he fights in the worst alleys and the darkest corners of the city. He brings the homeless food, and shelter, and protects the defenceless from those that would use and abuse them. The voices and people only he sees seem to have a plan for him, a plan he does not yet understand, and one he fears will despoil his soul forever.

The other heroes of the city feel he is insane, and do not believe any of his rants or prophetic visions, despite how often they come true. They also dislike the cruelty of his methods, and feel he is one to beware of.

His powers are those of the Old Testament: lightning, invulnerability, and the ability to call down a plague or curse on the most deserving victims. His only weaknesses are what the voices in his head call Black magic, the magic of Satan and his worshipppers. This brings him into conflict with other heroes that use magic as their powers, as he believes they are servants of the Great Liar, and thus not to be trusted. His voices however, insist strenuously that he should kill the blasphemers where they stand, but he resists.

Its a bit disorganized right now, but Cross is just pure awesome. He’s got the whole possible schizophrenia thing going, plus, he’s got a huge amount of doubt for being an agent of god. Lots of stuff to play on, as well as the cruelty, the “plan” of the voices and people only he can see, and the homeless factor. I can see him crusading equally against corrupt real estate developers, cruel pimps and johns, as he could crusade against more direct forms of evil. I’m already thinking of plots involving Cross, and it would be awesome to make a webcomic series about Cross.

2 comments

Next Page »