MPMoviePlayerController 收到错误“H264Decoder 错误:此配置文件:77,不受支持。”
下面的代码在 iphone 3g ios 4.2.1 上运行时会导致日志中显示错误 (仅当videoLink是MOV和M4v视频文件的url时。但如果是MP4和3PG,则可以正常工作)
代码
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:videoLink];
player.shouldAutoplay = NO;
[player stop];
UIImage *image = [player thumbnailImageAtTime:timeAt timeOption:MPMovieTimeOptionNearestKeyFrame];
NSData *imgData = [[NSData alloc] initWithData:UIImageJPEGRepresentation(image, 1)];
日志
mediaserverd[25]: H264Decoder ERROR: This profile: 77, is not supported.
mediaserverd[25]: H264VideoDecoder_Finalize:: delete last channel [ 0].
原因是什么? 先感谢您。
The code below while running on iphone 3g ios 4.2.1 causes an error shown in the log
(only when videoLink is the url to MOV and M4v video file. But if it's MP4 and 3PG, it works fine)
code
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:videoLink];
player.shouldAutoplay = NO;
[player stop];
UIImage *image = [player thumbnailImageAtTime:timeAt timeOption:MPMovieTimeOptionNearestKeyFrame];
NSData *imgData = [[NSData alloc] initWithData:UIImageJPEGRepresentation(image, 1)];
log
mediaserverd[25]: H264Decoder ERROR: This profile: 77, is not supported.
mediaserverd[25]: H264VideoDecoder_Finalize:: delete last channel [ 0].
What is the reason?
Thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
配置文件 77 也称为主配置文件。
iOS4.2.1(及更低版本)上的 iPhone 3G 不支持Main Profile,仅支持Baseline Profile。然而,这与包装容器(文件)格式无关。只要支持实际的编解码器,所使用的文件格式是次要的。
长话短说,您尝试播放的视频与设备不兼容,您需要使用 H264 的基线配置文件重新编码它们。
下面是 Apple 制作的兼容性与编码矩阵。尽管其标题为“HTTP 流编码建议”,但它仍然适用于非流(渐进式下载)和本地播放。
Profile 77 is also known as Main Profile.
The iPhone 3G on iOS4.2.1 (and below) does not support the Main Profile but only the Baseline Profile. This however has nothing to do with the wrapping container-(file)-format. The file-format used is secondary as long as the actual codec is supported.
Long story short, the videos you are trying to play are not compatible with the device and you will need to reencode them using the Baseline Profile of H264.
Below is a compatibility vs. encoding matrix done by Apple. Even though this is entitled HTTP Streaming Encode Recommendations, it still also applies for non-streaming (progressive download) and local playback.