का उपयोग कर वीडियो का पहला फ्रेम मैं AVFoundation में कक्षाओं का उपयोग करके वीडियो का पहला फ्रेम प्राप्त करने का प्रयास कर रहा हूं। लेकिन ऐसा लगता है कि यह बिल्कुल एक छवि नहीं मिल रहा है।AVFoundation
मेरे कोड वर्तमान में, इस
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];
वीडियो पथ का मूल्य /var/mobile/Applications/02F42CBF-D8BD-4155-85F2-8CF1E55B5023/Documents/videos/1334300431637030.mp4
जो निश्चित रूप से एक वीडियो है है की तरह लग रहा है क्योंकि मैं MPMoviePlayerViewController
के साथ खेल सकते हैं। मुझे यकीन नहीं है कि मैं क्या गलत कर रहा हूं लेकिन कोई सुझाव उपयोगी होगा।
धन्यवाद।