Using Sorenson Squeeze for Flash Video


Needless to say, the plain fact that Macromedia Flash 8 can import and embed video files playable by Flash Player 6 or higher is truly remarkable. Just when you thought you've seen everything, we need to tell you that your journey with Flash video doesn't end with the Flash 8 authoring tool or the Flash 8 Video Encoder. The native video compressor in Flash 8's Video Import wizard is Sorenson Spark Basic edition. What you can't see in the Video Import wizard is that the Basic edition of Sorenson Spark encodes only in CBR, or Constant Bit Rate. CBR encoding means each frame of the video is uniformly compressed, consuming the same (or constant) data rate throughout the entirety of the clip. If you're familiar with MP3 sound, you may already be aware of CBR encoding with music. The same principle applies to video compression as well.

We all know, however, that each frame of video may not require the same amount of data to describe. For example, a solid field of blue (such as a big blue sky) may not need as much data as a field of multicolored flowers, where several pixels in the frame have a different color. If your video footage contains a mixture of compositions and subject matter, it could benefit from another type of encoding known as VBR, or Variable Bit Rate. VBR encoding enables the compressor to change the rate of compression applied to each frame of video. Therefore, one frame may need only 200 bytes, whereas another may need as many as 400 bytes. In practice, just about all video footage can benefit from VBR encoding. One of the drawbacks to encoding with VBR is that it takes longer to compress a video clip than it does with CBR encoding.

Unfortunately, Flash 8's Video Import wizard does not allow you to apply VBR encoding to imported files. Luckily, Sorenson Media offers an application that does: Sorenson Squeeze 4. This application, which is sold separately from Flash 8, comes in two editions:

  • Flash only: This version of Squeeze creates Flash .flv and .swf files using the Sorenson Spark Pro and On2 VP6 codecs, which we describe later in this section.

  • Compression Suite: This version can output several multimedia audio/video formats, including DVD MPEG2, VCD MPEG1, QuickTime video movie files (.mov), Windows Media files, RealPlayer files, Flash Video files (.flv), and Flash movie files (.swf). For the purposes of our coverage, we discuss this version in the remainder of the chapter, but we only use features that are available in both the Flash MX and Compression Suite editions.

Note 

At the time of this writing, Sorenson Squeeze was in release version 4.2 for Windows and 4.1 for Macintosh. The 4.2 edition features the new On2 VP6 codec.

Sorenson Squeeze enables you to compress video files with Sorenson Spark Pro, which can use 2-pass CBR or VBR encoding, which means that Squeeze carefully examines each frame of video — twice. On the first pass, Squeeze analyzes the content of each frame. On the second pass, Squeeze performs the actual encoding, using the information it gathered from the first pass. The following list describes the added functionality Sorenson Squeeze offers beyond the native capabilities of Flash 8's Video Import wizard:

  • Superior encoding control: Sorenson Squeeze can use either 1-pass or 2-pass compression with CBR or VBR encoding with your digital video. You can adjust audio and video data rates independently, and specify other codec options not available in Flash 8. We discuss these options in a later section.

  • Batch processing: You can create several output versions of your digital video files with Sorenson Squeeze. Using the compression presets (discussed later), you can make a variety of low- and high-bandwidth movies all in one go.

  • Watch folder: You can have Squeeze automatically compress new files that you save into a specific folder that is watched by Squeeze. As soon as a new file is added to the watch folder, Squeeze begins compressing the file with the presets you've chosen.

  • DV capture: Sorenson Squeeze can capture video directly from a DV source, over an IEEE 1394 (also known as FireWire or iLink) connection. Just connect your DV camcorder or deck to the computer and capture a live feed from the camera.

  • Multiple output formats: Sorenson Squeeze can open several file formats and output several popular audio/video formats, including QuickTime Sorenson Video 3.0, Flash movie file (.swf), or Flash video file (.flv) formats. As such, you can make different movie formats for all of your Web video needs. You can use the Flash movie or Flash video formats with your Flash-based Web material and use other formats for non-Flash Web pages.

  • Filter settings: You can adjust the contrast, brightness, gamma, white restore, and black restore of the video image. Squeeze can also de-interlace your video footage, reduce video noise, crop the video frame, and fade the footage in and/or out. You can even normalize the audio track of the video file.

  • Compression presets: Perhaps the most useful feature of Sorenson Squeeze is the ability to use bandwidth presets for your video compression. Squeeze has predefined compression options for the following connection speeds: Modem, ISDN, Broadband Low, Broadband, Broadband High, LAN CD, and CD High Quality. You can adjust the compression settings of each preset, but you cannot add your own custom presets.

Web Resource 

You can download a trial version of Sorenson Squeeze at www.sorensonmedia.com.

Choosing a Flash Output File Type

After you install the trial version of Sorenson Squeeze 4.2 (or 4.1 on Mac), go ahead and launch the application. The Sorenson Squeeze interface is shown in Figure 17-38. The output formats are represented as three file icons in the application's toolbar.

image from book
Figure 17-38: You can choose from several output formats in Sorenson Squeeze 4.2 Compression Suite.

For any given video file, you can enable one or more of these formats to be exported in a batch.

Flash Video

As you learned throughout this chapter, a Flash Video file (.flv) is a video file that has been compressed with the Sorenson Spark or On2 VP6 codec. As such, you can quickly import it into a Flash 8 document — no further video encoding is necessary. Just like regular video files (such as .avi or .mov files), Flash Video files have a frame rate, frame size (dimensions), and an optional audio track. Once you import the Flash Video file into your Flash document, you can add further interactivity to it with ActionScript. You can also dynamically load Flash Video files into a Flash Player 7 or higher movie.

Flash Movie

Squeeze can also create fully functional Flash movies (.swf) from your digital video files. If you don't need to add anything to your video in Flash 8, you can simply choose your digital file and specify a compression setting for the Flash movie file (.swf) to be output from Squeeze. Voila! You have an instant Flash movie that can be loaded into an existing Flash movie with the loadMovie() action, or viewed independently in a separate HTML document.

Tip 

You can create Flash movies (.swf) containing video with frame rates different from Flash movies that load them. This means that you can create a 15 fps Flash movie from Sorenson Squeeze and load it into a slower playing 12 fps Flash movie. As soon as the Flash movie with video starts to play, both movies will play at the speed of the Flash movie with video. Video content is treated just like Stream sound in the Flash Player — it will govern the player's frame rate.

Compressing Video with Sorenson Spark Pro and On2 VP6 Codecs

In this section of the chapter, we walk you through the process of encoding video with Sorenson Spark Pro and On2 VP6 codecs in Flash .flv files. Flash Video files can be imported into existing Flash 8 documents or loaded at run time into Flash Player 7 or higher movies. .flv files using the On2 VP6 codec can only be loaded into Flash Player 8 or higher.

On the CD-ROM 

Make a copy of the lizard.mpg file, located in the ch17/source folder of this book's CD-ROM.

  1. Open Sorenson Squeeze 4.2 (or 4.1 on Mac), and choose File ð Open. Browse to the lizard.mpg file that you copied from the book's CD-ROM.

  2. Expand the Macromedia Flash Video group in the Format & Compression Settings pane, on the left side of the Squeeze interface. Ctrl+select the 256K_Stream preset and the VP6_256K_Stream preset, and click the Apply button. The two presets should now be visible below the lizard.mpg entry in the job list, as shown in Figure 17-39. These presets compress the video clip for 256 Kbps data rates (video and audio combined). The 256K_Stream preset encodes in the Sorenson Spark Pro codec, while the VP6_256K_Stream preset encodes in the new On2 VP6 codec.

    Tip 

    If you want to finesse the codec settings, expand the preset by clicking the plus (+) button. The video and audio codec settings are listed separately. Double-click the codec name to open the Audio/Video Compression Settings dialog box.

  3. Now press the plus (+) button in the Filters pane. In the Filter Settings dialog box, assign a name of Deinterlace Normalize to the filter, as shown in Figure 17-40. Select the Deinterlace check box and Auto Remove Interlacing in the combo box. Check the Normalize Audio option as well. Click OK.

  4. After you've created the new filter, select its name (Deinterlace Normalize) in the Filters pane and click the Apply button. The filter is now applied to the lizard.mpg clip. Notice that the filter is displayed in the Source Settings and each preset for the clip. If you ever want to adjust the filter for both presets, double-click the filter name in the Source Settings nesting. If you want to adjust a filter just for one preset, double-click the filter name in the appropriate preset nesting.

  5. Squeeze is ready to encode the Flash Video files from the original source video. Press the Squeeze It! button in the lower right corner of the application window. Squeeze starts the encoding process for the output files. When the compression is finished, click the Close button and quit the Squeeze application.

image from book
Figure 17-39: The two presets added to the lizard.mpg clip

image from book
Figure 17-40: The new Filter Settings dialog box




Macromedia Flash 8 Bible
Macromedia Flash8 Bible
ISBN: 0471746762
EAN: 2147483647
Year: 2006
Pages: 395

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