There are a variety of options for delivering video to Adobe Flash Player. You must choose a delivery option before you can add Flash video to your site.
Flash CS3 Professional lets you deliver on demand video in any of the following ways:
For live video, you must use streaming. For more information about live video, see Detailed comparison of delivery options.
Since the introduction of Flash MX and Flash Player 6, multimedia developers have been able to embed video within SWF files by importing video and placing it on the Timeline in the Flash authoring tool. When the SWF file is published, the video is fully contained in that file. This approach requires only a normal web server to deliver the video.
However, embedded video is recommended only when you want visitors who have Flash Player 5 or lower to be able to view your video, or when you must have one single file that encapsulates the video and the Flash content, or when your video clip is under five seconds long. In all other cases, embedded video is not recommended.
There are some benefits to using embedded video, such as the ability to see the individual video frames on the Flash Timeline and create overlays and interactions with the aid of the Flash design tools.
However, embedded video has some limitations:
Therefore, the embedded-video approach is recommended only in specific cases as described above; and even in those cases, you should use it only when you want to deploy very short clips of video, when the quality of that video is not very important, and when the video content is unlikely to change very often.
Flash Player 7 introduced a new technique called progressive download, which enables developers to use ActionScript commands to feed external video files into a SWF file and play them back at runtime. More specifically, you can use the netConnection and netStream objects in ActionScript to set the video file to play back, and to control the Play, Pause, Seek (to a timecode), and Close behaviors and the buffer time and size for a given video file.
In this method, the video content (FLV or MPEG-4 file) is kept external to the other Flash content and the video playback controls. Because of this, it's relatively easy to add or change content without republishing the SWF file.
Flash Professional (starting with Flash MX Professional 2004) also includes video components that you can use to quickly add a full-featured video playback control to your Flash project. In Flash CS3 Professional, the FLVPlayback component provides support for both progressive download and streaming video files. This component is easy to "skin" or customize, so that you can make your video player match your site design. See Dan Carr's article, Skinning the ActionScript 3.0 FLVPlayback component, for more details.
Flash CS3 Professional also includes a set of behaviors that can be used in conjunction with media components to create automated interactions between video sequences and slides in a project. Note that behaviors are available in Flash CS3 if your file is set to use ActionScript 2.0. (For details on using ActionScript 2.0 and video components, see the reference guide using the Flash Help panel. For more information on using video behaviors in Flash Professional 8 or with an ActionScript 2.0 file in Flash CS3 Professional, see Dan Carr's article, Controlling Flash video with the FLVPlayback behaviors.)
Using external progressive video files has the following advantages over using embedded video:
Note: A video file will always download progressively when loaded directly from the server; it is delivered through an HTTP request just like a normal web page or any other downloadable document. Flash Media Server is required to have the option of streaming the file.
The most complete, consistent, and robust delivery option is to stream video and audio files from a server running Flash Media Server. In streaming, each client opens a persistent connection back to the video server, and there is a tight relationship between the video being delivered and the client interaction. This approach lets you deliver features such as bandwidth detection to serve up the right size video, quality of service metrics, detailed tracking and reporting statistics, and a whole range of interactive features along with the video experience.
As with progressive download, with this method the video content (FLV or MPEG-4 file) is kept external to the other Flash content and the video playback controls. It is, therefore, relatively easy to add or change content without the need to republish the SWF file. Further, because there is a persistent connection between client and server when streaming, the video content can be changed based on feedback from the user or the application. For example, you can switch to a lower bit rate video if you notice quality-of-service degradation.
Customers who do not want the difficulty and expense of buying and maintaining server hardware and Flash Media Server software can get all the benefits of streaming video and MP3 files with the Flash Video Streaming Service. This service is a load-balanced, redundant deployment of Flash Media Server, hosted by an Adobe-authorized Content Delivery Network partner. For more information, visit the Flash Video Streaming Service page on Adobe.com.
Included with the Flash Media Server family of products is Adobe Flash Media Live Encoder, which is capable of integrating with plug-and-play cameras and microphones to allow you to capture audio and video while streaming it to Flash Media Server. For more information on streaming video and broadcasting live video, see the Flash Media Server Developer Center.
Table 2 provides a comparison of the characteristics of web video delivery techniques. For more information about deploying video encoded in the H.264 format to Flash Player, read Exploring Flash Player support for high-definition H.264 video and AAC audio.
| Embedded Video | Progressive download | Streaming delivery | |
|---|---|---|---|
| Encoding | By default, the Flash Video Import wizard encodes video using the VP6 video codec for use with Flash Player 8 and later, and the Sorenson Spark codec for use with Flash Player 7 and later. Alternatively, FLV files (encoded elsewhere) can be imported and placed on the Flash Timeline (re-encoding is not necessary). | FLV files are encoded during export from various professional editing and
encoding applications through the FLV QuickTime Export plug-in, through the
Flash Video Import wizard in Flash Professional 8 and later, or the video files can be
encoded with the stand-alone Flash Video Encoder.
Note: These options require Flash Professional 8 or later. Flash Professional CS3 and later also support MPEG-4 formats encoded using the H.264 codec. This is a widely used format with many third-party encoding tools available. |
Same as progressive delivery. In addition, bandwidth detection capabilities in streaming enable you to detect client connection and feed the appropriately encoded video. You can capture live video feeds from client-side webcams or digital video (DV) cameras and control live encoding variables programmatically. |
| File size | SWF files contain video and audio streams and the Flash interface, resulting in a single, larger file size. SWF files can load each other, enabling you to break up individual video clips into multiple files. | SWF and FLV files are kept separate resulting in a smaller SWF file size. | Same as progressive download. |
| Timeline access | When embedded in the Flash Timeline, video appears on individual keyframes and can be treated like any other object on the Stage. Ideal for creating interactions based on individual keyframes of video. | Video is played back only at runtime. Individual keyframes are not visible on the Flash Timeline. | Same as progressive download. |
| Publishing | Each time the Flash content is published or tested the entire video file is republished. Changes to video files require manually reimporting the files into the Flash Timeline. | Video files are only referenced at runtime. Publishing does not require referencing the video file directly, and is much faster than the embedded video approach. Video files can be updated or modified without changing the SWF files for a project. | Same as progressive download. You can dynamically pull videos from virtual locations, such as your SAN or the Flash Video Streaming Service CDN. |
| Frame rate | Video frame rate and SWF frame rate must be the same. | The video file can have a different frame rate than the SWF file, allowing for separate timings between video and the other Flash content. | Same as progressive download. Live video capture has programmable control over frame rate. |
| ActionScript access | Video playback and control is achieved by controlling the SWF content's playback on the Flash Timeline. Flash CS3 Professional provides several behaviors for controlling video and audio playback while using an ActionScript 2.0 file. | You can use the netStream object in ActionScript to Load, Play, Pause, and Seek through multiple external video files. | Same as progressive download. You can also use server-side ActionScript to provide additional functionality such as synchronization of streams, server-side playlists, smart delivery adjusted to client connection speed, and more. |
| Components | No video-specific components. | You can use media components (Flash MX Professional 2004 or later) or the FLVPlayback component (Flash Professional 8 or later) to set up and display external video files together with transport controls (Play, Pause, and Search). | You can use media components (Flash MX Professional 2004 or later) of the FLVPlayback component (Flash Professional 8 or later) with video streamed from Flash Media Server or Flash Video Streaming Service. Also, you can use Flash Media Server communication components for streaming live and multiway video. |
| Web delivery | The SWF file progressively downloads, unless you embed it in a movie clip. In that case, the entire video must be downloaded to the client and loaded into memory before it plays back. | Video files are progressively downloaded, cached, and then played from the local disk. The entire video clip need not fit in memory. | Video files are streamed from Flash Media Server, played on the client's machine, and then discarded from memory in a play-as-you-go method. The video is never cached. |
| Performance | Audio and video synchronization is limited after approximately 120 seconds of video. Total file duration is limited to available RAM on the playback system. | Improved performance over embedded SWF video, with bigger and longer video and reliable audio synchronization. Provides best image quality, which is limited only by the amount of available hard drive space on the playback system. | Provides the best performance from a web delivery perspective, with optimal bit rate delivery on an as-needed basis to as many customers as necessary. Image quality limited to bit rates that can be delivered in real time. |
| Usage | Shorter video clips (less than 1 minute) that are smaller (less than 320 × 240), and have a lower frame rate (12 frames per second (fps)). | Longer video clips that are larger (720 × 480 and greater) and have a higher frame rate (up to 30 fps). | Large quantities of video, very long video clips, and live and multiway streaming (such as webcam chats and live event broadcasts). |
| Compatibility | Flash Player 6 and later (On2 VP6 codec requires Flash Player 8 or later.) | Flash Player 7 for Sorenson Squeeze codec, Flash Player 8 for On2 VP6 codec, Flash Player 9,0,115,0 or later for H.264. | Flash Player 6 and later. Flash Player 9,0,115,0 or later with Flash Media Server 3 (or later) for H.264. |