cd work
cp DOKOKA/testSource.mp4 ./
ffmpeg -i testSource.mp4 -r 25 -g 25 -codec:v libx264 -codec:a aac -b:v 500k -strict -2 output_500k.mp4 -r 25 -g 25 -codec:v libx264 -codec:a aac -strict -2 -b:v 1000k output_1000k.mp4 -r 25 -g 25 -codec:v libx264 -codec:a aac -strict -2 -b:v 4000k output_4000k.mp4
sudo apt-get install gpac # MP4Boxが入ったパッケージ
MP4Box -dash 1500 -profile live -out test.mpd output_500k.mp4#video:id=video_500k output_500k.mp4#audio:id=audio output_4000k.mp4#video:id=video_4000k output_1000k.mp4#video:id=video_1000k
python -m SimpleHTTPServer 8999
wget https://raw.githubusercontent.com/Dash-Industry-Forum/dash.js/v1.2.0/dash.all.js -O dash.all-1.2.0.js
vi index.html
---
< !doctype html>
<html>
<head>
<script type="text/javascript" src="dash.all-1.2.0.js"></script>
</head>
<body>
<h1>MPEG-DASH sample</h1>
<div>
<video id="videoPlayer" controls="true"></video>
</div>
<script>
(function() {
var url = "http://URL:8999/test.mpd";
var context = new Dash.di.DashContext();
var player = new MediaPlayer(context);
player.startup();
player.attachView(document.querySelector("#videoPlayer"));
player.attachSource(url);
})();
</script>
</body>
</html>
---
python -m SimpleHTTPServer 8999