Accessibility
David Hassoun

David Hassoun

RealEyes Media
david.realeyes.com

Created:
22 May 2009
User Level:
Intermediate
Products:
Flash
Flash Media Server

Understanding live DVR – Part 2: Using DVRCast with Flash Media Live Encoder 3

This article provides a simple example of streaming and displaying live DVR-enabled content. You will capture and encode the content with Adobe Flash Media Live Encoder 3, stream the content to the DVRCast application (dvrcast_origin) on Flash Media Interactive Server 3.5, and play the content with the FLVPlayback 2. 5 component.

As I mentioned in Part 1, live DVR is the process of recording or "caching" a live video stream on the server and then enabling viewer access to the live or recorded stream content as it streams. A unique opportunity for this approach is making video-on-demand (VOD) content available quickly following the live event without the time-consuming requirement of sending, encoding, and uploading it. The recorded content can be made available as VOD content.

After reading this article, you should have a basic understanding of implementing the new DVRCast server-side application, streaming and recording content with Flash Media Live Encoder 3, and playing back the live DVR content with the updated FLVPlayback 2.5 component. If you want to use Flash Media Live Encoder for DVR, you must pair it with the DVRCast server-side application. This application is provided by Adobe and used in this article, and you must use Flash Media Live Encoder 3, as previous versions will not work. The same goes for the FLVPlayback 2.5 component; the updated version linked to in this article must be used when pairing with the new DVRCast server-side application.

Note: DVR functionality is not available with Flash Media Streaming Server because of the server-side caching/recording requirements.

Requirements

To make the best use of this article, you'll need the following software and files:

Flash Media Live Encoder 3

Flash CS4 Professional

DVRCast 1.1 application, FLVPlayback 2.5 component

Sample files:

Prerequisite knowledge

A basic understanding of how to use video in Flash CS4 Profesisonal, the FLVPlayback component, and Flash Media Server 3.5.

DVRCast with FLVPayback 2.5 and Flash Media Live Encoder 3

As a broadcaster, you can enhance your high-quality, live streams with DVR functionality. Flash Media Live Encoder 3 has been updated to support enabling DVR functionality on your live stream. Adobe released the Flash Media Interactive Server application called DVRCast—available for download from Adobe's Flash Media Server Productivity Tools page—to help manage your DVR workflow. To make it easier to develop your client application, the updated FLVPlayback 2.5 component for Flash CS4 Professional and Adobe Flex 3 has been enhanced with new functionality and management capabilities to consume and interact with live DVR-enabled streams.

Building an appropriate and robust solution requires additional encoding and streaming tools, plus the addition of a robust client-side player with server-side script to manage the event, recording, scheduling, and client-side interaction—as well as considerations for multiserver or origin/edge configurations. Along with the updated tools, the addition of the DVRCast server-side application offers a solution that is powerful, extensible, and easy to use out of the box. Flash Media Live Encoder 3 supports server-side recording, both on the start of publishing and after publishing has started, by manually invoking recording from the interface. An important note about using the new server-side recording functionality provided by Flash Media Live Encoder 3 is that it requires the server-side ActionScript (SSAS) provided with the DVRCast application. The source code is available and can be copied or merged in with existing server-side applications to enable Flash Media Live Encoder 3 and the FLVPlayback 2.5 component to work.

The updated FLVPlayback 2.5 component sports a few new properties regarding DVR with Flash Media Server. For simple usage, all you have to do is set the isDVR property to true—which will supersede the isLive property. There are also other parameters for initially snapping to the live point, such as dvrSnapToLive, and properties to allow some more fine-tuned performance or accuracy.

By default, when using the updated FLVPlayback 2.5 component with the DVRCast server-side application, the player will have a dynamic progress bar in relation to the preset or growing size of the recorded content. The FLVPlayback 2.5 component also has the ability to set a fixed, predetermined duration which will be represented in the progress bar in the client application if you desire. If you set a fixed, predetermined duration, it will disable the logic meant to handle the dynamic duration as the content is being recorded for you from the DVRCast application. (Read more about the dvrFixedDuration property in the special ActionScript 3.0 API documentation that accompanies the FLVPlayback 2.5 fl.video package.)

To get the DVRCast server-side application, Flash Media Live Encoder 3, and the updated FLVPlayback 2.5 component, check out the links in the Requirements section of this article.

Walkthrough: DVRCast 1.1, Flash Media Live Encoder 3, FLVPlayback 2.5

In this walkthrough you will:

  • Copy the DVRCast application to the Flash Media Server applications folder
  • Broadcast a live video from Flash Media Live Encoder and record the content to the server
  • Use the FLVPlayback 2.5 component to connect to a live DVR stream (see Figure 1)

Flash Media Live Encoder, Flash Media
Interactive Server, and the FLVPlayback component working together to form a live
DVR streaming media solution

Figure 1. Flash Media Live Encoder, Flash Media Interactive Server, and the FLVPlayback 2.5 component working together to form a live DVR streaming media solution

  1. Install the dvrcast_origin application into the {Flash Media Server install}/applications/ directory. This is done after extracting the dvrcast_origin application and moving it into the Flash Media Server application directory.
  2. Download and install the FLVPlayback 2.5 component.
  3. Launch Flash CS4 Professional.
  4. Open the file DVR-FLVPlayback.fla in the {start files}/hands-on/DVR-FMLE-FLVPB/start/ directory.
  5. Open the Components panel (Window > Components) and expand the Video category (see Figure 2).

    Expanded Video category in the Components panel

    Figure 2. Expanded Video category in the Components panel

  6. Drag the FLVPlayback 2.5 component onto the Stage, and click it to select it.
  7. Open the Component inspector (Window > Component Inspector) and set the isDVR property to true. Also set the source property to the following (see also Figure 3):

    rtmp://{yourserver}:1935/dvrcast_origin/livestream

    Setting the source property for the live video stream

    Figure 3. Setting the source property for the live video stream

  8. Launch Flash Media Live Encoder 3.
  9. Under the Encoding Options tab, enable video by clicking the Video check box (see Figure 4).

    Enabling video on the Encoding Options tab

    Figure 4. Enabling video on the Encoding Options tab

  10. Set the RTMP path to the following (see also Figure 5):
    rtmp://{your server}/dvrcast_origin

    Setting the RTMP path

    Figure 5. Setting the RTMP path

  11. Click the Connect button.
  12. Check the DVR Auto Record option at the bottom of the Flash Media Live Encoder window (see Figure 6).

    Setting DVR Auto Record option

    Figure 6. Setting DVR Auto Record option

  13. Click Start.
  14. Return to Flash and test the application (Control > Test Movie). You should see the live stream that is being recorded from Flash Media Live Encoder playing in the SWF file (see Figure 7).

    Live stream playing in the SWF file

    Figure 7. Live stream playing in the SWF file

Where to go from here

The DVRCast application from Adobe paired with Flash Media Live Encoder 3 and the enhanced FLVPlayback 2.5 component provide a powerful trident of tools to deliver powerful live DVR solutions to your audiences quickly. Live DVR can be easy to implement and extend its features and manage using the tools provided.

This article provided only a cursory overview of the full potential of the DVRCast server-side ActionScript application. To learn more, consult the DVRCast documentation on the Flash Media Server Productivity Tools page.

About the author

David Hassoun is the founder of RealEyes Media, LLC, a digital media firm based in Colorado that focuses on interactive motion media and advanced Flash and Flex platform applications. David has always had a passion for motion media, the power of video, and the challenges of usability and interactivity. David is an Adobe Certified Master Instructor, teaches advanced RIA classes at the University of Denver, serves as the Rocky Mountain Adobe User Group Manager, and has taught and developed advanced Flash and Flex application courses. As a consultant or while employed with other firms, he has worked for a wide range of companies such as American Express, Chase Manhattan, Qwest, Boeing, Macromedia, Adobe, US Air Force, Bechtel/Bettis, and many more. David regularly performs advanced code and technical best practices reviews, and has provided directional advice for international industry leaders over the past years—including many technical, courseware, and application reviews as an industry expert.