ios - 我可以在相机胶卷上获取视频的绝对 URI 并从我的应用程序中对其进行变异吗?

标签 ios swift image video camera-roll

我想对 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

enter image description here

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/

相关文章:

ios - swift |初始化新应用

swift - 每个角都有不同的 CornerRadius 到 Border

algorithm - 使用 3 种技术使用 MATLAB 进行数字图像处理

iOS - Interface Builder - 将元素作为 subview 添加到 UIView

html - 网站无法在移动设备上正确显示

ios - Realm数据库在IOS应用中的难点

Haskell 的图像绘图库?

c++ - 你如何摆脱在 opencv c++ 中裁剪图像后留下的空白间隙?

iphone - 将 iPhone 应用程序转换为通用应用程序

ios - 从相机/照片库上传 Ionic 应用程序图像