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.
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.