- File Formats: SWF, FLV, H.264, and HTML
- Protocols: HTTP vs. RTMP
- Delivery: Web Server, Flash Media Server, or CDN?
- Playback: Live Streaming vs. Prerecorded
- Budgets: Bandwidth and Transfer Rates
Playback: Live Streaming vs. Prerecorded
You can not only compress and deploy video files from your own source video files but also stream live video from your Web cam to an FMS application. This application in turn can redistribute your live video stream to other users. FMS can even record the live stream for later playback!
Requirements for live streaming from Flash Player
To stream live video and audio from a camera and microphone on a computer or device, you need the following:
- Flash Player 6 or newer
- Macromedia Flash Communication Server (FCS) 1.0 or newer, or Adobe FMS 2.0 or newer
- Reasonably fast Internet connection from Flash Player to the FCS/FMS application, with a recommendation of at least a 128 Kbps or faster upload rate for minimum quality video and audio and ideally a 384 Kbps or faster upload rate
- Compatible USB or FireWire Web cam or video source
- Microphone connected to sound card or audio-in port, a USB headset/microphone, or a Bluetooth headset/microphone
- A Flash movie (the publisher) that negotiates the connection to a FCS/FMS application and publishes the video and audio stream to the server
- A Flash movie (the subscriber) that connects to the FCS/FMS application and plays back the live video and audio stream
You don’t need your own FCS or FMS license in order to stream a live audio and video feed over the Internet. You can use a hosted FCS or FMS account, as I mentioned earlier in the chapter. However, most FVSS providers do not offer live streaming capabilities.
Built-in real-time compression
Luckily, you don’t need special hardware to compress the live video from a Web cam (or video source; see “Not Just for Web Cams”). Flash Player has a built-in Sorenson Spark video encoder, as well as two speech codecs that can encode audio.
Using ActionScript, you can control the quality and bit rate of the live video and audio stream published from a Flash movie. You can control all aspects of the video stream, including frame rate, frame size, bit rate (or data rate), or quality. The audio stream can be published in the following kilohertz rates: 5, 8, 11, 22, and 44.
Currently, Flash Player doesn’t ship with any other built-in video encoder. However, Adobe has released Flash Media Live Encoder, a free stand-alone application that can encode live video as a real-time stream to an FMS. On2 sells Flix Live 8 for Windows, an application that streams live VP6-encoded video directly to an FMS application. Both of these applications allow you to take advantage of the higher quality of the On2 VP6 codec with live streams. Adobe Flash Media Live Encoder also enables you to stream with the AVC/H.264 codec. Inlet Technologies (http://www.inlethd.com) offers hardware-based live video streaming products. The Spinnaker series enables you to stream live VP6 or H.264 video to a Flash Media Server application. You’ll find links to these products at http://www.flashsupport.com/links.
Comparing live streaming video to prerecorded video
Live streaming video has a few key differences from prerecorded video content. Live streaming video can be compressed and streamed only by Flash Player in the Sorenson Spark codec, unless you’re using a separate product such as Adobe Flash Media Live Encoder. Although you have substantial control over many aspects of live streaming compression, you can use only CBR encoding with live video from Flash Player—no VBR encoding is available for live streams.
One of the most critical operational differences is control of bit rate. With live streaming video, the published video is being pushed to the FCS or FMS application at a specific bit rate. If the bit rate of the publisher stream is too high for a subscriber, then that user’s viewing experience of the live stream will suffer. FCS or FMS can’t adjust a published stream’s bit rate on the fly—at best, it can only drop frames on that subscriber’s stream. You should either use a bit rate for your live stream that is compatible with all subscribers or publish more than one stream. To publish more than one stream, you need more than one video camera or source connected to your computer: one for each published stream. This is also true for audio streams—you need one audio device for each audio stream published. You can also craft subscriber movies that turn off the video portion of a stream and play only the audio portion if the subscriber’s bit rate can’t support both data streams.