iOS-倒转影片档案(.mov) [英] iOS - Reversing video file (.mov)

查看:108
本文介绍了iOS-倒转影片档案(.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.

  1. 使用AVAssetExportSession
  2. 以特定的帧频制作视频文件块
  3. 使用AVMutableCompositionAVAssetExportSession将所有这些视频块合并到单个电影文件中.
  4. 还在合并过程中将每个文件的音频合并到新的视频文件中.
  1. Make chunks of video files with specific frame rate using AVAssetExportSession
  2. Merge all these video chunks into single movie file using AVMutableComposition and AVAssetExportSession.
  3. 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.

  1. 如果视频持续时间较长,则会花费大量时间.
  2. 完成此过程还会消耗大量的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆