MPMoviePlayerController 收到错误“H264Decoder 错误:此配置文件:77,不受支持。”

发布于 2025-01-04 10:29:03 字数 715 浏览 4 评论 0原文

下面的代码在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

波浪屿的海角声 2025-01-11 10:29:03

配置文件 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.

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文