Movies Barb Ericson Georgia Tech.

Slides:



Advertisements
Similar presentations
Introduction to Digital Video. Digital Video Digital vs. Analog Analog video uses a continuous electrical signal to capture footage on a magnetic tape.
Advertisements

The Binary Numbering Systems
Movie of picture negatives # Pseudo Code def movieNeg(directory, pic): for each column of ‘pic’ across the entire width for each pixel from top of the.
Introduction to Computing and Programming in Python: A Multimedia Approach Chapter 13: Creating and Modifying Movies.
Week 2: Primitive Data Types 1.  Programming in Java  Everything goes inside a class  The main() method is the starting point for executing instructions.
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.
Computer Science 335 Data Compression.
Animation Theory.
Chapter 13: Creating and Modifying Movies. Chapter Objectives.
I Power Multimedia Technology Video Data. Video data Video is a sequence of individual pictures or frames, taken one after another. These are played back.
1 ADVANCED MICROSOFT POWERPOINT Lesson 7 – Working with Visual and Sound Objects Microsoft Office 2003: Advanced.
Video Data Topic 4: Multimedia Technology. What is Video? A video is just a collection of bit-mapped images that when played quickly one after another.
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.
Tickertape def tickertape(directory,string): for each frame to generate create an new canvas write the string on canvas slightly left of the previous frame.
Video Data Topic 4: Multimedia Technology. What is Video? A video is just a collection of bit-mapped images that when played quickly one after another.
Digital Video Basics CPSC 120 Principles of Computer Science April 16, 2012.
1 Digital Video. 2  Until the arrival of the Pentium processor, in 1993, even the most powerful PCs were limited to capturing images no more than 160.
CS 1308 Computer Literacy and the Internet. Creating Digital Pictures  A traditional photograph is an analog representation of an image.  Digitizing.
Data Handling Topic 1. Data Data is the raw material entered into a computer system. This raw material could be text, numbers, graphics, audio, animation.
Computing with Digital Media: A Study of Humans and Technology Mark Guzdial, School of Interactive Computing.
Digital Camcorder and Video Computer Multimedia. Two most important factors that make up a video Frames per second ( fps ) The resolution ( # of pixels.
MOMA Display Screens K u r t R a l s k e.
Video Basics. Agenda Digital Video Compressing Video Audio Video Encoding in tools.
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.
Digital Media Dr. Jim Rowan ITEC Monday, August 27.
Amber Annett David Bell October 13 th, What will happen What is this business about personal web pages? Designated location of your own web page.
CS 101: Introduction to Computing Programming picture manipulations Developed by Mark Guzdial, Georgia Institute of Technology, 2003–2004; modified by.
Too much information running through my brain.. We live in the information age. Knowledge comes from careful investigation of information. Information.
2.02 Develop Computer Animations Review By: Adam Garcia,Christian Brown, Richard Williams, Tyler Borden.
Chapter 7 Animation. The Power of Animation Animation grabs attention Transitions are simple forms of animation  Wipe  Zoom  Dissolve.
Georgia Institute of Technology Movies part 5 Barb Ericson Georgia Institute of Technology April 2006.
Still-image compression Moving-image compression and File types.
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.
1. Press the New Layer Button 3. Double click names to re-name Ball & Shadow layers 2. Click to change to 12 fps Step 1.
CS1315: Introduction to Media Computation Making sense of functions.
 Persistence of Vision-The way our eyes retain images for a split second longer than they actually appear, making a series of quick flashes appear as.
CSC1401. Learning Goals Understand at a conceptual level What is media computation? How does color vision work? How can you make colors with red, green,
Introduction to Flash Animation CS 318. Topics Introduction to Flash and animation The Flash development environment Creating Flash animations  Layers.
Introduction to Digital Media. What is it? Digital media is what computers use to; Store, transmit, receive and manipulate data Raw data are numbers,
Georgia Institute of Technology Movies Barb Ericson Georgia Institute of Technology April 2006.
Digital Media Lecture 4: Bitmapped images: Compression & Convolution Georgia Gwinnett College School of Science and Technology Dr. Jim Rowan.
Chapter 14: Creating and Modifying Movies. Chapter Objectives.
Creating a picture in JES Use in the command window of JES (black background at bottom) to set the folder where the picture is to be saved >>> path = setMediaPath()
Georgia Institute of Technology Movies part 4 Barb Ericson Georgia Institute of Technology April 2006.
Chapter 13: Creating and Modifying Movies 1. Chapter Objectives 2.
Video Data Topic 4: Multimedia Technology. Learning Objectives Hardware required to capture Digital video How video files are stored Factors affecting.
Georgia Institute of Technology Speed part 4 Barb Ericson Georgia Institute of Technology May 2006.
CS1315: Introduction to Media Computation Using Loops for Pictures.
A Media Computation Cookbook Manipulating Images and Sounds for Use in Alice Part 1: Image Manipulations Part 2: Changing colors in an area Part 3: Chromakey.
Chapter 13: Creating and Modifying Movies. Chapter Objectives.
CS1315 Introduction to Media Computation Introduction: Why study computer science at all?!?
CS 101: Introduction to Computing Programs that change Pictures Developed by Mark Guzdial, Georgia Institute of Technology, 2003–2004; modified by Robert.
Digital Video. Representing video An array of images Movie = video + audio.
Let’s Make a Movie The Basics. Goals Storyboard Take Video Upload Video.
Information in Computers. Remember Computers Execute algorithms Need to be told what to do And to whom to do it.
Video Data Topic 4: Multimedia Technology. What is Video? A video is just a collection of bit-mapped images that when played quickly one after another.
Software Design and Development Storing Data Part 2 Text, sound and video Computing Science.
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.
Video on the Web.
VIDEO.
CS1315: Introduction to Media Computation
Creating and Modifying Movies
Barb Ericson Georgia Institute of Technology April 2006
A Media Computation Cookbook
Multimedia Production
Multimedia Summer Camp
Barb Ericson Georgia Institute of Technology April 2006
Presentation transcript:

Movies Barb Ericson Georgia Tech

Movies, animations, and video …oh my! We’re going to refer generically to captured (recorded) motion as “movies.”  This includes motion entirely generated by graphical drawings, which are normally called animations.  This also includes motion generated by some kind of photographic process, normally called video.

Psychophysics of Movies: 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 in the world around us. Instead, our eye retains an image (i.e., tells the brain “This is the latest! Yup, this is still the latest!”) for a brief period of time.  If this were not the case, you would be aware of every time that your eye blinks because the world would “go away” for a moment.

16 frames and it’s motion If you see 16 separate pictures in one second, and these pictures are logically sequenced,  That is, #2 could logically follow from the scene in #1.  16 pictures of completely different things doesn’t work, You will perceive the pictures as being in motion. 16 frames per second (fps), 16 pictures in a second, is the lower bound for the sensation of motion.

Beyond 16 fps Early silent pictures were 16 fps. Motion picture standards shifted to 24 fps to make sound smoother. Videocameras (digital video) captures 30 fps How high can we go?  Air force experiments suggest that pilots can recognize a blurb of light in 1/200 th of a second!  Video game players say that they can discern a difference between 30 fps and 60 fps. Bottomlines:  Generate at least 16 fps and you provide a sense of motion.  If you want to process video, you’re going to have 30 fps to process (unless it’s been modified elsewhere for you.)

Processing movies Our frames are going to be JPEG pictures.  One JPEG file per frame. So, if we’re going to be processing movies, we’re going to generating or processing sequences of JPEG files.

Using MediaTools To generate a series of frame pictures in a folder from an MPEG file. To play a folder of frame pictures and to save it as a JMV file.  (JPEG Movie format.) To play JMV or MPEG movies.

MPEG? QuickTime? AVI? JMV? MPEG, QuickTime, and AVI are compressed movie formats.  They don’t record every frame.  Rather, they record some key frames, and then store data about what parts of the screen change on intervening frames.  MPEG is an international standard, from the same people who invented JPEG.  AVI is a Microsoft standard.  QuickTime is an Apple standard. JMV is a file consisting of JPEG frames in an array.  All frames represented

Generating other kinds of movies Other tools can generate other kinds of movie formats. QuickTime Pro ( can read a sequence of JPEG images and produce MPEG, AVI, or QuickTime movies. ImageMagick (open source toolkit) can also read a sequence of JPEG images and produce MPEG movies.

Why do we compress movies? Do the math:  One second of 640x480 pixels at 30 fps  30 (frames) * 640 * 480 (pixels) = 9,216,000 pixels  With 3 bytes of color per pixel, that’s 27,648,000 bytes or 27 megabytes of information per second.  For a 90 minute feature movie (short), that’s 90 * 60 * 27,648,000 = 149,299,200,000 bytes (149 gigabytes) A DVD stores 6.47 gigabytes of data.  So even on a DVD, the movie is compressed.

MPEG movie = MPEG frames plus MP3 soundtrack An MPEG movie is actually a series of MPEG frames composed with an MP3 soundtrack.  It’s literally two files stuck together in one. We’re not going to deal with sound movies for now.  The real challenge in doing movie processing is generating and manipulating frames.

Get the frames in order Many tools (including os.listdir()) can process frames in order if the order is specified. We specify the order by encoding the number of the frame into the name.  If you put in leading zeroes so that everything is the same length, the order is alphabetical as well as numerical.

Simple Motion def makeRectMovie(directory ): for num in range (1,30): #29 frames (1 to 29) canvas = makeEmptyPicture (300,200) addRectFilled(canvas,num * 10, num * 5, 50,50, red) # convert the number to a string numStr=str(num) if num < 10: writePictureTo(canvas,directory+"\\frame0"+numStr+".jpg") if num >= 10: writePictureTo(canvas,directory+"\\frame"+numStr+".jpg") movie = makeMovieFromInitialFile(directory+"\\ frame01.jpg") return movie

Try it out >>> rectM = makeRectMovie("c:\\Temp\\rect\\") >>> playMovie(rectM) The directory must exist before you call makeRectMovie. It is where the frames for the movie will be written.

The trick here is all mathematics When num = 1,  addRectFilled(canvas,10,5,50,50,red) When num = 2,  addRectFilled(canvas,20,1 0,50,50,red) When num = 10,  addRectFilled(canvas,100, 50,50,50,red) When num = 20,  addRectFilled(canvas,200, 100,50,50,red)

Important cool thing: You can draw past the end of the picture! addText, addRect, and the rest of the drawing tools will work even if you go beyond the edge of the drawing.  Drawings will clip what can’t be seen in them, so you don’t get an array out of bounds error.  This is a big deal, because it means that you don’t have to do complicated math to see when you’re past the end of the drawing. But only for the drawing functions. If you set pixels, you’re still on your own to stay in range.

Making a tickertape movie def tickertape(directory,string): for num in range(1,100): #99 frames canvas = makeEmptyPicture(300,100) #Start at right, and move left addText(canvas,300-(num*10),50,string) # Now, write out the frame # Have to deal with single digit vs. double digit frame numbers # differently numStr=str(num) if num < 10: writePictureTo(canvas,directory+"\\frame0"+numStr+".jpg") if num >= 10: writePictureTo(canvas,directory+"\\frame"+numStr+".jpg")

Tickertape Movie frame10 frame20 frame30 frame40

Can we move more than one thing at once? Sure! def movingRectangle2(directory ): for num in range (1,30): #29 frames canvas = makeEmptyPicture (300,250) # add a filled rect moving linearly addRectFilled(canvas,num*10,num*5, 50,50,red) # Let’s have one just moving around blueX = 100+ int (10 * sin(num)) blueY = 4*num+int (10* cos(num)) addRectFilled(canvas,blueX,blueY,50,50, blue)

Moving two things at once -cont # Now, write out the frame # Have to deal with single digit vs. double digit numStr=str(num) if num < 10: writePictureTo(canvas,directory +"\\frame0 "+ numStr +". jpg") if num >= 10: writePictureTo(canvas,directory +"\\frame "+ numStr +". jpg")

blueX = 100+ int (10 * sin(num)) blueY = 4*num+int (10* cos(num)) addRectFilled(canvas,blueX,blueY,50,50, blue) What’s going on here?  Remember that both sine and cosine vary between +1 and -1. Int(10*sin(num)) will vary between -10 and +10  With cosine controlling y and sine controlling x, should create circular motion  num=1 x is 108, y is 9  num=2 x is 109, y is 4

Frames from two motions at once

Slowly making it (very) sunset Remember this code? def makeSunset(picture): for p in getPixels(picture): value=getBlue(p) setBlue(p,value*0.7) value=getGreen(p) setGreen(p,value*0.7) What if we applied this to create frames of a movie, but slowly increased the sunset effect?

SlowSunset def slowSunset(directory): canvas = makePicture(getMediaPath("beach-smaller.jpg")) #outside the loop! for frame in range(1,100): #99 frames printNow("Frame number: "+str(frame)) makeSunset(canvas) # Now, write out the frame writeFrame(frame,directory,canvas) def makeSunset(picture): for p in getPixels(picture): value=getBlue(p) setBlue(p,value*0.99) #Just 1% decrease! value=getGreen(p) setGreen(p,value*0.99) Just one canvas repeatedly being manipulated

Pull out writeFrame def writeFrame(num,dir,pict ): # Have to deal with single digit vs. double digit numStr=str(num) if num < 10: writePictureTo(pict,dir+"// frame00"+numStr+".jpg") if num >= 10 and num <100: writePictureTo(pict,dir+"// frame0"+numStr+".jpg") if num >= 100: writePictureTo(pict,dir+"// frame"+numStr+".jpg")

SlowSunset frames

Dealing with real video We really can’t deal with real video.  Dealing with each frame takes a lot of processing.  If you were going to process each frame as fast as it was coming in (or going out), you’d have 1/30 th of a second to process each frame! We cheat by  Saving each frame as a JPEG image  Processing the JPEG images  Convert the frames back to a movie