CPSC 120 Principles of Computer Science
Using Multimedia Design
Fall 2008

Project 3: Creating or Transforming a Movie

Introduction

In this project, you, along with a partner from class (or not, if you want to work alone), will create a short movie or manipulate in some significant way an existing short movie. You will create the movie or modify the movie in kJES. You will work with the movie as a sequence of frames (JPEG files) and a sound (WAV file). You will then use the software avidemux (which is discussed below) to bundle the frames and sound into a single movie file.

Project Details

As with the previous two projects, to start out, you will need to come up with a plan for your movie. This will take some thinking with your group partner outside of class. This will be a significant program (more significant that what you have been doing in the labs), so make sure you come up with a good plan before starting to write any code.

After you have a plan, you will create your movie or transform an existing one. To create the movie, you will first create the frames (several JPEG files) and a sound track (a WAV file) in kJES. To transform an existing movie, you will first unbundle the movie into its frames (several JPEG files) and its sound track (a WAV file) using the software avidemux (discussed below). You will then transform the frames and sound track in kJES. In either case (whether creating or transforming), you will then use the software avidemux (discussed below) to bundle this into a movie file.

To create your frames and your sound track you will write two functions: one called createFrames that creates the frames of your movie and another called createSound that creates the sound track. You should put both of these functions (along with any other functions you need) in a file called project3.py within your project3 folder, which is within your cs120 folder on your desktop. I should be able to run your createFrames and createSound functions to create your final frames and sound track (you will have to indicate in comments how to run these functions, i.e., what parameters to give them, etc.). Furthermore, these functions should do everything. They should create the final frames from the original frames and the final sound from the original sound files (and not partially transformed files).

There are also several requirements for your movie that you must follow in completing this project.

If you are in doubt about whether your project is meeting the requirements, then ask me. Also, with my permission, some of the restrictions can be lifted so long as you are doing a significant amount of work in the project and the movie you are creating or manipulating is cool or nifty in some way. Remember, if you have any concerns about any of these requirements, then it is a good idea to talk with me (or at the very least, email me).

Extra credit is possible for particularly cool and nifty movies, which take a significant amount of work to create or modify.

Using an Existing Movie

You are welcome to modify an existing movie rather than create one from scratch. There are several movies available on the Linux file system if you would like to use them. They are within the folder /classes/f08/cs120/existing-movies/. You can type or cut-and-paste this location into the location bar of Konqueror to navigate to this folder. There are several folders containing movies, feel free to copy one of them to your project3 folder if you would like to use one (don't copy more than one as they are large and take up a lot of space). Note: you will have to copy them to your project3 folder and not somewhere else since you will exheed your quota otherwise (your project3 folder falls under my quota, which is larger than your quota). You will notice that the frames and sound track are already extracted from each movie so you can immediately begin transforming them.

You can also use your own movie if you would like. If you want to use your own movie, then you will need to find the movie and move the movie file to your Linux account. You can move it to your Linux account by emailing it to yourself. You then will need to extract the frames and sound track. Some movie formats may not work with the software we are using in this class (.avi and .mpeg should work). I can help you with this step, if you schedule a time to meet with me.

The software that we will be using to unbundle the movie is avidemux. This will allow you to extract the frames and sound track. Note: avidemux is a complicated piece of software and it can be difficult to use. As mentioned above, avidemux cannot handle all movies although it can handle many different formats (in particular, .avi and .mpeg should be OK). Note also: follow the directions below precisely, otherwise, your movie will not work properly (or worse, avidemux might crash).

Opening avidemux. To open avidemux, click on the KDE start menu (in the lower lefthand corner), select "Multimedia" from the menu, and then select "Avidemux (Video Editor)" from the sub-menu. This should open the program and you should see the following window appear (it might look slighly different from this depending on the computer you are logged into).

Extracting frames. To extract the frames using avidemux, you should carefully follow the steps below:

If you need to modify the movie in other ways, such as to rotate it, select only part of it, then please come and see me and I can show you how (your welcome of course to try to figure this out on your own).

Extracting sound track. To extract the sound track using avidemux, you should carefully follow the steps below:

Finishing. Once you have extracted the frames and sound track, you are all done. You can then modify these in kJES. You can close avidemux. You won't need it again until you are ready to bundle your final movie.

Bundling the Movie

We are using the same software (avidemux) to bundle our movies as unbundle. Read the discussion above pertaining to unbundling for a brief discussion of avidemux. This software will allow us to take several JPEG frames and a WAV sound track and put them together into one movie file, which you can play on your computer. Note: follow the directions below precisely, otherwise, your movie will not work properly (or worse, avidemux might crash).

Opening avidemux. To open avidemux, click on the KDE start menu (in the lower lefthand corner), select "Multimedia" from the menu, and then select "Avidemux (Video Editor)" from the sub-menu. This should open the program and you should see the window shown above in the previous section.

Creating a movie. To create a movie, your frames must all be contained within a single folder. They should have a consistent naming scheme. For example, each must have a base name plus a sequence number plus an extension (they must be a JPEG so this will be .jpg). For example, you could use the following for the first 10 frames:

frame000.jpg
frame001.jpg
frame002.jpg
frame003.jpg
frame004.jpg
frame005.jpg
frame006.jpg
frame007.jpg
frame008.jpg
frame009.jpg
...

The number corresponds to the frame's sequence number. Note: you will need to put leading 0's in your file name.

The sound track must be stored in a single WAV file. You will not be able to use multiple WAV files for your sound track. To combine multiple sounds into one, you will need to do this in kJES.

Once you have a folder of frames and a single sound file, you can then open avidemux to bundle them into a movie. Once you have avidemux open (see above for how to open it), carefully follow the steps below:

Playing A Movie

Once you have created a movie, you can play it using the movie player mplayer. Unfortunately, mplayer is not the default movie player. To play it you will not be able to simply click on it. Instead, right click on the file, and select "Open With", and then select "MPlayer".

Project Ideas

Some possible project ideas include the following:

Other ideas are also possible.

Group Work

As in the previous projects, you are encouraged to work on this project in groups of two (although you can work alone if you would like). Each group will submit exactly one project. The group will also receive a single grade for the project (i.e., both team members will get the same grade). You and your partner will need to spend some time out of class, thinking and planning your collage and then once you have that plan, you will need to sit down on a computer and program it.

Both members of the group should actively contribute to the project. One team member could receive a lower grade if it is not clear that they contributed in a significant way. If/when possible, you might even split some of the work up in order to be more efficient. For example, one team member could work on the frames and another could work on the sound track.

If you are working in a team, I expect that you will be able to do a more significant project, and I will grade accordingly. For this project you have the option of working alone. In that case, I will expect a little less from you, but I will still expect you to meet the requirements. Even though you have the option of working alone, I encourage you to work with a partner.

Good Programming Style

For the project, it is especially important to follow the good programming style rules laid out in lab 3. In particular, you will be graded more rigorously on your comments. Also, you should use good variable and function names that indicate the use of that variable and/or function. Most importantly, make sure that your code is readable. You will probably end up with a fairly large program. Make sure that all the parts of that program are clear. Break up different tasks into additional functions, for example, converting a frame from color to gray scale, splicing a sound into the sound track, etc. Take this aspect of the project seriously. It is very important when writing large programs, and its importance will be reflected in the grading of your project.

Submission

The project is due in two weeks at 5PM on December 15th (the final reading day). To submit the project, you will put the submitted files in the project3 folder within your cs120 folder on your desktop. The submitted files should include the file project3.py, which contains your Python code, as well as all of your original picture and sound files and your final movie file.

In addition, you must put your movie on your cs120 web page (cs120.html). You will add it to the table in cs120.html within your www folder (not your lab02 folder!). You do not need to put the original files into the table, just the resulting movie.

Because each team is submitting only one project, you will only need to put the Python file and original sounds in one team member's project3 submission folder (although you are welcome to put the files in both team member's folders). However, the final movie sound file must appear on both team member's cs120 web page. In addition, one of the group members must send me an email telling me the members of the group, which team member's project3 folder will be used to submit the project (this email is required even if you are working alone).

In addition, if you submit the movie late then you need to email me once you have submitted your final version. You will lose 10% per day submitted late and the project will not be accepted one day after the final exam (12/19 at 5PM).


Good luck and have fun!


Valid HTML 4.01!