【发布时间】:2023-04-05 03:04:01
【问题描述】:
我需要创建一个应用程序,我必须在其中将视频/mp4 文件分解为图像帧。请提供任何解决方案,从 iOS 应用程序中的视频文件创建不同的图像帧。
【问题讨论】:
-
有很多可用的解决方案尝试搜索看到这个stackoverflow.com/questions/4199879/…
我需要创建一个应用程序,我必须在其中将视频/mp4 文件分解为图像帧。请提供任何解决方案,从 iOS 应用程序中的视频文件创建不同的图像帧。
【问题讨论】:
MPMoviePlayerController *movie = [[MPMoviePlayerController alloc]initWithContentURL:[NSURL URLWithString:@"yourvideofilename.mp4"]];//replace your video file name
UIImage *singleFrameImage = [movie thumbnailImageAtTime:10 timeOption:MPMovieTimeOptionExact];
试试上面这几行代码,希望你得到结果
【讨论】: