IOS How to get frame from movie by cmtime

/* get frame from movie by cmtime  */
+ (UIImage*) getFrameFromMovieByCMTime:(NSString*)videoPath ctTime:(CMTime) ctTime {
    AVURLAsset* asset = [AVURLAsset URLAssetWithURL:[NSURL fileURLWithPath:videoPath] options:nil];
    AVAssetImageGenerator* imageGenerator = [AVAssetImageGenerator assetImageGeneratorWithAsset:asset];
    UIImage* image = [UIImage imageWithCGImage:[imageGenerator copyCGImageAtTime:ctTime actualTime:nil error:nil]];
    return image;
}

Comments

Popular posts from this blog

Java : Variables Declaring

Install DNF in RHEL/CentOS 7

SQL Self JOIN