Video
We perceive motion as a continuous flow of events. Conceptually, motion is captured as a sequence of pictures at a constant time interval. Each picture is called a frame. How fast the pictures are captured or how fast the frames are played back is determined by the frame rate which is measured in frames per second (fps).
There are standards for digital video's resolution, color spaces, and frame rate. These standards are related to analog broadcast standards, which historically have differed around the world.
Resolution in video is determined by a number of considerations: aspect ratio, frame size and bit depth. Aspect ratio is the ratio of the width of the frame to the height of the frame. For example, high definition digital video and high definition TV (HDTV) has an aspect ratio of 16:9. Frame size is the pixel dimensions of the frame, how many pixels wide by how many pixels across. High definition DV (HDV) can have a frame size of 1280 x 720 pixels or 1920 x 1080 pixels. Bit depth refers to the number of bits used to describe the color of a pixel.
As with all digital files, there is a trade-off with file size and quality. If you have greater resolution, you have a larger file. It is always important to consider what the final delivery system will be for a project, file size is obviously an issue if a video will be seen on the web.
SD and HD
As noted previously, there were a number of different analog broadcast standards used internationally. Standard Definition (SD) digital video formats reflect these differing standards. NTSC is the standard that was used in this country. The NTSC standard definition DV frame is 720 x 480 pixels with an aspect ratio of 4:3.
High Definition (HD) most commonly involves display resolutions of 1,280 x 720 pixels or 1,920 x 1,080 pixels with an aspect ratio of 16:9.
Digitizing Video
Each frame in a video is an image. In digital video, these images are digitized in a way similar to digital images; sampling and quantization. The image for each frame is sampled into a grid of discrete samples – sampling process. Each sample becomes a pixel. The digital video frame size is still measured in pixels, like digital still images. Each pixel is assigned with a color value from a finite list of color numbers (bit depth) – quantization process.
Besides the image frame, sampling process also occurs in the temporal dimension of video. The sampling rate of the temporal dimension is the frame rate of the video. The higher the frame rate, the more accurate the motion is sampled. However, higher frame rate also means more frames for the same video length which results in a larger file size.
Video Compression
Because video files are so large, they must be compressed. A compressed file must be decompressed before it can be used in normal applications. Compression and decompression always go together. The term codec comes from compressor/decompressor.
Common Video File Formats
File Type | Abbreviated From | File Information and Codecs | Created by |
---|---|---|---|
.mov |
QuickTime Movie |
Can contain other data such as audio. Many codecs are supported, including H.264, MPEG-4, Sorenson Video, Cinepak, Animation, Planar RGB |
Apple Computer |
.avi |
Audio Video Interleave |
Common codecs include Microsoft RLE, Cinepak, Indeo Video |
Microsoft |
.mpeg |
MPEG-2 |
Highly compressed; format widely used for digital television and DVD |
Moving Picture Experts Group |
.flv |
Flash Video |
Used to deliver video content over the web. Codecs include H.264, Sorenson Spark, VP6 |
Macromedia |
Methods for Using Video in Flash
There are a number of ways that video can be incorporated into Flash:
- Video is streamed with Adobe Flash Media Server
- Video is progressively downloaded from a web server
- Video is embedded in the Flash document
All of these methods have advantages and disadvantages. We are going to look at embedding video. Embedding video does not require additional software such as the Adobe Flash Media Server. Another advantage is that it does not necessarily require any ActionScript coding. However, embedding video increases the file size of a project quite a bit, so it should only be used for video clips that are 10 seconds or less.
Encoding Video
- In order to embed a video into a Flash Project, the video must be encoded into the FLV format. You can convert a video to this format using the Adobe Media Encoder.
- Use a video clip of your own, or download a video clip from a site such as archive.org. If downloading from http://www.archive.org/details/movies, choose a MPEG4 file format.
- Once you have downloaded the file, launch the Adobe Media Encoder. To add a file to the queue to be encoded, click the ADD button on the right of the screen, or simply drag the file over the list area.
- Once you have added the file to the queue, you can adjust the settings for how the file will be encoded. Click the SETTINGS button.
- On the left side of the window that opens, you can set the in and out points for the encoded video by pulling the sliders below the video screen. By adjusting these points you can shorten your video clip, you will see the length of the encoded clip on the left, the original clip length on the right.
- On the right side, you can select your export settings. For embedding video in the timeline of a Flash project, select FLV|F4V then choose the preset FLV Match Source Attributes (High Quality). Click OK.
- When back in the window with the queue, click Start Queue. Your video clip will be encoded.
Adding Video to a Flash Project
- Now open up Flash. Create a new project, save and name it.
- Select File > Import > Import Video to import the video clip into the current Flash document.
- Select Embed FLV In SWF and Play In Timeline. Click Continue.
- Choose the symbol type with which to embed the video in the SWF file from the drop down list. Your options are Embedded Video, Movie Clip or Graphic.
- Embedded Video: If you’re using the video clip for linear playback in the Timeline, importing the video into the Timeline may be the most appropriate method.
- Movie Clip: A best practice is to place video inside a movie clip instance, because you have the most control over the content. The video’s Timeline plays independently from the main Timeline. You do not have to extend your main Timeline by many frames to accommodate the video, which can make working with your FLA file difficult.
- Graphic: By choosing Graphic, you have placed your video into a separate symbol from the main Timeline, but you will not have as many options to control it as you will with a Movie Clip.
- By default, Flash places the video you import on the Stage. To import into the library only, deselect Place Instance on Stage. You also have the option to Include Audio and Expand Timeline if needed.
- A final window that includes a summary of your video import settings appears, click Finish.
Return to syllabus