//给image添加个分类

+(UIImage *)getImage:(NSURL: *)videoURL

{

AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:[NSURL fileURLWithPath:videoURL] options:nil];

AVAssetImageGenerator *gen = [[AVAssetImageGenerator alloc] initWithAsset:asset];

gen.appliesPreferredTrackTransform = YES;

CMTime time = CMTimeMakeWithSeconds(0.0, 600);

NSError *error = nil;

CMTime actualTime;

CGImageRef image = [gen copyCGImageAtTime:time actualTime:&actualTime error:&error];

UIImage *thumb = [[UIImage alloc] initWithCGImage:image];

CGImageRelease(image);

return thumb;

}

最新文章

  1. html基础起航
  2. .Net 中的反射(序章) - Part.1
  3. 数据库imp导表dmp的方法
  4. tcp选项TCP_DEFER_ACCEPT
  5. luogu[1140]相似基因
  6. September 24th 2016 Week 39th Saturday
  7. PHP抓取网络数据的6种常见方法
  8. bzoj 1500: [NOI2005]维修数列 splay
  9. 阿里巴巴开源项目:分布式数据库同步系统otter(解决中美异地机房) - agapple - ITeye技术网站
  10. Jsensation | 氪加
  11. Perception(1.2)
  12. iOS网络编程笔记——XML文档解析
  13. 《SpringMVC从入门到放肆》五、SpringMVC配置式开发(处理器适配器)
  14. springMVC下载中文文件名乱码【原】
  15. 使用chttpfile的一个错误
  16. Confluence 6 通过 SSL 或 HTTPS 运行 - 修改你 Confluence 的 server.xml 文件
  17. Linq的执行效率及优化
  18. InfluxDB1.2.4部署(centos6.8)
  19. 关于Tomcat配置虚拟路径保存、访问图片
  20. 解决C3P0在Linux下Failed to get local InetAddress for VMID问题

热门文章

  1. YTU 2455: Pefect 数字
  2. 织梦DEDEcms首页调用文档整篇内容
  3. contents属性
  4. 安装程序工具 (Installutil.exe)22
  5. codevs1258关路灯
  6. 一些好用的Linux命令组合
  7. Mac系统下源码编译安装MySQL 5.7.17
  8. C#(KeyChar和KeyCord值,KeyDown/KeyPress事件区别)
  9. web安全之XSS攻击原理及防范
  10. 基于事件驱动机制,在Service Mesh中进行消息传递的探讨