Chapter 14. Encoding, Manipulating, and Creating Movies


[Page 484]

14.1

GENERATING FRAME-BASED ANIMATIONS

14.2

WORKING WITH VIDEO FRAMES

14.3

CONCEPTS SUMMARY


Chapter Learning Objectives

The media learning goals for this chapter are:

  • To create frame-based animations with simple geometric shapes, text, and images.

  • To do special effects like fade-out and chromakey in movies.

The computer science goals for this chapter are:

  • To explain why movies take so much space to store.

  • To add parameters to methods to make them more reusable.

  • To reuse earlier methods to make movies.

Movies (video) are actually very simple to manipulate. They are a series of pictures (frames). You need to be concerned with the frame rate (the number of frames per second), but it's mostly just things you've seen before. We're going to use the term movies to refer generically to animations (motion generated entirely by graphical drawings) and video (motion generated by some kind of photographic process).

What makes movies work is a feature of our visual system called persistence of vision. We do not see every change that happens in the world. For example, you don't typically see your eyes blink, even though they do it quite often (typically 20 times a minute). Our eyes retain an image for a short period of time.

If we see one related picture after another fast enough, our eye retains the image and our brain sees continuous motion. If the pictures aren't related, our brain reports a montage, a collection of disparate (though perhaps thematically connected) images. We refer to this 16 frames per second (fps) as the lower bound for the sensation of motion.

Early silent pictures were 16 fps. Motion pictures standardized on 24 fps to make sound smoother. (Ever wonder why silent pictures often look fast and jerky? Think about what happens when you scale up a picture or soundthat's exactly what happens if you play a 16 fps movie at 24 fps.) Digital video (e.g., video cameras) capture at 30 fps. How high is useful? There are some U.S. Air Force experiments suggesting that pilots can recognize a blurb of light in the shape of an aircraft (and figure out what kind it is) in 1/200 of a second! Video game players say that they can discern a difference between 30 fps video and 60 fps video.


[Page 485]

Movies are challenging to work with because of the amount and speed of data involved. Real-time processing of video (e.g., doing some modification to each frame as it comes in or goes out) is hard because whatever processing you do has to fit into 1/30 of a second! Let's do the math for how many bytes are needed to record video:

  • One second of 640 x 480 frame size images at 30 fps means 30(frames) * 640 * 480(pixels) = 9,216,000 pixels.

  • At 24-bit color (one byte for each of R, G, and B), that's 27,648,000 bytes, or 27 megabytes per second.

  • For a 90-minute feature film, that's 90 * 60 * 27,648,000 = 149,299,200,000 bytes149 gigabytes.

Digital movies are almost always stored in a compressed format. A DVD only stores 6.47 gigabytes, so even on a DVD the movie is compressed. Movie format standards like MPEG, QuickTime, and AVI are all compressed movie formats. They don't record every framethey record key frames and then record differences between one frame and the next. The JMV format is slightly differentit's a file of JPEG images, so every frame is there, but every frame is compressed.

An MPEG movie is really just an MPEG image sequence merged with an MPEG (like MP3) audio file. We're going to follow that lead and not deal with sound here. The tools described in the next section can create movies with sound, but the real trick of processing movies is handling all those images. That's what we're going to focus on here.



Introduction to Computing & Programming Algebra in Java(c) A Multimedia Approach
Introduction to Computing & Programming Algebra in Java(c) A Multimedia Approach
ISBN: N/A
EAN: N/A
Year: 2007
Pages: 191

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net