Dash.as is the first video player to run 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.
For more information visit examples page.
- An OSMF extension;
- Basic support for manifests with a list [1];
- Basic support for manifests with a template [1];
- Basic support for manifests with a base URL [1][2];
- Basic support for manifests with a time line;
- Audio-video playback [3];
- Adaptive bitrate streaming;
- Live streaming;
- User interface:
- Play/Pause;
- Seeking;
- Fullscreen mode;
- Duration;
- Loaded bytes indicator;
- Buffering indicator;
[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.
- #2 Player doesn't resume downloading after reconnecting;
Create media input files in different bitrates.
- ffmpeg is installed with libfdk_aac and libx264 library;
-
Download source file:
$ wget http://mirrorblender.top-ix.org/movies/sintel-1024-surround.mp4
-
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
-
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
-
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
-
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
Convert media input files into DASH stream files.
- MP4Box is installed (at least version 0.5.1r5152);
-
Use following command to generate DASH stream:
$ MP4Box -dash 3000 -bs-switching no -segment-name %s_ -url-template -out sintel.mpd avc1-sintel-436p-250k.mp4 avc1-sintel-436p-500k.mp4 avc1-sintel-436p-1000k.mp4 mp4a-sintel-69k.mp4
Finally try dash.as locally.
- apache2 is installed;
-
Create a virtual host for localhost;
-
Copy DASH stream files into a document root;
-
Copy crossdomain.xml file into a document root (for more information visit crossdomain page);
-
Copy .htaccess file into a document root (for more information visit htaccess page);
-
Copy contents of the demo directory into a document root;
-
Create
index.html
file in a document root (type absolute URL to asintel.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>
-
Go to
http://localhost/index.html
;
- gradle is installed;
-
Build debug SWF package:
$ cd <project_workspace> $ gradle clean compile
-
Build production SWF package:
$ cd <project_workspace> $ gradle -Pprofile=production clean compile
... do you prefer developing in an IDE? Read how to import project into the IntelliJ IDEA.