I am currently working with AVAssetWriterInput with interlaced source.
I want to know the proper procedure to preserve 'fiel' format description extension through AVAssetWriterInput compression operation.
Do you anyone have an answer on this?
>>Technical Note TN2162
>>Uncompressed Y´CbCr Video in QuickTime Files
>>The 'fiel' ImageDescription Extension: Field/Frame Information
//
What I have tried is following:
First decode into sample buffer with Field/Frame information
- Decode DV-NTSC source and get current FieldCount/Detail of source data
- Create a kCVPixelFormatType_422YpCbCr8 CVImageBuffer from source
- CMSetAttachments() kCVImageBufferFieldCountKey/kCVImageBufferFieldDetailKey with FieldCount=2/FieldDetail=14 to imageBuffer, same as DV-NTSC source
- CMVideoFormatDescriptionCreateForImageBuffer()
- CMSampleBufferCreateForImageBuffer()
- Now decompressed samplebuffer has kCMFormatDescriptionExtension_FieldXXX same as source
Second encode using ProRes422
- Next I create AVAssetWriterInput to transcode from _422YpCbCr8 into AVVideoCodecAppleProRes422
- Now AVAssetWriter can produce ProRes422 mov file, but it does not contain the format description extension 'fiel'.
- ProRes422 Encoder does preserve 'colr', 'pasp', 'clap' same as source, but no 'fiel' is there.
I have also tried to serve format description with kCMFormatDescriptionExtension_FieldXXX with initWithMediaType:outputSettings:sourceFormatHint:
but no success.
//