Encoding the Video

You have some control over the video compression (or encoding) when you are importing video into a Flash document. Flash doesn't give you as much control as other software might allow you to have; for example, Sorenson Squeeze, which contains the Spark Pro codec, is a fantastic tool for compressing video. Flash uses the Spark codec (the basic version) within Flash, and when exporting video for Flash 8 Player, can use On2 VP6 (which is the default). On2 Technologies produces the codec and has the advantage of having alpha channel support.


Flat areas of color are more difficult to compress well. These areas are typically the first area of a video clip to go blocky when you encode a video because they are difficult areas to compress. Adding a greater number of keyframes and setting the Quality to a high setting will help, but will have a more dramatic impact on your overall file size.


In the Encoding Section of your Import Video dialog box, press the Advanced button to show encoding options.

The advanced section gives you more control over how the video will be encoded when it is imported. You have options to change your video encoder, as well as to set keyframe intervals and quality.


Select the On2 VP6 video encoder if it is not already selected. Set your frame rate to match the source file and set the keyframe interval to Automatic.

Part of compressing video is determining frame rate and the keyframe interval.

By default, Flash 8 sets the frame rate of the video to be encoded to the same frame rate as the source video you are actually encoding. This is considered the best practice. The frame rate is more of a performance issue than a file size issue because the video must move along its own Timeline based on CPU usage. The higher a frame rate, the more CPU is consumed; however, unless you have a very good reason to do so, it is not recommended to change the frame rate during encoding because it could have unexpected consequences with the final file. If you have plenty of experience with video, you'll know the pitfalls and change the frame rate at your discretion. For our purposes, we will leave it to its default.

The keyframe interval you will set to automatic. In video, keyframes are video frames that contain data. The more keyframes there are in a video file, the more file size you wind up with. By default, Flash will insert a keyframe for every two seconds of video, which is more than ample for this particular file.


Set the Quality to Medium.

The quality determines not only the appearance of the video during playback, but also the end file size and playback performance. Generally, the higher the quality, the larger the file, and the more system resources are consumed on the end users computer.


You have the option of changing the quality to a custom setting by choosing Custom from the drop-down list, and changing the data rate. The lower the data rate, the lower the quality of the file, but also the smaller the file size will be. Experiment. It can't hurt anything!


Press Continue.

At this point, you are brought to a summary page that gives you information about the choices you made. If you change your mind about anything, now is the time to press Go Back and change things.


Press Finish to import and encode the video. Place the video instance at an x and y of 0 using the Property inspector.

Because you chose to embed the video and place an instance of it on the main document Timeline, your Timeline is expanded so the video has enough frames to play through. In this way, embedded video is very much like a graphic symbol. If the parent Timeline (in this case, the main document Timeline) isn't moving, the video isn't playing.

Because your video is now on the main document Timeline, you can control it almost as if it were a movie clip. You can add ActionScript that jumps to labeled frames if you want users to skip ahead to "chapters," or create Stop, Start, Pause functionality using Buttons.

Select the video instance on the Stage, and place it at an x and y of 0 so that it occupies the entire Stage.


Publish the document by selecting File > Publish Settings.

Publishing the file produces a SWF version that contains the video. You will use this SWF file in a later lesson to load the video dynamically.

Select File > Publish Settings and then deselect the HTML box in the Formats tab. Publish the file by pressing the Publish button and then press OK. Save and close the file.


Repeat the steps from the previous two exercises to produce video2.swf and video3.swf.

Create two new FLA documents, and name them video2.fla and video3.fla respectively. Import video2.mov and video3.mov into their corresponding files using all the steps in this exercise. Be sure to publish each file and then save and close it before moving on to the next.

Macromedia Flash 8. Training from the Source
Macromedia Flash 8: Training from the Source
ISBN: 0321336291
EAN: 2147483647
Year: 2004
Pages: 230
Authors: James English

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