2016-08-09 9 views
2

Ich habe j2ee Web-Anwendung erstellen, in dem ich versuche, dynamische SMIL-Datei von Wowza zu erstellen.Wowza: Video konnte nicht abgespielt werden, wenn dynamische smil verwendet

Unten ist mein Code

<!doctype html> 
<html> 
<head> 
<meta charset="utf-8"> 
<title>ABR</title> 
<link href="http://vjs.zencdn.net/5.10.7/video-js.css" rel="stylesheet"> 
<script src="http://vjs.zencdn.net/5.10.7/video.js"></script> 
<script src="hls.min.js"></script> 
<script src="vjs-hls.min.js"></script> 
</head> 
<body> 
    <video id="video" class="video-js vjs-default-skin" width="640" height="360" autoplay controls> 
     <!-- <source src="http://192.168.7.10:1935/vod/smil:bigbuckbunny.smil/playlist.m3u8" type="application/x-mpegURL"/> working fine if i use this url--> 
     <source src="http://192.168.7.10:1935/vod/amlst:bigbuckbunny/playlist.m3u8" type="application/x-mpegURL"/> <!-- Not working if i use this url --> 
    </video> 

    <script> 
     var player = videojs('video'); 
     player.qualityPickerPlugin(); 
    </script> 
</body> 
</html> 

Java-Datei

package com.jagir.wowza.smil; 
import com.wowza.wms.application.IApplicationInstance; 
import com.wowza.wms.medialist.MediaList; 
import com.wowza.wms.medialist.MediaListRendition; 
import com.wowza.wms.medialist.MediaListSegment; 
import com.wowza.wms.module.ModuleBase; 
import com.wowza.wms.stream.IMediaListProvider; 
import com.wowza.wms.stream.IMediaListReader; 
import com.wowza.wms.stream.IMediaStream; 

public class ModuleAMLSTTest extends ModuleBase 
{ 
class MyMediaListProvider implements IMediaListProvider 
{ 
public MediaList resolveMediaList(IMediaListReader mediaListReader, IMediaStream stream, String streamName) 
{ 
MediaList mediaList = new MediaList(); 

MediaListSegment segment = new MediaListSegment(); 
mediaList.addSegment(segment); 

MediaListRendition rendition1 = new MediaListRendition(); 
segment.addRendition(rendition1); 

rendition1.setName("mp4:"+streamName+"_450.mp4"); 
rendition1.setBitrateAudio(44100); 
rendition1.setBitrateVideo(45000); 
rendition1.setWidth(424); 
rendition1.setHeight(240); 
rendition1.setAudioCodecId("mp4a.40.2"); 
rendition1.setVideoCodecId("avc1.66.12"); 

MediaListRendition rendition2 = new MediaListRendition(); 
segment.addRendition(rendition2); 

rendition2.setName("mp4:"+streamName+"_750.mp4"); 
rendition2.setBitrateAudio(44100); 
rendition2.setBitrateVideo(750000); 
rendition2.setWidth(640); 
rendition2.setHeight(480); 
rendition2.setAudioCodecId("mp4a.40.2"); 
rendition2.setVideoCodecId("avc1.77.31"); 

MediaListRendition rendition3 = new MediaListRendition(); 
segment.addRendition(rendition3); 

rendition3.setName("mp4:"+streamName+"_1100.mp4"); 
rendition3.setBitrateAudio(44100); 
rendition3.setBitrateVideo(1100000); 
rendition3.setWidth(1272); 
rendition3.setHeight(720); 
rendition3.setAudioCodecId("mp4a.40.2"); 
rendition3.setVideoCodecId("avc1.77.31"); 

MediaListRendition rendition4 = new MediaListRendition(); 
segment.addRendition(rendition4); 

rendition4.setName("mp4:"+streamName+"_1500.mp4"); 
rendition4.setBitrateAudio(44100); 
rendition4.setBitrateVideo(1100000); 
rendition4.setWidth(1272); 
rendition4.setHeight(720); 
rendition4.setAudioCodecId("mp4a.40.2"); 
rendition4.setVideoCodecId("avc1.77.31"); 

System.out.println("::::::::::::::::::::::"+streamName); 

return mediaList; 
} 
} 

public void onAppStart(IApplicationInstance appInstance) 
{ 
appInstance.setMediaListProvider(new MyMediaListProvider()); 
} 
} 

Folgende Dateien sind in [install_dir]/content/Ordner

  • bigbuckbunny_450.mp4, bigbuckbunny_750.mp4, bigbuckbunny_1100 .mp4, bigbuckbunny_1500.mp4

Dateien werden im Inhaltsordner gespeichert.

Ich habe auch

<Module> 
<Name>ModuleAMLSTTest</Name> 
<Description>ModuleAMLSTTest</Description> 
<Class>com.jagir.wowza.smil.ModuleAMLSTTest</Class> 
</Module> 

zu C: \ Program Files (x86) \ Wowza Media Systems \ Wowza Streaming-Engine 4.5.0 \ conf \ vod \ Application.xml

Aber wenn i dieser Code ausführen es folgende Meldung in Spielern

gibt "Keine spielbare Ressource gefunden"

Warum werden Videos nicht abgespielt?

+0

Welche Wiedergabe-URL verwenden Sie? Welcher Spieler? –

Antwort

2

Ich habe keine JAR-Datei in Wowza Lib-Ordner, die das Problem verursacht. Nachdem ich die JAR-Datei meiner Anwendung erstellt und in den lib-Ordner gestellt habe, funktioniert sie einwandfrei.

Verwandte Themen