HDR videos export as solid color from Photo library with certain presets

It seems something is broken with exporting HDR videos from the photo library. We've used the same method to export videos for years now, but all of a sudden HDR videos from devices like the iPhone 12 Pro started exporting with a solid color instead of the actual video content.

We're exporting PHAssets using PHImageManager's requestExportSession(forVideo:options:exportPreset:resultHandler:) method with the preset AVAssetExportPreset960x540.

The code works just fine for non-HDR content. I haven't been able to test on earlier versions of iOS 14, but I believe this was also working prior to 14.2.

After a lot of trial and error, I found that using a different preset works. However, a few other presets are also exporting with a solid color: AVAssetExportPresetLowQuality, and AVAssetExportPresetMediumQuality.

Has anyone else experienced this issue? Any advice other than using a different preset?

I've put together a sample project that demonstrates the issue here: https://github.com/pixelmatrix/iOS14-HDR-Export-Bug

Replies

Sounds like a likely regression. Please report this to Apple using the feedback assistant.
happened to me, was a able "hack around it":

change to:
[[PHImageManager defaultManager] requestAVAssetForVideo:asset options:options resultHandler:^(AVAsset * Nullable avasset, AVAudioMix * Nullable audioMix, NSDictionary * _Nullable info)

then use:
 AVAssetExportSession *exportSession=nil;
      if (avasset!=nil) {
        exportSession=[AVAssetExportSession exportSessionWithAsset:avasset presetName:AVAssetExportPresetMediumQuality];
      }


Thanks for the suggestion Media Engineer. Reported via Feedback Assistant: FB8914573.

@pilosof - thanks for sending this workaround. I will give that a shot.
Has there been any progress on this? I am still seeing solid colors (blue/cyan/turquoise in most cases) when using some presets which are supposed to be compatible according to the class function on AVAssetExportSession: determineCompatibility(ofExportPreset:with:outputFileType:completionHandler:)
@aldukeman - My bug report to Apple has changed status to "Potential fix identified for future OS update". Hopefully we'll see a fix in the next iOS version.
Does anyone have an update on whether or not this is still an issue on 14.3? I have been experiencing this same issue with my app when we upload videos, but I see that in the newest 14.3 patch notes there is a bug fix which reads:

"Some videos would not appear correctly when shared from the Photos app"

I am trying to test it, but I would love to know if anyone has found this update to solve the problem for them.