Sunday, May 8, 2011

IFDM 210 -Final Project-

For my final project I made a script that opens and runs my altered pygame, saves every 5th image, and then adds an effect, and compiles them into a movie.

Not only did I use ffmpeg and imagemagick to alter still frames, but I also worked to create a script that first called my pygame in bash an ran it quickly (which I had been trying to get to work since we began working with terminal). Before, to run it I had to enter the python module and go through multiple commands just to open the game window, which was very tedious while I was altering and improving on it. Now, my code not only opens the game in a split second, but runs it as well.

With the addition of the code I added to the original pygame code, run.sh now also takes every 5 frames from the game, and saves them out in the pyspaceinvaders folder (inside the Game folder) as .png images.

From here, am able to use imagemagick and ffmpeg to alter them further, and compile them into a movie.

I call them with imagemagick, to cycle through the still frames and apply a swirl effect with a for loop. After this is completed, I coded ffmpeg to take those images, and compile them into a movie, and after doing so, delete the excess still frames remaining in the folder.

Overall, I used 3 different programs. Through the terminal, I used Python, (which has a different syntax than bash and requires more specified spacing), and before this project, I had been unsuccessful in making it run through a bash script. I also used imagemagick to alter the saved still frames, and then ffmpeg to compile them into the movie.

This project was very difficult for me, but in the end I figured it out, and I'm glad I did, because now I have a new outlook on programming, and will be using it more in the future.


LINK TO .ZIP FOLDER:

http://dl.dropbox.com/u/18940217/Bmoody210_Final.zip


EXAMPLE RESULT:

No comments:

Post a Comment