Animation & Video 1
High labor requirements tend to make animations a costly type of resource. Nontrivial animations usually require a labor-intensive process to complete. You can buy many generic animation clips on CD/DVDs that will enhance multimedia presentations and productions. However, it can be difficult finding ones that meet specific needs. More and more animations are appearing on the Internet. These can be simple animated gifs, or more sophisticated VRML sites. Just as with sound on the Internet, animation files must first be downloaded to the client computer, and then they are played. We will also examine the streaming of animation/video when we examine multimedia on the Internet. 2 Animation
mouse from a CD-ROM 3 Animation
Animated Gifs from the Internet 4 Animation
from the Internet made with Digital Morph 2.7 MB 5 Animation
MB
7 Video Who hasn’t wanted to do this !!!
8 Video
.AVI (PC) .MOV (Mac) .MPeG .3g2 .GIF (Office & Browsers) .SWF (Shockwave) .RA (streaming) 9 Animation/Video File Formats
10 File Size Considerations Like graphics, the size of the image (length x width) in pixels times the color depth determines how many bytes a single image (frame) requires. Since an animation/video is just a series of images, once the size of a single frame is known, we multiply the result by the number of frames per second (fps) to determine the size of an animation/video file. Finally we multiply by the length (time). Unfortunately, the results in files in the gigabyte range.
x 1080 x 30 fps x 16 sec =.993 GB So one minute requires 3.7 GB and an hour requires 223 GB! File Size Considerations
Need a digital camera to capture image Need a 1394 (Firewire) card for the computer or a USB 2.0 port or wireless Need a 1394 or USB cable to connect the digital camera to the computer AND Software to transfer/capture the video information 6-pin 4-pin Transferring Digital Video to a Computer 12
Need an analog camera to capture image Need a video capture device for the computer Need a specific cables to connect the analog camera to the computer RCA S-video AND Software to transfer/capture the video information 13 Transferring Analog Video to a Computer
AND Software to play/capture the video information Need a coaxial cable to connect your cable service to the computer Coaxial Cable Need a video capture device for the computer TV Tuner 14 Transferring Analog Video to a Computer
15 Transferring Analog Video to a Computer
16
External - QuickCam (Circa 2002) USB port 640 x 480 window (max) 5 KHz sampling rate 15 fps (max) Webcams 17 Other Video Input Devices
USB port 16:9 – 1280x720p 3 MP photos There is an HD version that takes 10 MP photos Webcams 18 Other Video Input Devices External – Logitech C260 (Circa 2012) 1280x MB.wmv
Also 16:9 – 1280x720p Webcams 19 Other Video Input Devices Internal – (Usually on a laptop) Camera Mic 1280x MB.mp4
Multimedia Cell Phones 20 Other Video Input Devices 1920x1080p
Basically there are three types of software to: Create/Capture Edit Play 21 Animation/Video Software
Purpose of this software is to capture, and compress video, and to interleave it with incoming audio. May include editing software shown below. Range in price and functionality: –Free – Movie Maker –Mid Range – Pinnacle Studio – $60 –High End – Adobe Premiere – $699 –Higher End – Final Cut Pro – $1, Video Capture/Edit Software
Media Player (PC) - player for AVI and MPG files US/windows/products/windows-media-player Real Player (PC & Mac) - player for AVI, MPG, and MOV files Quick Time (PC & Mac) - player for AVI, MPG, and MOV files Free Video Playback Software
Video Screen Capture 24 Video Screen Capture Software
GIF Construction Set Digital Morph ($19) 25 Animation Software
VIDEO COMPRESSION 26
Uncompressed video takes huge amounts of storage space. Video compression eliminates redundant video artifacts/data via prediction between frames. When using the Web, sometimes “streaming” video such as RealVideo or Shockwave is used. 27 Video Compression Remember slide 12, where a hour of uncompressed video requires 223 GB.
For this course, we will learn how to integrate existing animation/video files into VB programs. 28
The Media Control Interface (MCI) provides standard commands for playing multimedia devices and recording multimedia resource files. These commands are a generic interface to nearly every kind of multimedia device. We will use the mciSendString function: 29 Some Preliminaries General command format: mciSendString(CommandString,0,0,0) mciSendString("open skiing.wmv alias movie“,0,0,0) command file name alias mciSendString("close movie“,0,0,0) mciSendString("play movie“,0,0,0) Notice that the alias is similar to what we did when opening record structured files, where we equated a file number with a file name and then referred to the number.
However, before using it, we have to declare the mciSendString function: Private Declare Function mciSendString Lib _ "winmm.dll" Alias "mciSendStringA" (ByVal _ lpstrCommand As String, ByVal _ lpstrReturnString As String, ByVal _ uReturnLength As Integer, ByVal _ hwndCallback As Integer) As Integer 30 Some Preliminaries Notice that the function returns a value, but we will not use it. Do not worry about this declaration. You will just copy and paste it into your next assignment.
31 Some Preliminaries Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal _ lpstrCommand As String, ByVal _ lpstrReturnString As String, ByVal uReturnLength As _ Integer, ByVal hwndCallback As Integer) As Integer... Private Sub cmdPlay_Click(...)Handles cmdPlay.Click mciSendString("open skiing.wmv alias movie",0,0,0) mciSendString("play movie",0,0,0) End Sub Private Sub cmdClose_Click(...)Handles cmdClose.Click mciSendString("close movie",0,0,0) End Sub Let’s create this form in which to play a video. Note, this is framed in a PictureBox. Note, this is framed in a PictureBox.
32 Some Changes Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal _ lpstrCommand As String, ByVal _ lpstrReturnString As String, ByVal uReturnLength As _ Integer, ByVal hwndCallback As Integer) As Integer. Private Sub cmdPlay_Click(...)Handles cmdPlay.Click mciSendString("play movie",0,0,0) End Sub Private Sub cmdClose_Click(...)Handles cmdClose.Click mciSendString("close movie",0,0,0) End Sub Note: You cannot break a string like I did. I just needed the room! mciSendString("open skiing.wmv type mpegvideo alias movie parent "& picVideo.Handle.ToInt32 & " style child",0,0,0) mciSendString("open skiing.wmv alias movie",0,0,0) PictureBox name
33 Some Changes Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal _ lpstrCommand As String, ByVal _ lpstrReturnString As String, ByVal uReturnLength As _ Integer, ByVal hwndCallback As Integer) As Integer. Private Sub cmdPlay_Click(...)Handles cmdPlay.Click mciSendString("play movie",0,0,0) End Sub Private Sub cmdClose_Click(...)Handles cmdClose.Click mciSendString("close movie",0,0,0) End Sub Dim filename As String filename = "skiing.wmv" mciSendString("open " & filename & " type mpegvideo alias movie parent "& picVideo.Handle.ToInt32 & " style child",0,0,0)
Playing movies/videos in VB.NET MCI command string tutorial: mciSendString function: MCI commands: 34 Video Resource Links
Read the Description of Assigment-10 35