2009-11-10 80 views
0

我有一個簡單的小osx應用程序,只需啓動一個IKPictureTaker,然後將結果圖片保存爲.tiff文件。這一切似乎很好地工作,但每次我拍照我反覆出現此錯誤:從我的IKPictureTaker App獲取奇怪的視頻警告

2009-11-10 12:25:38.890 Take A Picture[855:9c23] *** QTCaptureSession warning: Session received the following error while decompressing video: Error Domain=NSOSStatusErrorDomain Code=-67441 "Operation could not be completed. (OSStatus error -67441.)". Make sure that the formats of all video outputs are properly configured. 

的代碼非常簡單:

- (void)awakeFromNib 
{ 


IKPictureTaker *sharedPictureTaker = [IKPictureTaker pictureTaker]; 

[sharedPictureTaker setValue:[NSNumber numberWithBool:YES] forKey:IKPictureTakerShowEffectsKey]; 

[sharedPictureTaker beginPictureTakerWithDelegate:self didEndSelector:@selector(pictureTakerDidEnd:returnCode:contextInfo:) contextInfo:nil]; 
} 


- (void) pictureTakerDidEnd:(IKPictureTaker *) picker 
      returnCode:(NSInteger) code 
      contextInfo:(void*) contextInfo 
{ 

NSImage *image = [picker outputImage]; 
NSString *folder = @"/Users/Mike/Library/Application Support/file.tiff"; 
folder = [folder stringByExpandingTildeInPath]; 
[[image TIFFRepresentation] writeToFile:@"~/Library/Application Support/file2.tiff" atomically:NO]; 
} 

回答

1

聽起來可能有一些配置問題你的機器。你能在另一個測試它嗎?您的應用中是否還有其他內容?如果您選擇不同類型的圖像文件或僅在捕獲時獲得同樣的結果嗎?

你的字符串在編寫方法中有點混亂,但是除了處理其他處女應用程序之外,代碼對我來說工作正常。

+0

我會嘗試在另一臺機器上測試它,以便能夠訪問它。這是整個應用程序。捕獲時我只會收到這些消息。運行此代碼時,您的調試器控制檯是否打開正確? – Mike2012 2009-11-10 22:54:35

+0

我重新開始並重新執行了所有步驟(沒有一些不必要的步驟,我可能在嘗試首次設置時採取了這些步驟),現在它可以正常工作。感謝您花時間運行我的代碼。 – Mike2012 2009-11-10 23:32:27