zoukankan      html  css  js  c++  java
  • 获取视频的第一帧图片!

    NSDictionary *opts = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:AVURLAssetPreferPreciseD

    urationAndTimingKey];
    AVURLAsset *urlAsset = [AVURLAsset URLAssetWithURL:videoURL options:opts];
    AVAssetImageGenerator *generator = [AVAssetImageGenerator assetImageGeneratorWithAsset:urlAsset];
    generator.appliesPreferredTrackTransform = YES;
    generator.maximumSize = CGSizeMake(imageView.frame.size.width, imageView.frame.size.height);
    NSError *error = nil;
    CGImageRef img = [generator copyCGImageAtTime:CMTimeMake(10, 10) actualTime:NULL error:&error];
    if (error != nil)
    {
        use "img" to ooxx........
    }
  • 相关阅读:
    软件测试
    软件测试
    软件测试
    软件测试
    软件测试
    软件测试
    软件测试
    软件测试
    软件测试
    When:什么时候做集成测试
  • 原文地址:https://www.cnblogs.com/weilaikeji/p/2938997.html
Copyright © 2011-2022 走看看