我想对 iphone 相机胶卷中的视频执行操作,我需要一个绝对 URI,因为我将在我的应用程序中本地使用 ffmpeg。
是否可以就地对视频进行操作?或者我是否需要将视频复制到 tmp 目录,对其进行操作,然后写回相机胶卷?
最佳答案
我已经阅读了一些文档和教程,并根据该研究进行了回答。
是否可以就地对视频进行操作?
Yes (By copying it to temp dir) and No (to the original location where the video is actually stored)
看看下面的图片和引自 official docs
Using PhotoKit, you can fetch and cache assets for display and playback, edit image and video content or manage collections of assets such as albums, Moments, and Shared Albums.
我们无法直接访问存储图像/视频的位置,而是使用 PHAsset 获取原始数据或表示。并且 Asset 对象是不可变的,所以我们不能直接对其执行操作。我们需要 PHAssetChangeRequest创建、删除、更改照片 Assets 的元数据或编辑照片 Assets 的内容。
我是否需要将视频复制到临时目录,对其进行操作,然后写回相机胶卷?
Yep, that's the way to go.
关于ios - 我可以在相机胶卷上获取视频的绝对 URI 并从我的应用程序中对其进行变异吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60086748/