Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / Flash Media Server Developer Center /

Live dynamic streaming and DVR for non-developers

by Jens Loeffler

Jens Loeffler
  • Adobe

Created

31 August 2009

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
encoding | decoding Flash Media Interactive Serv... Flash Media Live Encoder streaming templates

Requirements

Prerequisite knowledge

This article is intended for non-developers. You will, however, need to know how to edit XML/SMIL files and upload files to a web server.

User level

Beginning

Required products

  • Flash Media Live Encoder (Download trial)
  • Flash Media Interactive Server

Sample files

  • live_dynstream_dvr.zip (3942 KB)

Additional Requirements

Flash Media Live Encoder 3

  • Try
  • Buy

You can also use a third-party encoder with Flash support.

Flash Media Interactive Server 3.5

  • Try
  • Buy

You can also use an FVSS service provider in place of Flash Media Server.

This tutorial provides step-by-step instructions on how to set up a dynamic streaming environment without writing any code. With the release of Adobe Flash Media Server 3.5, you now have some exciting new features available for live video delivery, including dynamic streaming and digital video recording (DVR). During playback, dynamic streaming enables automatic switching to a different stream when bandwidth or performance characteristics change, and DVR capabilities enable the user to pause and rewind live streams.

If you have Adobe Flash programming skills, there are some good resources available in the Flash Developer Center to help you take advantage of these features. If you don't have Flash skills—for example, if you are video engineer who has never used Flash before—don't worry. You can still evaluate live dynamic streaming without asking the development team for help or learning Flash or Adobe Flex on your own.

Although this example leverages Adobe Flash Media Live Encoder, you can also use third-party encoders; the setup will work no matter what your encoding environment is.

This tutorial covers the following:

  • Installation steps for Adobe Flash Media Interactive Server server-side code (DVRCast)
  • A sample application to control the DVR functions
  • Sample players for live dynamic streaming and live dynamic streaming with DVR

Configuring the live encoder for live dynamic streaming

One of the reasons Flash media is the leading format for video delivery on the web is the excellent user experience that the Flash platform provides. Adobe Flash Player is ubiquitous (almost all platforms are supported with 99% penetration on desktop computers), it's easy to monetize, and it provides a common platform for different browsers and operating systems.

Dynamic streaming

Web users are demonstrating a growing appetite for HD-quality video on demand as well as live content. Dynamic streaming, also known as adaptive streaming, is a technology that allows the quality of the stream to improve or degrade to predefined bit rates based on available bandwidth and performance. This capability combined with the high penetration of Flash Player 10 provides the best possible user experience for HD on the web.

On-demand dynamic streaming requires a separate file for each included bit rate. There is a similar requirement for live dynamic streaming; each target bit rate requires an encoded stream to be sent to Flash Media Server or a content delivery network (CDN).

Connection and stream names

The following information is required to publish from an encoder:

  • Flash Media Server URL and application name; for example:
    rtmp://myserver.com/dvrcast_origin/
  • Stream names

The stream names are different for live dynamic streaming and live dynamic streaming with DVR enabled. DVR requires the stream name to begin with the mp4: prefix and end with the suffix.f4v, since the server writes the DVR copy in real time on the server side and requires a more specific filename. The prefix mp4: indicates to the server that the file contains H.264 video.

For example, your stream selection for "livestream" might be livestream500, livestream800, livestream1200, livestream1800, livestream2200, and livestream3000.

The DVR equivalent would be as follows: mp4:livestream500.f4v, mp4:livestream800.f4v, mp4:livestream1200.f4v, mp4:livestream1800.f4v, mp4:livestream2200.f4v, and mp4:livestream3000.f4v.

Follow these steps to set up Flash Media Live Encoder for dynamic streaming:

  1. Select Output from the Panel Options menu on the right side of the Encoding Options tabbed panel.
  2. Select Stream to Flash Media Server.
  3. Specify your Flash Media Server URL. For the stream name, you can use %b as a placeholder for the bit rates to differentiate the streams (see Figure 1).
  4. Specify the video streams and encoding properties. For this example, use H.264 as the video codec and MP3 as the audio codec.
Setting up the Flash Media Server URL and stream name in Flash Media Live Encoder
Figure 1. Setting up the Flash Media Server URL and stream name in Flash Media Live Encoder

Multiple encoders

One challenge with multiple streams is that they eventually get out of sync because they are sent separately. Flash Media Server has built-in in functionality to synchronize incoming streams based on the source video time code. If you publish from the same encoder, your stream time codes should be in sync. If you run your encodes across multiple encoders, the encoders need to synchronize the time code. The implementation depends on the encoder. Flash Media Live Encoder uses the Network Time Protocol (NTP), while some third-party encoders support synchronization based on the source time code.

To enable NTP synchronization in Flash Media Live Encoder, turn on the feature in the <FMLE Installation Directory>/conf/config.xml file:

<streamsynchronization> <!-- "true" to enable this feature, "false" to disable --> <enable>true</enable> ... </streamsynchronization>

Installing and configuring Flash Media Interactive Server

To use the DVR functionality, you'll need to install Flash Media Interactive Server (or Flash Media Development Server) and the DVRCast application.

If you don't have a license for Flash Media Interactive Server, you can download and install Flash Media Development Server. It has the same functionality but it is limited to 10 concurrent users and is free to use. See the Beginner's guide to installing Flash Media Server 3.5 for detailed instructions.

DVRCast is a prebuilt, server-side application for Flash Media Interactive Server 3.5 that makes it easy to add network-based DVR functionality for small- to large-scale deployments (Origin/Edge architecture support).

After you download and unzip the DVRCast application ZIP file, copy the dvrcast_origin folder to your Flash Media Server applications folder.

Controlling the DVR

DVR recording does not start automatically on the server when the streams are available. There are several ways to start the recording and control other DVR functionality. One option is to use the DVR controls in Flash Media Live Encoder. If you are using a third-party live encoder, however, it might not offer the same control functionality. Since DVRCast provides an ActionScript-based interface, it is possible to simply trigger DVR through a Flex-based application.

DVRController is a small Flex-based application that you can use to start and stop DVR recording.

To install and run DVRController:

  1. Download and unzip the sample file, live_dynstream_dvr.zip.
  2. Locate the folder DVRController/web and copy its contents to your web server.
  3. Open DVRController.html in your browser and follow the on-screen instructions (see Figure 2).
The DVRController application
Figure 2. The DVRController application

In you are a developer, you may be wondering what is going on behind the scenes. You can look at the source code and find additional information in the DVRCast documentation. One of the keys is a call to the server-side function, DVRSetStreamInfo. The application calls this function with a stream information object:

nc.call("DVRSetStreamInfo", new Responder(onDVRSetStreamInfo),streamInfo);

The application is fully customizable and can be embedded into existing workflows. You can also publish the application as an Adobe AIR application and run it as a local application on the system running the encoder or server.

Using the video player

On the client side, you will need Flash Player 10 and a script with dynamic streaming capabilities. There are a couple of resources available for creating the client-side logic, including the FLVPlayback 2.5 component and the Open Source Media Framework. The player included in the sample live_dynstream_dvr.zip file uses FLVPlayback 2.5, an ActionScript 3 component with full support for dynamic streaming and live DVR functionality.

There are two versions of the player in the sample file. The version in player/web/live supports dynamic streaming, and the version in player/web/livedvr supports live dynamic streaming with DVR functionality.

To set up the player:

  1. Copy the version you want to use to your web server.
  2. Edit the video.smil file to configure your streams:
<head> <meta base="rtmp://myserver.com/dvrcast_origin/" /> </head> <body> <switch> <video src="mp4:livestream500.f4v" system-bitrate="500000"/> <video src="mp4:livestream800.f4v" system-bitrate="800000"/> <video src="mp4:livestream1200.f4v" system-bitrate="1200000"/> <video src="mp4:livestream1800.f4v" system-bitrate="1800000"/> <video src="mp4:livestream2200.f4v" system-bitrate="2200000"/> <video src="mp4:livestream3000.f4v" system-bitrate="3000000"/> </switch> </body> </smil>

The stream names should be identical to the publish names; for example mp4:livestream500.f4v for a live DVR stream or livestream500 for a live stream. Remember to replace rtmp://myserver.com with your own Flash Media Server URL and specify the correct bit rates in byte format.

  1. Save the video.smil file and open the index.html file in your browser to start the player. The player (see Figure 3) now streams your live content and adjusts the bit rate dynamically.
Live DVR player
Figure 3. Live DVR player

This player is fully customizable, and the source is available in the sample ZIP file. It is optimized for 720p live streams and doesn't adjust the video object size for lower stream resolutions. If you host your video with a CDN, I encourage you to ask your CDN for a test player. Some CDNs require custom subscription logic for live streams, which is not part of the sample player.

Plans for the Open Source Media Framework include CDN-specific live support in the future. If you have any Flash development skills, you can also modify the source to add a subscription call.

Where to go from here

This tutorial covered the basic steps needed to set up your own dynamic streaming environment. If you are interested in more technical details, the Video Technology Center contains some useful and more detailed resources. Also refer to these specific articles:

  • Beginner's guide to streaming live video with Flash Media Server 3.5
  • Beginner's guide to dynamic streaming with Flash Media Server 3.5

Additionally, I recommend subscribing to the Flash Platform blog, which is great resource for staying up to date. Enjoy!

More Like This

  • Explore video content protection measures enabled by Flash Media Interactive Server 3.5
  • Beginner's guide to using ActionScript 3.0 with Flash Media Server 3.5
  • Beginner's guide to streaming video with Flash Media Server 3.5
  • Dynamic streaming in Flash Media Server 3.5 – Part 1: Overview of the new capabilities
  • Learning Flash Media Server excerpt: Server-side streams
  • Beginner's guide to streaming audio through Flash Media Server 3.5
  • Beginner's guide to dynamic streaming with Flash Media Server 3.5
  • Video encoding and transcoding recommendations for HTTP Dynamic Streaming on the Flash Platform
  • Introducing Adobe Flash Media Server 4.5
  • Creating a simple multicast video player using OSMF

Tutorials & Samples

Tutorials

  • OSMF video player for AIR for TV using Flash Professional
  • OSMF video player for AIR for TV using Flash Builder
  • Capture, encode, and stream live video over HTTP to Flash and iOS

Samples

  • Best practices for real-time collaboration using Flash Media Server
  • Understanding live DVR – Part 2: Using DVRCast with Flash Media Live Encoder 3
  • Understanding live DVR – Part 1: Implementing a live DVR player

Flash Media Server Forum

More
04/23/2012 FMS Issues
04/23/2012 FMLE 3.2 to FMS 4.5 - Over time the stream delay increases
04/23/2012 Live stream on FMS issues when reaching 1600 concurrent users
04/23/2012 How does main.asc work in signed folder ('live' or 'vod') with FMS4.5?

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement