AVFoundationのクラスを使用してビデオの最初のフレームを取得しようとしています。しかし、それはまったくイメージを得ていないようです。私はMPMoviePlayerViewController
とそれを再生することができますので、AVFoundationを使用したビデオの最初のフレーム
は私のコードは、現在、ビデオパスの値は間違いなくビデオです/var/mobile/Applications/02F42CBF-D8BD-4155-85F2-8CF1E55B5023/Documents/videos/1334300431637030.mp4
あるこの
AVURLAsset* asset = [AVURLAsset URLAssetWithURL:[NSURL URLWithString:videoPath] options:nil];
AVAssetImageGenerator* imageGenerator = [AVAssetImageGenerator assetImageGeneratorWithAsset:asset];
UIImage* image = [UIImage imageWithCGImage:[imageGenerator copyCGImageAtTime:CMTimeMake(0, 1) actualTime:nil error:nil]];
[videoFrame setImage:image];
のように見えます。私は何が間違っているのか分かりませんが、どんな提案も役に立ちます。
ありがとうございました。