我搜索得足够多,但无法理解如何使用nginx_vod_module在nginx中配置mpeg-dash vod。
启用破折号的http服务器块内的配置是
location /voddash {
vod dash;
vod_mode local;
root /usr/share/nginx/html;
gzip on;
gzip_types application/dash+xml mpd;
add_header Access-Control-Allow-Headers "origin,range,accept-encoding,referer";
add_header Access-Control-Expose-Headers "Server,range,Content-Length,Content-Range";
add_header Access-Control-Allow-Methods "GET, HEAD, OPTIONS";
add_header Access-Control-Allow-Origin "*";
expires 100d;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
}
请求网址为http://localhost/voddash/Input.mp4/manifest.mpd。 我只在输入位置放置了Input.mp4。我如何流动破折号内容。还有什么像nedx中预先制作的清单和块的流式传输为mpeg破折号?
答案 0 :(得分:1)
对于VoD,使用ffmpeg将内容编码为MPEG-DASH / HLS可能要简单有效,如here所示,或者使用bitcodin或zencoder等服务。 / p>
使用此解决方案,您可以将内容编码为多种不同的分辨率和比特率,从而为您的客户提供更好的流媒体体验。对于基于HTTP的流式传输,如MPEG-DASH和HLS,服务器端不需要逻辑。您只需将段和索引(MPD或M3U8)放在普通的HTTP服务器(如nginx或其他服务器)上即可。
答案 1 :(得分:0)
我的服务器上有相同的配置,并使用以下html + js代码播放动态生成的manifest.mpd文件:
<!doctype html>
<html>
<head>
<title>Dash.js Rocks</title>
<style>
video {
width: 640px;
height: 360px;
}
</style>
</head>
<body>
<div>
<video id="videoPlayer" controls></video>
</div>
<script src="http://dashif.org/reference/players/javascript/nightly/dash.js/dist/dash.all.min.js"></script>
<script>
(function(){
var url = "http://localhost/voddash/Input.mp4/manifest.mpd";
var player = dashjs.MediaPlayer().create();
player.initialize(document.querySelector("#videoPlayer"), url, true);
})();
</script>
</body>
</html>