2008-10-14 171 views
5

我试图通过QTKit创建一个QTVR电影,并且我已经获得了电影中的所有帧。但是,设置必要的属性似乎没有任何影响。例如:设置QTMovie属性

NSNumber *val = [NSNumber numberWithBool:YES]; 
[fMovie setAttribute:val forKey:QTMovieIsInteractiveAttribute]; 

val = [NSNumber numberWithBool:NO]; 
[fMovie setAttribute:val forKey:QTMovieIsLinearAttribute]; 

如果我然后得到这些属性的值,它们分别为NO和YES。这部电影是可编辑的,所以我不明白我在这里做错了什么。我怎样才能确保属性实际上会改变?

回答

1

当我想导出QuickTime影片我做的是类似如下:

NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
    [NSNumber numberWithBool:YES], QTMovieExport, 
    [exportSettings objectForKey: @"subtype"], QTMovieExportType, 
    [exportSettings objectForKey: @"manufacturer"], QTMovieExportManufacturer, 
    [exportSettings objectForKey: @"settings"], QTMovieExportSettings,          
    nil]; 

BOOL didSucceed = [movie writeToFile: tmpFileName withAttributes:dictionary error: &error]; 
0

这些属性记录为东西,你可以读不能写。但是,您可能可以在创建影片时使用initWithAttributes:error:进行设置。