When I call requestAVAssetForVideo to retrieve a video for upload, the system appends a string of unknown characters to the returned path. like this: /var/mobile/Media/DCIM/101APPLE/IMG_1034.MOV#YnBsaXN0MDDRAQJfEBtSZxxxx1vZGUQAAgLKQAAAAAAAAEBAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAr
ps: I encountered a similar issue before when retrieving spatial videos on systems below iOS 18.
Hi ijklx!
AVAssets provided by PHImageManager are generally meant for playback purposes. If you'd like to obtain a file URL for a video, there are some better options.
One is PHAssetResourceManager
, which is the API specifically for retrieving files associated with assets.
Another option is PHImageManager.requestExportSession(forVideo:options:exportPreset:resultHandler:)
. You can configure the export session to export the video to a specific file URL in the format you prefer.