Why smil file is not working with RTMP both in wow

2019-08-13 01:29发布

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条回答
做自己的国王
2楼-- · 2019-08-13 02:05

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.

查看更多
登录 后发表回答