iOS-倒转影片档案(.mov) [英] iOS - Reversing video file (.mov)
问题描述
要求:
听起来有点不同,但这是我想要实现的目标.我想反向制作电影(.mov)文件.就像我们倒带电影文件一样.我还希望保持与视频包含的帧速率相同.
It sounds like litte different but this is what I want to achieve. I want to make movie (.mov) file in reverse. Just like how we rewind the movie file. I also want maintain same frame rate as my video is containing.
注意:我不只是想以相反的顺序播放视频文件.我想以相反的顺序生成新的电影文件.
NOTE: I do not just want to play video file in reverse order. I want to generate new movie file playing in reverse order.
我的探索:
我想到了执行以下操作的步骤.
I thought of below steps to perform to do the same.
- 使用
AVAssetExportSession
以特定的帧频制作视频文件块
- 使用
AVMutableComposition
和AVAssetExportSession
将所有这些视频块合并到单个电影文件中. - 还在合并过程中将每个文件的音频合并到新的视频文件中.
- Make chunks of video files with specific frame rate using
AVAssetExportSession
- Merge all these video chunks into single movie file using
AVMutableComposition
andAVAssetExportSession
. - Also merge audio of each file into new video file during the merge process.
使用上述步骤,我可以反过来获得最终的视频文件,但是我的担忧低于.
Using above steps , I am able to achieve resulting video file in reverse but I am having below concerns.
- 如果视频持续时间较长,则会花费大量时间.
- 完成此过程还会消耗大量的CPU周期和内存.
有人有其他优化方法来实现这一目标吗?任何建议将不胜感激.
Does anybody is having any other optimized way to achieve this? Any suggestion will be appreciated.
推荐答案
这是我的解决方案,也许可以为您提供帮助. https://github.com/KayWong/VideoReverse
Here is my solution , maybe it can help you. https://github.com/KayWong/VideoReverse
这篇关于iOS-倒转影片档案(.mov)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!