Home

Awesome

<!--[![Build Status](https://travis-ci.org/castlabs/dashas.png?branch=master)](https://travis-ci.org/castlabs/dashas)-->

dash.as

Dash.as plays MPEG-DASH video on any device supporting Adobe Flash. It is written in Adobe ActionScript and was designed from the ground-up to be lightweight with performance in mind.

MPEG-DASH (Dynamic Adaptive Streaming over HTTP) became an International Standard in 2011 and is a technique designed specifically for streaming high-quality multimedia over an HTTP server. It works by fragmenting content into a series of small HTTP-based file segments where each contains block of playback time. Content is made available at a variety of different bitrates to account for variations in a connection's bandwidth quality. Upon each download of a segment, the highest bitrate the connection can handle in time for seamless playback is selected. This allows MPEG-DASH to seamlessly adapt to changing network conditions at the highest quality possible for a seamless user experience.

This project is an extension for Open Source Media Framework and released under the Mozilla Public License 2.0.

At the same time there is profersional edition of dash.as which integrates nicely with the Adobe Access DRM. For more information please contact with sales department: "sales (at) castlabs (dot) com".

Please visit CHANGELOG for changes history.

For information on a digital rights management (DRM) enabled version, please visit the castLabs website.

Demo

For more information visit examples page.

Features

[1] A server has to have crossdomain.xml file in the root context.
[2] A server has to have custom .htaccess file in the root context.
[3] Adobe Flash Player supports only H.264 (MPEG-4 Part 10) and HE-AAC (MPEG-4 Part 3) codecs.

For more information about which attributes and tags are required in a manifest please visit unit tests.

Quick start

Input files

Create media input files in different bitrates.

Prerequisites

Instructions

  1. Download source file:

     $ wget http://mirrorblender.top-ix.org/movies/sintel-1024-surround.mp4
    
  2. Create video file encoded at 250k 436p, H.264 codec:

     $ ffmpeg -i sintel-1024-surround.mp4 -an -b:v 250k -s 1024x436 -vcodec libx264 avc1-sintel-436p-250k.mp4
    
  3. Create video file encoded at 500k 436p, H.264 codec:

     $ ffmpeg -i sintel-1024-surround.mp4 -an -b:v 500k -s 1024x436 -vcodec libx264 avc1-sintel-436p-500k.mp4
     
    
  4. Create video file encoded at 1000k 436p, H.264 codec:

     $ ffmpeg -i sintel-1024-surround.mp4 -an -b:v 1000k -s 1024x436 -vcodec libx264 avc1-sintel-436p-1000k.mp4
     
    
  5. Create audio file encoded at 69k stereo, HE-AAC codec:

     $ ffmpeg -i sintel-1024-surround.mp4 -vn -ac 2 -acodec libfdk_aac -profile:a aac_he -f mp4 mp4a-sintel-69k.mp4
     
     
    

Stream

Convert media input files into DASH stream files.

Prerequisites

Instructions

Page

Finally try dash.as locally.

Prerequisites

Instructions

  1. Create a virtual host for localhost;

  2. Copy DASH stream files into a document root;

  3. Copy crossdomain.xml file into a document root (for more information visit crossdomain page);

  4. Copy .htaccess file into a document root (for more information visit htaccess page);

  5. Copy contents of the demo directory into a document root;

  6. Create index.html file in a document root (type absolute URL to a sintel.mpd file):

     <html>
     <head>
     <script type="text/javascript" src="/swfobject/swfobject.js"></script>
     <script type="text/javascript">
         var flashvars = {};
     
         // absolut URL to sintel.mpd file
         flashvars.src = encodeURIComponent("<absolute URL to sintel.mpd file>");
     
         // absolut URL to dashas.swf file
         flashvars.plugin_DashPlugin = encodeURIComponent(location.href + "/production/dashas.swf");
     
         var params = {};
         params.allowfullscreen = "true";
         params.allownetworking = "true";
         params.wmode = "direct";
     
         swfobject.embedSWF("/StrobeMediaPlayback.swf", "placeholder", "640", "360", "10.1", "/swfobject/expressInstall.swf", flashvars, params, {});
     </script>
     </head>
     
     <body>
     <div id="placeholder">
         <p><span>Please install <a href="http://get.adobe.com/flashplayer/">Adobe Flash Player</a></span></p>
     </div>
     </body>
     </html>
    
  7. Go to http://localhost/index.html;


TIP: The flash is very aggressive in caching. If you notice that player doesn't respond to your server side changes, please clean browser's cache (i.e. cached images and files).

Development

At the moment project supports only Gradle 1.11. Please read how to install Gradle 1.11 on Linux.

Build

Prerequisites

Instructions

... do you prefer developing in an IDE? Read how to import project into the IntelliJ IDEA.

Test

Prerequisites

Instructions

  1. Download and extract Flash Player:

  2. Define global variable:

     $ export FLASH_PLAYER_EXE=Flash\ Player\ Debugger.app/Contents/MacOS/Flash\ Player\ Debugger
     
    
  3. Run test suites:

     $ cd <project_workspace>
     $ gradle test