HTTP实时流不工作在Apache [英] Http Live Streaming not working on Apache
问题描述
我的HTTP实时流设置:阿帕奇承载HTML,M3U8,和TS文件
My Http Live Streaming setup: Apache hosts the html, m3u8, and ts files
在 TS 文件是从http复制过来:devimages.apple.com/iphone/samples/bipbop/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(如下图),视频流从苹果的网站就好了。
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类型设置,因为铬是处理的http:// devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8 和的http://本地主机/ 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实时流不工作在Apache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!