FYI we got a half hour "office hours" appointment and after some chatter and trial and error,
this method seemed to do the trick at extracting images from HDR / Dolby vids with
better color. We don't know if it is the full answer yet, but it is definitely better.
// prior to here, set up the AVAsset * asset
// code is a bit of archaic ObjC syntax but it works
NSArray* video_tracks = [asset tracksWithMediaType:AVMediaTypeVideo];
AVAssetTrack* video_track = [video_tracks firstObject];
NSMutableDictionary* dictionary = [[NSMutableDictionary alloc] init];
// kCVPixelFormatType_32BGRA (pixel format we originally used)
// 420YpCbCr8BiPlanarFullRange (new pixel format that seems to work)
// need to change the pixel format to this new one here, and also set the video color prop key below (which is 3 items in a dictionary)
[dictionary setObject:[NSNumber numberWithInt:kCVPixelFormatType_420YpCbCr8BiPlanarFullRange
] forKey:(NSString*)kCVPixelBufferPixelFormatTypeKey];
dictionary[AVVideoColorPropertiesKey] =
@{AVVideoColorPrimariesKey:
AVVideoColorPrimaries_ITU_R_709_2,
AVVideoTransferFunctionKey:
AVVideoTransferFunction_ITU_R_709_2,
AVVideoYCbCrMatrixKey:
AVVideoYCbCrMatrix_ITU_R_709_2};
AVAssetReaderTrackOutput* asset_reader_output = [[AVAssetReaderTrackOutput alloc] initWithTrack:video_track outputSettings:dictionary];
// then proceed to normally walk thru frames of the video