Dash Mpeg-streaming
Je travaille dans ma thèse sur le streaming en direct. J'ai utilisé ffmpeg, serveur ngix avec le module rtmp et dash.js de Dash industry. Je commence à diffuser sur le serveur par ffmpeg, et jouer en tiret, le joueur a bien fonctionné, mais il y avait quelques problèmes. Le joueur joue seulement si la liste de lecture mpd-dash a toujours le bloc t = 0, ainsi quand le joueur de demande d'utilisateur et le * .mpd mis à jour avec le morceau dehors t = 0 joueur ne courent pas.Module Nginx-rtmp et mpeg tableau de bord (industrie Dash dash.js)
Je télécharge mon fichier * .mpd à Dash Validator et j'obtiens une erreur: "La validation de Schematron échoue - DASH n'est pas valide!". Mais playist est généré par nginx - module rtmp pas moi.
Après avoir cherché un certain forum je suis arrivé des informations que le module nginx-rtmp générer mauvaise liste de lecture du tableau de bord * .MPD Nginx rtmp module -bug, et peut-être que bogue a été corrigé et fusionné pour maîtriser github (i Pensé si Mered - report). Mais j'ai essayé de télécharger le plus nouveau module de nginx et de rtmp, le joueur joue également incorrect.
Si je jouais avec dash.all.js version 2 ans auparavant: la vidéo ne joue que bien (jouer à la fin) si le morceau t = 0 existe dans la liste de lecture * .mpd, ou le joueur ne joue pas (jouer au milieu de streaming) Si je jouais avec dash.all.js version terminée: lecture vidéo et arrêter de jouer bientôt ou en boucle de lecture.
J'ai vraiment besoin d'aide, ma date limite est à venir.
Voici ma config nginx (config principal):
rtmp {
server {
listen 1935;
ping 30s;
notify_method get;
chunk_size 4000;
allow play all;
application myapp {
live on;
dash on;
dash_path /tmp/dash;
hls on;
hls_cleanup on;
hls_sync 100ms;
hls_fragment 2s;
hls_path /tmp/hls;
allow play all;
}
}
}
and some others config:
location /hls {
# Serve HLS fragments
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /tmp;
add_header Cache-Control no-cache;
add_header Access-Control-Allow-Origin *;
}
location /dash.js {
root /usr/share/nginx/html;
}
location /streaminghls {
root /usr/share/nginx/html;
}
location /dash {
# Serve DASH fragments
root /tmp;
add_header Access-Control-Allow-Origin *;
}
and in html player :
<script src="dash-old.all.js"></script>
<script>
function getUrlVars() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
vars[key] = value;
});
return vars;
}
function startVideo() {
var vars = getUrlVars(),
url = "http://192.168.100.107:80/dash/Screen.mpd",
video,
context,
player;
if (vars && vars.hasOwnProperty("url")) {
url = vars.url;
}
video = document.querySelector(".dash-video-player video");
context = new Dash.di.DashContext();
player = new MediaPlayer(context);
player.startup();
player.attachView(video);
player.setAutoPlay(true);
player.attachSource(url);
}
</script>
Hls play excellently but not dash. I tried changing dash config in nginx config and C-source of rtmp-module with recompiling but not thing changed.
My mpd play list :
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2011/XMLSchema-instance" type="dynamic" availabilityStartTime="2015-12-17T03:17:07+07:00" availabilityEndTime="2015-12-17T03:18:23+07:00" minimumUpdatePeriod="PT5S" minBufferTime="PT5S" timeShiftBufferDepth="PT0H0M0.00S" suggestedPresentationDelay="PT10S" profiles="urn:hbbtv:dash:profile:isoff-live:2012,urn:mpeg:dash:profile:isoff-live:2011" xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd">
<Period start="PT0S" id="dash">
<AdaptationSet id="1" segmentAlignment="true" maxWidth="320" maxHeight="240" maxFrameRate="20">
<Representation id="Screen_H264" mimeType="video/mp4" codecs="avc1.64000c" width="320" height="240" frameRate="20" sar="1:1" startWithSAP="1" bandwidth="192000">
<SegmentTemplate presentationTimeOffset="0" timescale="1000" media="Screen-$Time$.m4v" initialization="Screen-init.m4v">
<SegmentTimeline>
<S t="0" d="12500"/>
<S t="12500" d="12500"/>
<S t="25000" d="10550"/>
<S t="35550" d="15700"/>
<S t="51250" d="12500"/>
<S t="63750" d="12500"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>
</AdaptationSet>
<AdaptationSet id="2" segmentAlignment="true">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="1"/>
<Representation id="Screen_AAC" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="22050" startWithSAP="1" bandwidth="62000">
<SegmentTemplate presentationTimeOffset="0" timescale="1000" media="Screen-$Time$.m4a" initialization="Screen-init.m4a">
<SegmentTimeline>
<S t="0" d="12500"/>
<S t="12500" d="12500"/>
<S t="25000" d="10550"/>
<S t="35550" d="15700"/>
<S t="51250" d="12500"/>
<S t="63750" d="12500"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>
</AdaptationSet>
</Period>
</MPD>
I really need help.
Thanks for reading, and am so sorry about my bad english.