Adobe
Products

Top destinations

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • SiteCatalyst
  • Students
  • Elements family

Adobe Creative Cloud

  • What is Adobe Creative Cloud?
  • Design
  • Web
  • Photography
  • Video
  • Students
  • Teams
  • Enterprise
  • Educational institutions

Design and photography

  • Photoshop
  • Illustrator
  • InDesign
  • Adobe Muse
  • Lightroom

Video

  • Adobe Premiere
  • After Effects

Web development and HTML5

  • Edge Tools & Services [opens in a new window]
  • Dreamweaver
  • Gaming [opens in a new window]

Adobe Marketing Cloud

  • What is Adobe Marketing Cloud?
  • Digital analytics
  • Social marketing
  • Web experience management
  • Testing and targeting
  • Media optimization

Analytics

  • SiteCatalyst
  • Adobe Discover
  • Insight

Social

  • Adobe Social

Experience Manager

  • CQ
  • Scene7

Target

  • Test&Target
  • Recommendations
  • Search&Promote

Media Optimizer

  • AdLens
  • AudienceManager
  • AudienceResearch

Document services

  • Acrobat
  • EchoSign [opens in a new window]
  • FormsCentral [opens in a new window]
  • SendNow [opens in a new window]
  • Acrobat.com [opens in a new window]

Publishing

  • Digital Publishing Suite

  • See all products
Business solutions

By business need

  • Digital analytics
  • Digital publishing
  • Document management
  • Media optimization
  • Social marketing
  • Testing and targeting
  • Video editing and serving
  • Web development [opens in a new window]
  • Web experience management
  • See all business needs

By industry

  • Broadcast
  • Education
  • Financial services
  • Government
  • Publishing
  • Retail
  • See all industries
Support & Learning

I need help

  • Products
  • Adobe Creative Cloud
  • Adobe Marketing Cloud
  • Forums [opens in a new window]

I want to learn

  • Training and tutorials
  • Certification [opens in a new window]
  • Adobe Developer Connection
  • Adobe Design Center
  • Adobe TV [opens in a new window]
  • Adobe Marketing Center
  • Adobe Labs [opens in a new window]
Download
  • Product trials
  • Adobe Flash Player
  • Adobe Reader
  • Adobe AIR
  • See all downloads
Company
  • Careers at Adobe
  • Investor Relations
  • Newsroom
  • Privacy
  • Corporate Social Responsibility
  • Customer Showcase
  • Contact us
  • More company info
Buy
  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers
  • Adobe Marketing Cloud sales [opens in a new window]
Search
 
Info Sign in
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Welcome,
My Adobe
My orders
My information
My preferences
My products and services
Sign out
My cart
Privacy My Adobe
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out Privacy 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
Promotions
Estimated shipping
Tax
Calculated at checkout
Total
Review and Checkout
Adobe Developer Connection / Adobe Media Server Developer Center /

Streaming video to iOS with Flash Media Server 4.5

by Jeff Tapper

Jeff Tapper
  • digitalprimates.net

by Nathan Weber

Nathan Weber
  • digitalprimates.net

Content

  • Set up server
  • Encode videos
  • Deploy encoded videos to server
  • Create and deploy the manifest files
  • Playing video
  • Where to go from here

Created

13 August 2012

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
Flash Media ServerHTML5iOSplaybackstreamingvideoVOD
Was this helpful?
Yes   No

By clicking Submit, you accept the Adobe Terms of Use.

 
Thanks for your feedback.

Requirements

Prerequisite knowledge

This article assumes you are new to using Flash Media Server and are interested in how to stream media files from Flash Media Server to iOS.

User level

All

Required products

  • Flash Media Server (Download trial)

In this article, you will get an overview of how to use Flash Media Server 4.5 to stream video content to iOS devices including the iPod Touch 4, iPhone, and iPad.

Streaming to iOS devices requires these five basic steps:

  1. Set up server
  2. Encode videos
  3. Deploy encoded videos to server
  4. Create and deploy the manifest file
  5. Play video

Set up server

The first step in the process is to download and install Flash Media Server (FMS). Flash Media Server 4.5 is available for Windows and Linux servers, and can be downloaded from here. Once you have downloaded and installed the server, you can test your installation by launching the FMS Administrator console (see Figure 1).

Figure 1. The file location of the FMS Administrator console. If you see the Administration Console login screen appear, you have verified that the server is properly installed.
Figure 1. The file location of the FMS Administrator console. If you see the Administration Console login screen appear, you have verified that the server is properly installed.

Encode videos

The next step is to ensure that you have your video files properly encoded to support playback on iOS devices. Current versions of iOS can play back h.264-encoded MP4 files. A number of tools are available to encode your source files, include Adobe Media Live Encoder (AMLE) and Adobe Media Encoder (http://www.adobe.com/products/mediaencoder.html), as well as many other commercially available hardware encoders. The articles below will give you advice on choosing the proper encoding profiles for your video assets, based on the devices you wish to target. In most cases, you will want to have your video encoded to several bit rates to allow for Adaptive Streaming, which will allow the playback device to determine the best-quality video it can currently play, based on factors including bandwidth, processor utilization, and others, depending on the circumstances.

The following articles show a number of suggestions for how to properly encode your videos for iOS.

  • Best Practices for Creating and Deploying HTTP Live Streaming Media for the iPhone and iPad
  • Video encoding/transcoding guidelines for Apple iOS with Adobe AIR
  • Simple mobile video encoding recommendations for Flash Player and AIR
  • Video Encoding Cookbook and Profile Guidelines for the Adobe Flash Platform
  • Capture, encode, and stream live multi-bitrate video over HTTP to Flash and iOS

Deploy encoded videos to server

Once you have your assets properly encoded, place them in the vod subdirectory of the webroot in your FMS installation directory. In Figure 2, the name of each rendition is suffixed with an underscore, and a number indicating its bit rate (in kbps).

Figure 2. VOD subdirectory of the webroot in FMS server
Figure 2. VOD subdirectory of the webroot in FMS server

Create and deploy the manifest files

To enable yourvideos to be played on an iOS device, you must create a manifest file (.m3u8). The manifest file is a text file that specifies the location and contents of a stream. Multiple formats are available for a manifest file, including single stream and multi-bitrate options. For more information, see Apple's HTTP Live Streaming Overview.

Flash Media Server 4.5 can generate a manifest file from a valid MP4 asset automatically, on demand. Once the MP4 asset is put into the vod directory in the FMS installation, it can be requested via a special URL. For instance, if the video file is called max1_1200.mp4, then the typical URL to access this content is:

http://some_url/vod/max1_1200.mp4

To access the on-demand M3U8 version of this asset for playback, use the URL:

http://some_url/hls-vod/max1_1200.mp4.m3u8

By changing "vod" to "hls-vod" and by adding the extension ".m3u8" to the end of the URL, you access the HTTP Live Streaming (HLS) application, installed with FMS, which performs the on-the-fly manifest generation.

When creating a multiple bitrate manifest, the M3U8 file looks like this:

#EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=400000 /hls-vod/max1_400.mp4.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=800000 /hls-vod/max1_800.mp4.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1200000 /hls-vod/max1_1200.mp4.m3u8

Each #EXT-X-Stream-INF defines a specific rendition of the video asset, its bandwidth (in bytes), and the URL to the MP4 file for that specific stream.

While it is possible to create these files by hand, it is not necessary. FMS includes an F4M/M3U8 File Generator, which can be found in the tools\f4mconfig\configurator subdirectory of your FMS installation path. Double-clicking the f4mconfig.html file will launch the generator in your browser (see Figure 3).

Figure 3. F4M/M3U8 File Generator
Figure 3. F4M/M3U8 File Generator

When it launches, click the m3u8 tab on the top. Now you can enter the URL and bit rate (in kbps) for each of the files. Optionally, you can also specify the resolution as well as video and audio codec information, but these are not required. When you are done, you can verify the information by clicking View Manifest to open the file (see Figure 4).

Figure 4. M3U8 file
Figure 4. M3U8 file

If the data looks correct, click the Save button and choose to save the file in the FMS webroot.

Playing video

Playing video in iOS involves either an iOS browser or an iOS app, using either AIR or native functionality. These examples show you how.

Launching video in an iOS browser

Playing the M3U8 or MP4 file is simple in HTML5. The following HTML5 code generates a basic video player. Notice the <video> tag in the body, which simply references the m3u8 URL on your server.

<!DOCTYPE html> <html> <head> <title>Simple Movie Player</title> </head> <body> <video src="http://fms_url/hls-vod/max1.mp4.m3u8" controls autoplay height=270 width=480> </video> </body> </html>

Playing video in AIR for iOS app

Making use of the Adobe Integrated Runtime (AIR), you can write native iOS applications with ActionScript 3. Here is a sample app to play a video from your Flash Media Server in iOS.

package{ import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; import flash.events.NetStatusEvent; import flash.events.StageVideoAvailabilityEvent; import flash.geom.Rectangle; import flash.media.StageVideo; import flash.media.StageVideoAvailability; import flash.net.NetConnection; import flash.net.NetStream; [SWF(backgroundColor="#000000", backgroundAlpha="0")] public class SampleVideoPlayer extends Sprite{ private const STREAM_URL:String = "http://fms_url/hls-vod/max1.mp4.m3u8"; private var netConnection:NetConnection; private var netStream:NetStream; private var video:StageVideo; private var addedToStage:Boolean; private var svEnabled:Boolean; public function SampleVideoPlayer(){ super(); addEventListener(Event.ADDED_TO_STAGE,onAddedToStage); } private function onAddedToStage(e:Event) :void{ stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onAvail); removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage); } protected function onAvail(event:StageVideoAvailabilityEvent):void{ if(event.availability == StageVideoAvailability.AVAILABLE){ svEnabled = true; } connectStream(); } private function connectStream():void { if (!svEnabled) return; netConnection = new NetConnection(); netConnection.addEventListener(NetStatusEvent.NET_STATUS, onConnectionNetStatus); netConnection.connect(null); } private function onConnectionNetStatus(event:NetStatusEvent):void { if (event.info.code == "NetConnection.Connect.Success") startStream(); } private function startStream():void { netStream = new NetStream(netConnection); netStream.client = this; video = stage.stageVideos[0]; video.viewPort = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight); video.attachNetStream(netStream); netStream.play(STREAM_URL); } private function onMetaData():void {} } }

Playing video in native iOS app

It is also possible to create a native iOS application to play these same video assets with Objective C and Xcode. For more information on this, see Apple's iOS Developer Library here:

  • About the AV Foundation Framework
  • Playback

Where to go from here

While streaming video to multiple devices seems complicated, in reality, it's quite simple to make your video assets available to iOS applications via Flash Media Server (FMS). Please read the articles linked below as well the other articles we will be writing (coming soon) to understand how Flash Media Server can ease the process of streaming video to most other devices.

  • Introducing Adobe Flash Media Server 4.5
  • Beginning FMS 4.5 – Part 1: Installation
  • Stream on-demand multi-bitrate video over HTTP to Flash and iOS
  • Stream on-demand video over HTTP to Flash and iOS
  • Install Flash Media Server 4.5 and verify HTTP streaming to Flash and iOS

More Like This

  • Encoding live video to H.264/AVC with Flash Player 11
  • Beginner's guide to streaming audio through Flash Media Server 3.5
  • Beginner's guide to dynamic streaming with Flash Media Server 3.5
  • Beginner's guide to using ActionScript 3.0 with Flash Media Server 3.5
  • Streaming AAC/MP3 files with Flash Media Server 3
  • Beginner's guide to installing Flash Media Server 3.5
  • Beginner's guide to streaming live video with Flash Media Server 3.5
  • Beginner's guide to streaming video with Flash Media Server 3.5
  • Protecting online video distribution with Adobe Flash media technology
  • Live dynamic streaming and DVR for non-developers

Tutorials & Samples

Tutorials

  • Implementing late-binding audio with Adobe Media Server for HTTP Dynamic Streaming and HTTP Live Streaming
  • Troubleshooting hang/crash issues in Adobe Media Server
  • Attaching alternate audio tracks using OSMF

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
05/21/2013 Recorded Webcam to IOS Device
05/10/2013 Installing Media Server 5.x on a Windows 2008 R2 server already running IIS 7
05/21/2013 change the wording for error "We are unable to connect to the network. We apologize for the in..."
05/21/2013 AMS on Centos

Products

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • Digital Publishing Suite
  • Elements family
  • SiteCatalyst
  • For education

Download

  • Product trials
  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR

Support & Learning

  • Product help
  • Forums

Buy

  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers

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 © 2013 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

Ad Choices

Reviewed by TRUSTe: site privacy statement