Http Live Streaming 不适用于 Apache [英] Http Live Streaming not working on Apache
问题描述
我的 Http Live Streaming 设置:Apache 托管 html、m3u8 和 ts 文件
My Http Live Streaming setup: Apache hosts the html, m3u8, and ts files
ts 文件是从 http:devimages.apple.com/iphone/samples/bippop/gear1/fileSequence*.ts 复制过来的.视频编码没有问题(通过实际播放这些文件验证)
The ts files are copied over from http:devimages.apple.com/iphone/samples/bipbop/gear1/fileSequence*.ts. There is nothing wrong with the video encoding (verified by actually playing these files)
m3u8 文件(多比特率和叶级)是从苹果的示例中复制过来的,并且在语法上是正确的,如下所示:
m3u8 files (both the multi-bitrate and leaf-level) are copied over from apple's example and are syntactically correct, as follows:
#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10, no desc
fileSequence0.ts
...
#EXTINF:1, no desc
fileSequence180.ts
#EXT-X-ENDLIST
videoplay.html(如下)无法从我的 apache 服务器流式传输视频
videoplay.html (below) fails to stream the video from my apache server
<video src="bipbop/bipbopall.m3u8" controls autoplay ></video>
但是在修改 videoplay.html(如下)时,视频从 Apple 的网站流就好了
However on modifying videoplay.html (below), the video streams just fine from Apple's website
<video src="http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8" controls autoplay ></video>
我怀疑 MIME 类型设置有问题,因为 Chrome 正在处理 http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8 和 http://localhost/bipbop/bipbopall.m3u8 不同.当 Chrome 尝试播放前者时,它会下载并保存后者.所以我仔细检查了我的 mime 类型设置,它在我的 httpd.conf 中设置如下
I suspected something wrong with mime type settings because Chrome was handling http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8 and http://localhost/bipbop/bipbopall.m3u8 differently. While Chrome tries to play the former, it downloads and saves the latter one. So I double checked my mime type setting, which is set as below in my httpd.conf
AddType application/x-mpegURL .m3u8
AddType video/MP2T .ts
- 我的 MIME 类型设置是否正确?
- 我们如何计算苹果网站宣传的 mime 类型关联?
- 还是我们必须寻找其他地方来解决这个问题?
推荐答案
这可能看起来很奇怪,但我也遇到过类似的问题,经过多次调试后,我发现 .m3u8 索引文件中的空行会导致此类问题.请仔细检查索引文件中的空行.
This might seem strange but I also faced similar problems, and after much debugging I found that empty lines in the .m3u8 index file can cause such issues. Please double check for empty lines in your index file.
这篇关于Http Live Streaming 不适用于 Apache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!