iOS -视频缩略图的制作
2016-01-25 10:51
281 查看
+(UIImage *)getImage:(NSString *)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; }
相关文章推荐
- iOS开发笔记--iphone开发震动与播放声音Demo
- iOS开发笔记--atomic与nonatomic,assign,copy与retain的定义和区别
- iOS开发笔记--数据持久化的四种方式
- iOS开发笔记--viewWithTag获取subview规则详解
- iOS开发笔记--关于 setBackgroundImage 和 setImage
- DSP/BIOS简介
- iOS-CoreGraphics(CGAffineTransform.h)
- IOS 生产者-消费者模型实现
- iOS状态栏 导航条 tabbar高度
- iOS滑动tableView来改变导航栏的颜色-1
- ios之动态创建多个标签,自动换行
- edgesForExtendedLayout ios7新特性
- iOS解析数据时Error=3840
- iOS之轻松上手block(下)
- 在企业内部分发 iOS 应用程序
- js判断安卓或者ios
- iOS之轻松上手block(上)
- iOS开发之Masonry(六)
- ios tableView那些事 (六) 如何处理tableView上的文字
- ios开发笔记--关于delegate(委托)的使用心得