iphone - 如何修复 "Error: (-12646:0) Illegal MIME type: text/plain"

标签 iphone ios xcode4 mime-types http-live-streaming

我正在尝试 HTTP 直播。当我验证我的主播放列表时,它给了我上述错误

我首先用

分割了我的视频

sudo /usr/bin/mediafilesegmenter -I -f Desktop/MyVideo Desktop/MyVideo.mp4

仅使用分段音频

sudo /usr/bin/mediafilesegmenter -I -f Desktop/MyAudio -a Desktop/MyVideo.mp4

之后,我使用 variantplaylistcreator 创建了主播放列表,我的最终链接是 http://www.example.com/Apple/final.m3u8,其中包含视频n 音频只有两个流。

当我验证此链接时

mediastreamvalidator validate http://www.example.com/Apple/final.m3u8

它给了我这个结果

Playlist Validation: 

Error: (-12646:0) Illegal MIME type: text/plain

Segments:

    OK

我该如何解决这个错误??有什么帮助吗?

提前谢谢你..!!

最佳答案

您需要修改您的网络服务器配置,以便它提供具有正确 mime 类型的 m3u8 文件。根据this list of playlist formats , m3u 播放列表(m3u8 是 m3u 的 UTF-8 变体)应该具有以下 mime 类型之一:

Mime type:

audio/mpegurl (recommended)

audio/x-mpegurl

this technical note Apple 说应该使用 application/x-mpegurl 所以我认为这是你最好的选择:

Screenshot of Apple Technical Note

假设您正在使用 Apache(很有可能)these instructions should help you configure the server correctly .

关于iphone - 如何修复 "Error: (-12646:0) Illegal MIME type: text/plain",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8516048/

相关文章:

iphone - 将 Interface Builder 中创建的 View 添加到以编程方式创建的 View 中 - 可以吗?

iphone - 如何下载 iAd 代码

ios - Phonegap 中 ios 的蓝牙插件

uitableview - 如何创建纹理背景(图像调色板)颜色,如分组 uitableview 背景颜色?

ios - 如何使用 Swift 在 iOS 中以编程方式进行搜索

iphone - 获取地址簿联系人的组?

ios - 为什么在ios中废弃的内存不被视为泄漏内存

ios - iOS 13 及更高版本中未收到来自 Firebase 的推送通知

xcode - 如何运行/安装xcodebuild?

xcode - 在 Xcode 4 工作区中,如何将build设置和配置级联到子项目