Icon

New Features in Flash 8 Professional, Part 3

Video takes center stage

Filters? Check. Blends? Check. Since the design crowd has gotten its due in parts one and two of this series, today we're going to shift gears a bit and focus on the improved video features included in Flash 8 Professional. The new stuff should simultaneously appeal to right-brainers and left-brainers out there, making Flash Video pretty much a no-brainer. So whether you're just looking for a simple way to post clips on the Web or wanting to create a super-immersive, video-heavy interactive application from scratch, Flash Video probably has something to offer you.

Been there, done that(?)

Macromedia's push to add video to Flash really only started with the debut of Flash 6, though products like Wildform Flix (which, somewhat ironically, is now owned by On2, the makers of Flash 8's new codec) existed earlier to provide video to SWF format conversion. As an aside, I know, I know—Flash 6 was really called Flash MX, but since Macromedia has returned to actual version numbers with Flash 8, I'm going to pretend that the silly MX naming convention never happened and refer to it as Flash 6. Same goes for Flash 7 (AKA "Flash MX 2004"). Take that, Macromedia marketing!

But I digress. First, a definition of Flash Video, at least for our purposes here today. Flash Video refers to Macromedia's proprietary FLV format itself, the process of encoding video into said format, and the various GUI- and ActionScript-based methods of adding FLV files to Flash movies. This definition, of course, is pretty much only relevant to Flash designers and developers; end-users only have to worry about having the Flash Player itself to view Flash Video, which is a huge advantage as far as deployment goes (more on that in a minute).

Now that were all on the same page, Flash Video was introduced with Flash 6 in 2002 and had more features added the very next year when Flash 7 was released. Flash 8 is no exception, with even more functionality shoveled in (as we'll soon see). So while it may seem like overkill and that Macromedia has hyped all this video stuff ad nauseam for the last 3-odd years, there's a good reason: Flash Video is solid technology and is growing like a weed. It's cross-platform. It's high-quality. It's relatively easy to create, implement and deploy. It's a good choice for offline projects as well, as it can be packaged into a projector (which, importantly, eliminates the need to install an additional player on the end user's machine). All pretty good reasons. But the best reason is that it's "just" another part of the Flash Player, so it's darn near everywhere by now.

According to the June 2005 Flash Player stats, the Flash 7 player is on 89.7% of browsers in the United States (a figure which is even higher in Canada and Europe, with Asia just a hair behind at 85.2%). Assuming those statistics are even close to being correct, 9 out of 10 browsers in the U.S. can view "modern" Flash video. And while it typically takes a year or more for a new Flash player to reach critical mass (meaning that if history holds we'll be talking about Flash 8 as the accepted player version sometime in September 2006), Flash Video is already a pretty safe bet as far as video formats go. But for as many strides as Flash Video had made in a relatively short period of time, there was still room for improvement, which brings me to why we're all here today. So, without further ado, down to business.

Encoding—strong like bull

The biggest change in Flash Video between versions 6 and 7 was the addition of the FLV Export Component that enabled the creation of FLV files from any QuickTime-aware program. While this fell into the "good" category, it was still hard to figure out how to batch process clips, short of purchasing a dedicated conversion program like the aging Cleaner or Sorenson Squeeze, and even then results could be spotty. And while Flash 8 retains the export component, I have good news. No, nothing to do with saving money on my car insurance—the good news is that Flash 8 Professional ships with a standalone encoder, appropriately titled the Flash 8 Video Encoder, which I'll call FVE from here on out (Fig. 1).

Fig. 1
Fig. 1: The main Flash Video Encoder interface.

FVE is pretty much a one-trick pony as far as these types of applications go. You've got a queue, queue management buttons, a settings button, batch controls, and a slide-out error panel when something goes awry (which isn't often). That's it. It's simple, but it works. Complexity, such as it is, in FVE is more or less limited to when you decide to click the Settings button, revealing the redesigned settings panel that is common to the three methods of encoding FLV files (FVE, the aforementioned Export Component, and direct video import into Flash itself, which we'll get to shortly). The settings panel, by default, reveals somewhat rudimentary options (Fig. 2) like a predefined list of encoding settings, a field to create a custom output file name, and a time slider that allows you to preview and set the in and out points of the source clip.

Fig. 2
Fig. 2

The real fun ("fun" being a relative term, since we're talking about encoding settings here) comes when you decide to get jiggy with it and press the Show Advanced Settings button, revealing (what else?) the advanced settings, which are broken down into three tabs. The first tab, Encoding (Fig. 3) offers garden-variety tweaks to all the encoding options, such as changing the codec (more on that later), data rate, frame resizing, etc.

Fig. 3
Fig. 3

The second tab, Cue Points (Fig. 4), lets you add a couple of different data types into the video itself. You can set a navigation cue point, which adds chapter markers along the clip's timeline, or you can use the Event cue point to trigger scripts as a clip plays.

Fig. 4
Fig. 4

The third and final tab in the Advanced Settings panel is Crop and Trim (Fig. 5), which adds long-awaited clip fiddling (for lack of a better term) to the FLV encoding process. I can't tell you how many times I've had to create intermediate QuickTime files for clips that came to me too long or with annoying blank edges, so I'm personally quite pleased with this timesaving addition.

Fig. 5
Fig. 5

As I alluded to before, Flash 8 Professional offers two other ways to convert video to the FLV format (the FLV Export Component and import directly into the Flash IDE), but to quote one of the wisest movie icons of the 1980's, these methods are different, but same. Different in that they both use the new setting panels I've already described, but same in the sense that they are accessed in identical fashion to their Flash 7 counterparts (Fig. 6). Now, the import method gives you a couple of new encoding options (like "stream from Flash Communication Server" or "Progressive download from a web server"), as well as a chance to select a controller skin (more on that later), but it's still just a wizard that helps you get from A to B (and, as such, remains my least favorite method of creating FLVs). So to wrap up the encoding portion of our program, I'll quote one of the wisest movie icons of the 1990's by declaring that's all I have to say about that.

Fig. 6
Fig. 6: QuickTime export on the left, Flash IDE import on the right.

Old and busted: Sorenson Spark. New hotness: On2 VP6

I've really outdone myself this time with a second Will Smith reference, no? The tragically unhip and out-of-date-on-pop-culture old fogey that I am strikes again. Anyway, enough lamenting on what a tool I am—we've got a new codec to chat about here. Flash Video, up until now, had exactly one codec: Sorenson Spark. It did a passable job, especially for a format in its nascent stages. But apparently it was time to take the next step, and the search for a new Flash Video codec yielded On2's VP6. The whys and wherefores of selecting VP6 are numerous, but it pretty much comes down to this: VP6 yields higher quality at the same bit rate than Spark. (Actually, if you want all the gory details of the codec search, check out Tinic Uro's excellent blog entry on the subject—it's a fascinating read.) Now, at high data rates, you're not going to see much of a difference between Spark and VP6. But encode a clip at the stock "Low Quality" setting of 150kbps, and the results can be striking (Fig. 7).

Fig. 7
Fig. 7

That's the same frame from the same clip, encoded with VP6 (left) and Spark (right). As always, your mileage may vary, but it's not a stretch to say that you can probably achieve better compression quality with VP6. Of course, quality isn't always the deciding factor—compatibility may be more important depending on the application. Macromedia still lets you encode with Spark (Fig. 8), so you'll still be able to target Flash 7 (and even some Flash 6) users from Flash 8.

Fig. 8
Fig. 8

The alpha and the omega

Back in Fig. 3, you may or may not have noticed a tiny little checkbox sitting rather innocuously under the codec selection menu. If you missed it, Fig. 9 will help you out.

Fig. 9
Fig. 9

That's right, Flash 8 now supports video with embedded alpha channels, a feature that QuickTime users have enjoyed since roughly the Triassic period. The process is largely self-explanatory: grab a QuickTime clip with an embedded alpha channel, begin the encoding process however you like (The FLV encoder will recognize that your clip has an alpha channel in the preview window, as shown in Fig. 10), select the Encode Alpha Channel option when you go to convert your clip to FLV, and that's it. No fuss, no muss.

Fig. 10
Fig. 10

I'm sure I don't need to point out the possibilities of real-time video compositing within the Flash environment, but if you need some sort of visual example, take your browser to Macromedia's Studio 8 Experience site (Fig. 11). Yeah, it's a little cornball (maybe even a lot cornball), but it's a nice example of a pretty complex project that makes liberal use of video with alpha channels.

Fig. 11
Fig. 11: An image from the Studio 8 Experience site.

Slip on a new skin

The Media Playback components included in Flash 7 were nice and all, and made integrating Flash Video into movies as easy as drag and drop, but boy, were they a nightmare to try and customize. Sure, I read in numerous places (and even tried once myself in a horrifying sequence events that will haunt me until the day I die) that you could, in theory, dig into the included component and attempt to change the symbols (AKA "skin") to create a custom player, but reports of actual success in doing so are few and far between (if any). Realistically, you had two options in Flash 7 if you wanted a custom FLV player: live with that gawdawful "Halo" green interface Macromedia gave you, or roll your own. I ultimately opted for the latter, and have never been sorry. But all that rigamarole changes in Flash 8, which finally includes a full set of completely customizable skins for your FLV files (Fig. 12).

Fig. 12
Fig. 12

There are a couple of ways to apply a skin. If you opt for the FLV import wizard to add or encode your video to a FLA file, one of the steps will be to select a skin from a list like that shown in Fig. 12. Another way to choose a skin is to add an instance of the new Player 8 Component (from the Components panel, of course) to your movie, and then use the Component Parameters panel to access the skin menu (Fig. 13).

Fig. 13
Fig. 13

As Fig. 12 may have shown you, there are a lot of skin options to choose from. While there are only four base skins, each skin type has several variations based on which controls you want to offer your users and whether you want the controls to sit on top of the clip or in a more standard configuration underneath the clip. Fig. 14 shows the Clear skin (which is a nice, non-threatening skin designed to go over pretty much any background except pure white) in a couple of iterations:

Fig. 14
Fig. 14

Also, it's now actually easy customize the look of your player if none of the included skins happen to float your boat. Again, you have a few options here. One way is to crack open the source FLA for any of the included skins and use that as a jumping off point for tweaking the widgets (Fig. 15). Once you're happy and you publish your custom skin to a SWF file, all you need to do is select the "Custom Skin URL" option and point it at the SWF file you just made.

Fig. 15
Fig. 15

As an aside, regardless of whether you choose a predefined skin or use the source FLA files to create your own, you're stuck with an external SWF file (Fig. 16). I have no idea why this is a requirement of the new Flash skinning paradigm, but it's sort of annoying. But it is what it is, and convenience apparently has a price.

Fig. 16
Fig. 16: If you want to use a predefined skin, you're going to have to deal with extraneous SWF files.

One way around additional SWFs (other than writing something from scratch, which would kinda sorta defeat the purpose here) is to use the second option for customizing your skin: individual controls (Fig. 17). This is a new addition to Flash 8, and while you need just a dash of ActionScript to connect individual controls to your clip, you gain a ton of flexibility without having to publish additional SWFs just to handle the player skin.

Fig. 17
Fig. 17

The steps to do this are pretty simple. Let's say I want to put a simple Play/Pause button in the corner of my clip. I'd have to:

  1. Drag an instance of the FLV playback component onto the Stage.
  2. Choose the FLV to play using the Parameters panel.
  3. Name the clip instance in the Properties panel ("myFLV").
  4. Drag an instance of the PlayPauseButton component onto the Stage.
  5. Name the PlayPauseButton instance in the Properties panel ("myPlayPause").
  6. Tell the PlayPauseButton to attach itself to the FLV playback instance using ActionScript

That's it. Now, for the curious, the precise ActionScript you have to use to connect the control with the clip goes a little like this:

myFLV.playPauseButton = myPlayPause;

That's not too bad, even for those who are deathly afraid of scripting. Now, the big difference between using the individual controls and using the predefined skins is that once an individual control is in the Library, all the assets are available for you as regular ol' Movie Clips to tweak to your heart's content (Fig. 18). Plus, when you go to publish, no pesky extra SWF file. So I can definitely see the individual controls becoming my preferred method for designing custom players, meaning that my carefully Flash 7-era player coded from scratch will soon be gathering dust up on the proverbial shelf. Oh well. I yield in the name of progress.

Fig. 18
Fig. 18

For those about to geek, we salute you

I'd be remiss if I didn't mention the host of new classes available to all you ActionScript gurus out there. Seeing as that I'm an "upper middle class" ActionScripter on my best day, I'm bound to gloss over something vitally important on this subject, and for that I apologize in advance. But I'll give it my best shot anyway, for the sake of attempting to be as complete as I can here.

With the new FLV playback component we've seen earlier comes an accompanying ActionScript class, appropriately titled the FLVPlayback class (Fig. 19). With the methods, properties, and events contained within that class, you have a tantalizing array of options for controlling FLV files solely through ActionScript. Just about everything (which possibly includes the kitchen sink) is covered in the FLVPlayback class: commands to influence things like cue points, buffering, playback controls like playing state and scrubbing, transforms, and the list goes on. The only potential downside to this is that the Flash 8 Player is required for the new component and class, so you'll have to target the latest player for your movies to work. Of course, if you need to target legacy players, the Flash 7 version of the MediaPlayback component and classes are still available.

Fig. 19
Fig. 19: This shot of the Flash 8 Help Panel shows just a peek at the numerous FLVPlayback commands available.

You don't know the power of the dark side

Speaking of drawbacks, there are a few more that need mentioning. First and foremost, as with the new Filters and Blend modes, the new Flash Video features definitely need to be approached with the tried-and-true adage (which I'll paraphrase here):

Just because you can do something doesn't mean you should.

Indeed, there is the potential for some serious performance hits with the new VP6 codec. Another incredibly helpful entry in Tinic Uro's blog mentions that not only does the VP6 codec eat up about twice the system resources than the old Spark codec, but the alpha channel feature is something of a hog in its own right. So caution is definitely advised here, because while most modern computers may be able to handle whatever you want to throw at them, older machines most certainly will choke on a heaping helping of resource-sucking features if you're not careful.

I also have a couple of peeves. One is that there doesn't seem to be any way to save custom settings in the Flash Video Encoder. It ships with a defined set of options, and you can certainly use those as a jumping off point to tweak via the advanced settings, but there is no way to save those tweaks as a custom setting. Being on a Mac, I even poked around inside the application package itself to see if I could find an XML file or something that I could edit to add custom settings (I didn't), but that shouldn't be the way to have to do it even if I had stumbled across something.

The second peeve I have is that there is still no easy way to view standalone FLV files, short of building one from scratch. Sure, there are a few folks who have used various SWF wrappers to create rudimentary FLV players, and my chosen solution for FLV files created for Flash 7 was to use the VLC Media Player (which doesn't play VP6-encoded files), but nothing official. If Macromedia is going to include a dedicated FLV encoder, the least they can do is provide a dedicated FLV player, one that associates itself with FLV files and offers double-click (and File:Open) simplicity for viewing FLV files. Alternately, if we get a FLV export module for QuickTime, why can't we have an import module so FLV files can be viewed right in the QuickTime player? It's a simple problem with a couple of solutions, but apparently not a priority for Macromedia.

You've come a long way, baby

Despite the few issues I have with the latest round of video improvements, the news is still good. It seems like only yesterday I was using Wildform/On2 Flix to spit out proto-Flash Video as SWF files, and look where we are today. Flash Video has rapidly matured, and the new features in Flash 8 look to propel the technology even further. It's been an interesting ride so far, and should be more so once it becomes clear what plans the combined Adobe/Macromedia ubercorporation have for the format.

Next time we'll wrap up our Flash 8 Professional new features tour by making some scrapple. And with such an appetizing teaser, I trust I'll see you all then.

^ Top of Page

Got Feedback? to send an email. I'll do my best to answer. Really.