ユーザーが選択したビデオ ファイルがインターレース/プログレッシブかどうかを確認し、それに応じて何らかの操作を実行しようとしています。
抽出した cmsamplebuffer が最初に上部フィールドまたは下部フィールドとして定義されているかどうかを確認しようとしましたが、これはすべての入力に対して null を返します。
NSMutableDictionary *pixBuffAttributes = [[NSMutableDictionary alloc] init];
[pixBuffAttributes setObject:
[NSNumber numberWithInt:kCVPixelFormatType_422YpCbCr8]
forKey:(NSString*)kCVPixelBufferPixelFormatTypeKey];
myAsset = [[AVURLAsset alloc] initWithURL:urlpath options:pixBuffAttributes];
myAssetReader = [[AVAssetReader alloc] initWithAsset:myAsset error:nil];
myAssetOutput = [[AVAssetReaderTrackOutput alloc]initWithTrack:
[[myAsset tracksWithMediaType:AVMediaTypeVideo]
objectAtIndex: 0]
outputSettings:pixBuffAttributes];
[myAssetReader addOutput:myAssetOutput];
[myAssetReader startReading];
CMSampleBufferRef ref = [myAssetOutput copyNextSampleBuffer];
if(CVBufferGetAttachments(ref, kCVImageBufferFieldDetailKey, nil) == nil)
{
//always the case
}
else
{
//never happens
}
入力ファイルのインターレースに関係なく、上記は常に nil を返します。私はおそらくこれを完全に間違った方法でテストしようとしているので、どんな助けも大歓迎です!