Barb Ericson Georgia Institute of Technology April 2006

Slides:



Advertisements
Similar presentations
                      Digital Audio 1.
Advertisements

Georgia Institute of Technology Drawing in Java – part 2 Barb Ericson Georgia Institute of Technology September 2005.
Georgia Institute of Technology Movies part 3 Barb Ericson Georgia Institute of Technology April 2006.
Working with Image Files Aaron Fuegi SCV Visualization Workshop – Fall 2008.
Video on the Web. Should you add video to your web page? Three main questions 1. How will it enhance the purpose of my page? –Entertain –Explain a process.
Working with Image Files Aaron Fuegi IS&T Scientific Visualization Tutorial – Spring 2010.
Persistence of Vision What makes movies work is yet another limitation of our visual system: Persistence of vision We do not see every change that happens.
Georgia Institute of Technology Speed part 3 Barb Ericson Georgia Institute of Technology May 2006.
Digital Camcorder and Video Computer Multimedia. Two most important factors that make up a video Frames per second ( fps ) The resolution ( # of pixels.
Georgia Institute of Technology Introduction to Media Computation Barb Ericson Georgia Institute of Technology May 2006.
TOPIC 4 INTRODUCTION TO MEDIA COMPUTATION: DIGITAL PICTURES Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach.
Chapter 10-Basic Software Tools. Overview Text-based editing tools. Graphical tools. Sound editing tools. Animation, video, and digital movie tools. Video.
Copyright © 2009 Curt Hill The Picture Object Getting and displaying.
Georgia Institute of Technology Movies part 5 Barb Ericson Georgia Institute of Technology April 2006.
Copyright © Curt Hill Turtles The beginning of media computation.
Georgia Institute of Technology Movies part 2 Barb Ericson Georgia Institute of Technology April 2006.
CPSC1301 Computer Science 1 Chapter 14 Creating and Modifying Movies part 2.
Georgia Institute of Technology Movies Barb Ericson Georgia Institute of Technology April 2006.
Georgia Institute of Technology Creating Classes part 4 Barb Ericson Georgia Institute of Technology May 2006.
CreatingClasses-SlideShow-part41 Creating Classes part 4 Barb Ericson Georgia Institute of Technology Dec 2009.
Movies Barb Ericson Georgia Tech.
Georgia Institute of Technology Movies part 4 Barb Ericson Georgia Institute of Technology April 2006.
Georgia Institute of Technology Speed part 4 Barb Ericson Georgia Institute of Technology May 2006.
04-ManipulatingPictures-part21 Manipulating Pictures, Arrays, and Loops part 2 Barb Ericson Georgia Institute of Technology June 2008.
Georgia Institute of Technology Drawing in Java – part 2 Dr Usman Saeed Assistant Professor Faculty of Computing and Information Technology North Jeddah.
Unit 6 – Multimedia Element: Animation
Multimedia Systems Dr. Wissam Alkhadour.
Getting and displaying
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Persistence of Vision What makes movies work is yet another limitation of our visual system: Persistence of vision We do not see every change that happens.
Lesson 6: Enhancing Presentations
Video on the Web.
Manipulating Pictures, Arrays, and Loops part 2
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Creating Desktop Video and Animation
Building Java Programs
Graphics Bitmap Vector
“Animation Through the Ages”
Barb Ericson Georgia Institute of Technology Dec 2009
VIDEO.
Building Java Programs
Building Java Programs
"Digital Media Primer" Yue-Ling Wong, Copyright (c)2013 by Pearson Education, Inc. All rights reserved.
Project Objectives Open an image Save an image Resize an image
Creating and Modifying Text part 2
Inserting Graphics, Media, and Objects
Graphics.
Outline Image formats and basic operations Image representation
INTRODUCTION TO ADOBE FLASH CS4
Media Computation Questions
Topic 3: Data Compression.
Introduction to Java, and DrJava part 1
Introduction to Media Computation
Introduction to Programming Part 2
Windows Tutorial 7 Managing Multimedia Files
Final Study Guide Arts & Communications.
Introduction to Java, and DrJava
Introduction to Object-Oriented Programming in Alice
Chapter 5 Animation.
(c) V/2-Com (Verhaart) Multimedia Elements & standards 4/15/2019 (c) V/2-Com (Verhaart)
Manipulating Pictures, Arrays, and Loops
Introduction to Java, and DrJava
Introduction to Java, and DrJava part 1
Barb Ericson Georgia Institute of Technology April 2006
Building Java Programs
Creating a Simple Game in Scratch
Graphics Reading: Supplement 3G
Barb Ericson Georgia Institute of Technology May 2006
Teaching Java using Turtles
CS 1308 Exam 2 Review.
Presentation transcript:

Barb Ericson Georgia Institute of Technology April 2006 Movies part 1 Barb Ericson Georgia Institute of Technology April 2006 Georgia Institute of Technology

Georgia Institute of Technology Learning Goals Media Goals To generate frame-based animations with simple geometric shapes, text, and images To do special effects on movies like chromakey Computing Concepts To explain why movies take so much space To add parameters to methods to make them reusable To reuse earlier methods in making movies Georgia Institute of Technology

Georgia Institute of Technology Manipulating Movies Movies (video) are a series of pictures (frames) Like flip-book animation The frame rate is the number of frames shown per second 16 frames per second is the lower bound on our perception of continuous motion Digital video captures 30 frames per second Some people can tell the difference between 30 and 60 frames per second Georgia Institute of Technology

Georgia Institute of Technology Storing Movies One second of a 640 by 480 picture at 30 frames per second (fps) is 640 * 480 * 30 = 9, 216,000 pixels Using 24 bit color that means 3 * 9, 216,000 = 27, 648, 000 bytes or over 27 megabytes per second For a 90 minute film that is 90 * 60 * 27,648,000 bytes = 149 gigabytes Georgia Institute of Technology

Georgia Institute of Technology Compressing Movies A DVD only stores 6.47 gigabytes So movies are stored in a compressed format Compressed formats MPEG, QuickTime, and AVI Don't record every frame They record key frames and then the differences between the frames JVM records every frame But each frame is compressed A MPEG movie is really a MPEG image sequence merged with a MPEG (MP3) audio file. Georgia Institute of Technology

Generating Frame-Based Animations We will make movies by Creating a series of JPEG pictures and then displaying them Use a FrameSequencer To handle naming and storing the frames Using leading zeros to keep them in order And displaying the movie from the frames Using the MoviePlayer class Other ways to create a movie from frames Use QuickTime Pro http://www.apple.com/quicktime ImageMagick http://www.imagemagick.org/ Both QuickTime Pro and ImageMagick can create a movie from a set of frames and create a set of frames from a movie. ImageMagick is free but only works on Windows machine. Georgia Institute of Technology

Code for Rectangle Movie public void makeRectangleMovie(String directory) { int framesPerSec = 30; Picture p = null; Graphics g = null; FrameSequencer frameSequencer = new FrameSequencer(directory); frameSequencer.setShown(true); // loop through the first second for (int i = 0; i < framesPerSec; i++) Georgia Institute of Technology

Code for Rectangle Movie - Cont // draw a filled rectangle p = new Picture(640,480); g = p.getGraphics(); g.setColor(Color.RED); g.fillRect(i * 10, i * 5, 50,50); // add frame to sequencer frameSequencer.addFrame(p); } // play the movie frameSequencer.play(framesPerSec); Georgia Institute of Technology

Georgia Institute of Technology Rectangle Movie This mpeg file was created with ImageMagick using convert –adjoin –border 1 –bordercolor black frame*.jpg frame.mpeg Click on the movie to play it. Georgia Institute of Technology

Georgia Institute of Technology MovieMaker Class Add the makeRectangleMovie to a new class MovieMaker Use the following main to test it Set the directory to any empty directory public static void main(String[] args) { MovieMaker movieMaker = new MovieMaker(); String dir = "c:/intro-prog-java/movies/rectangle/"; movieMaker.makeRectangleMovie(dir); } Change the directory if you wish to store the frames in another location. Georgia Institute of Technology

Georgia Institute of Technology Out of Memory Error We go through lots of memory when we make movies Java can run out of memory You can specify how much memory to use In DrJava click on Edit->Preferences This displays the Preferences Window Select Miscellaneous under Categories Enter –Xmx512m –Xms128m to start with 128 megabytes and set the max to 512 megabytes Click on OK Click on Reset You can specify a maximum that is larger than the amount of RAM in your machine It will swap unused items to the disk (virtual memory) If you are using the command line tools from Sun you can specify the starting memory and maximum memory on the command line when you execute the main method in a class: java –Xmx512m –Xms128m MovieMaker Georgia Institute of Technology

Georgia Institute of Technology How the Movie Works The key part is g.fillRect(i * 10, i * 5, 50,50); The rectangle will be drawn at a different location on a blank picture each time And FrameSequencer will write out a file with the resulting picture in it With leading zeros in the name to keep them in order The first few calls are g.fillRect(0,0,50,50); g.fillRect(10,5,50,50); g.fillRect(20,10,50,50); g.fillRect(30,15,50,50); Georgia Institute of Technology

Georgia Institute of Technology Exercise Create a new method in MovieMaker makeOvalMovie Animate a filled oval moving from the bottom left of a 640 by 480 blank picture to the top right Allow the color and size of the oval to be specified as parameters to the method Georgia Institute of Technology

Georgia Institute of Technology Summary Movies and video are a series of pictures Shown quickly one after the other The frames rate is the number of frames shown per second Need at least 16 fps (frames per second) Digital Video is 30 fps Movies take up quite a bit of space So they are stored in a compressed form Georgia Institute of Technology