Ios 从保存在parse中的视频创建缩略图

Ios 从保存在parse中的视频创建缩略图,ios,iphone,Ios,Iphone,您好,我已经开始解析和阅读有关对象和文件的文档,以及查询。我已经通过网络,尝试从解析中检索.mov文件,并使用以下方法: - (UIImage *)loadImage:(NSString *)videoPath { // getting the frame of the video for the thumbnail //NSString *videoPath = [[NSBundle mainBundle] pathForResource:image ofType:nil];

您好,我已经开始解析和阅读有关对象和文件的文档,以及查询。我已经通过网络,尝试从解析中检索.mov文件,并使用以下方法:

- (UIImage *)loadImage:(NSString *)videoPath
{
    // getting the frame of the video for the thumbnail
    //NSString *videoPath = [[NSBundle mainBundle] pathForResource:image ofType:nil];

    NSURL *vidURL = [NSURL URLWithString:videoPath];
    AVURLAsset *asset = [[AVURLAsset alloc ] initWithURL:vidURL options:nil];
    AVAssetImageGenerator *generate = [[AVAssetImageGenerator alloc] initWithAsset:asset];
    NSError *err = NULL;
    CMTime time = CMTimeMake(0, MPMovieTimeOptionNearestKeyFrame);
    CGImageRef thumbImg = [generate copyCGImageAtTime:time actualTime:NULL error:&err];


    return [[UIImage alloc] initWithCGImage:thumbImg];
}
为了能够使用该文件制作缩略图像,现在我真的需要一些帮助。我一直在尝试我能想到的一切。我请求你帮帮我。我去了parse.com论坛,没有人回答我的问题,我去了树屋论坛,根本没有答案,好像没人知道或者没人想帮我回答这个问题,请帮忙

自从我被困在这个问题上已经两周了


如果我没有正确地问清楚的问题,请让我知道,因此我将编辑问题

URLWithString:采用URL的字符串表示形式。videoPath返回一个路径,而不是URL,这就是为什么您必须使用:

NSURL *vidURL = [NSURL fileURLWithPath:videoPath];

希望此帮助

我将NSString参数更改为NSURL,这是我在cellForRowAtIndexPath PFFile*缩略图=[object objectForKey:@“VidFIle”]中放置的内容;NSURL*url=[NSURL fileURLWithPath:thumbnail.url];self.thumbnailImageV=(PFImageView*)[带标记的单元格视图:100];self.thumbnailImageV.image=[self-loadImage:url];