【问题标题】:Split videos to frames/images将视频拆分为帧/图像
【发布时间】:2012-08-31 05:12:19
【问题描述】:

我需要将 5 秒的视频从我的 iphone 拆分为图像/帧。

是否可以使用目标 C。有任何可用的库吗?

帮助非常明显。

谢谢,

【问题讨论】:

    标签: iphone objective-c


    【解决方案1】:

    您可以通过多种方式从视频中获取图像。其中一些是:-

    NSURL *videoURL = [NSURL fileURLWithPath:url];
    
    MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];
    
    UIImage *thumbnail = [player thumbnailImageAtTime:1.0 timeOption:MPMovieTimeOptionNearestKeyFrame];
    
    //Player autoplays audio on init
    [player stop];
    [player release];
    

    您也可以查看以下链接:-

    Is there any way other than thumbnail method to take a screenshot of an video in Iphone?

    How to take a screenshot from an video playing through MPMediaPlayerController in iPhone?

    它可以帮助你:)

    谢谢:)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-05-05
      • 2020-06-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-07
      • 2016-11-14
      • 1970-01-01
      相关资源
      最近更新 更多