My goal is to upload original resolution device captured video files to S3 using AWSS3TransferUtility.
User selects a video using UIImagePickerController however, if I pass info[UIImagePickerControllerMEDIAURL] to the transferUtility it always reduces the video to 720p. If I pass the transferutility info[UIImagePickerControllerREFERENCEURL] I get an Error:
The operation couldn’t be completed. (com.amazonaws.AWSS3TransferUtilityErrorDomain error 4.)
Cannot find an explanation of the error code so I am assuming it is a permissions error because I am not accessing the asset via the Photos framework or PHAsset.fetch
REFERNCE URL - assets-library://asset/asset.mov?id=5B99DC8E-B94E-4CBF-AFB8-7F82BC72FEE2&ext=mov
MEDIA URL - file:///private/var/mobile/Containers/Data/Application/76928AD7-F142-4CC9-9708-A58C8CAF8EE5/tmp/trim.82038B6A-222F-4B50-A937-A8C399B02A08.MOV
Now, I have the ReferenceURL, and am trying to get the PHAsset so that I can copy it the Documents Directory and pass the URL of it to TransferUtility from there to get around the AWSS3TransferUtilityErrorDomain error 4.
However, fetchAssets(withALAssetURLs:options:) is now deprecated so I cannot fetch the asset with the ReferenceURL; all the other methods are batch fetching via media type, etc. There is fetchAssets(withLocalIdentifiers:options:) but I am not sure how to get the local identifier of a PHAsset just from the URL.