Why smil file is not working with RTMP both in wowza and jwplayer?

家住魔仙堡 提交于 2019-12-13 19:52:39

问题


I am using wowza streaming engine and jw player to show the stream and working fine. But i want to control bitrate of a video so that user can see the video without much buffering. So i searched in stackoverflow and found following link.

Bitrate JWplayer

Then i created my myVideo.smil file according to above link. Then i go to wowza to test. It is working in MPEG DASH http://192.168.0.106:1935/vod/smil:myVideo.smil/manifest.mpd and also ADOBE HDS http://192.168.0.106:1935/vod/smil:myVideo.smil/manifest.f4m

but i dont know why it is not working with RTMP

in Test Player I put server=rtmp://192.168.0.106:1935/vod and stream=smil:myVideo.smil after pressing start button i found connectd Current bit rate 0kbps and only black screen.

I also tried this link in jwplayer rtmp://192.168.0.106:1935/vod/smil:myVideo.smil and it is loading but not showing anything. Again i tried the approach of the link

jwplayer("myElement").setup({
    file: "/assets/myVideo.smil",
    image: "/assets/myVideo.jpg",
    height: 360,
    width: 640
});

and it showing "Error loading stream:Manifest not found or invalid" I don't know what i am missing and why not only working with RTMP. Please Help me.

Here is my sample myVideo.smil file code

<smil>
  <head>
    <meta base="rtmp://192.168.0.106:1935/vod/" />
  </head>
  <body>
    <switch>H
      <video src="sample.mp4" height="720" system-bitrate="200000" width="1280" />
      <video src="sample.mp4" height="360" system-bitrate="80000" width="640" />
      <video src="sample.mp4" height="180" system-bitrate="30000" width="320" />
    </switch>
  </body>
</smil>

回答1:


The problem lies in the fact RTMP in itself is completely oblivious to multiple bitrates.

The way you would do this in JWPlayer is using an HTTP link to:

http://192.168.0.106:1935/vod/smil:MyVideo.smil/jwplayer.smil

This will instruct JWPlayer to use the multiple-bitrate smil received from that URL, connect to given RTMP endpoint, play the first stream listed, and switch streams to different bitrate as needed.

Basically the way to construct the URL is to take HLS/DASH/HDS url and replace the last element (say playlist.m3u8 for HLS) with jwplayer.smil.

But please note this only works for SMILs. If you try and access similar url for sample.mp4 (which would be http://192.168.0.106:1935/vod/mp4:sample.mp4/jwplayer.smil in this case) then it won't work and you will most likely get a playback error.



来源:https://stackoverflow.com/questions/32178798/why-smil-file-is-not-working-with-rtmp-both-in-wowza-and-jwplayer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!