问题描述
我正在使用wowza流引擎和jw播放器来显示流并正常工作.但是我想控制视频的比特率,以便用户可以在没有太多缓冲的情况下观看视频.因此,我在stackoverflow中进行了搜索,并找到了以下链接.
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.
然后我根据上面的链接创建了myVideo.smil文件.然后,我去wowza进行测试.它正在MPEG DASH中工作 http://192.168.0.106:1935/vod/smil:myVideo. smil/manifest.mpd 还有ADOBE HDS http://192.168.0.106:1935/vod/smil:myVideo. smil/manifest.f4m
Then i created my myVideo.smil file according to above link. Then i go to wowza to test. It is working in MPEG DASHhttp://192.168.0.106:1935/vod/smil:myVideo.smil/manifest.mpdand also ADOBE HDShttp://192.168.0.106:1935/vod/smil:myVideo.smil/manifest.f4m
但是我不知道为什么它不能与RTMP一起使用
but i dont know why it is not working with RTMP
在我放入的测试播放器中服务器= rtmp://192.168.0.106:1935/vod和流= smil:myVideo.smil按开始按钮后,我发现连接的当前比特率为0kbps,只有黑屏.
in Test Player I putserver=rtmp://192.168.0.106:1935/vod and stream=smil:myVideo.smilafter pressing start button i found connectd Current bit rate 0kbps and only black screen.
我也在jwplayer中尝试了此链接rtmp://192.168.0.106:1935/vod/smil:myVideo.smil它正在加载,但未显示任何内容.我再次尝试了链接的方法
I also tried this link in jwplayerrtmp://192.168.0.106:1935/vod/smil:myVideo.smiland 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
});
并显示"错误加载流:找不到清单或无效"我不知道我缺少什么,为什么不只使用RTMP.请帮助我.
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.
这是我的示例myVideo.smil文件代码
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>
推荐答案
问题在于RTMP本身完全不考虑多种比特率.
The problem lies in the fact RTMP in itself is completely oblivious to multiple bitrates.
在JWPlayer中执行此操作的方式是使用HTTP链接:
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
这将指示JWPlayer使用从该URL接收的多比特率smil,连接到给定的RTMP端点,播放列出的第一个流,并根据需要将流切换到不同的比特率.
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.
基本上,构造URL的方法是采用HLS/DASH/HDS url,并用jwplayer.smil
替换最后一个元素(例如对于HLS为playlist.m3u8
).
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
.
但是请注意,这仅适用于SMIL.如果您尝试访问sample.mp4
的类似网址(则为 http: //192.168.0.106:1935/vod/mp4:sample.mp4/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.
这篇关于为什么smil文件在wowza和jwplayer中都不能与RTMP一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!