After some further investigation, it turns out that the HEVC video gets transcoded into MPEG-4, even though we've configured our PHPickerViewController
as follows:
var configuration = PHPickerConfiguration()
configuration.selectionLimit = 0
configuration.preferredAssetRepresentationMode = .current
return PHPickerViewController(configuration: configuration)
We're loading the file using itemProvider.loadFileRepresentation(forTypeIdentifier: "public.movie")
, which I believe should be correct.
A few interesting findings:
- If I Airdrop the file to my Mac, it remains being HEVC and keeps the correct size
- If I load that file into the Xcode Simulator and add it to our app running in the Simulator, transcoding is not taking place
The latter is especially interesting: What is the difference between the file on the device vs. the file in the Simulator after airdropping? Why does transcoding take place on device and not in the Simulator?
I'd almost say there's some kind of device setting or iCloud influencing the result, but at this point, I've got no clue. Looking forward to get your thoughts!