使用AVFoundation的方形视频 [英] Square video using AVFoundation

查看:116
本文介绍了使用AVFoundation的方形视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照给定的教程创建了一个自定义方形视频录制相机。 http://www.netwalk.be/article/record-square-video- ios

I followed the given tutorial to create a custom square video recording camera. http://www.netwalk.be/article/record-square-video-ios

我可以从中导出一个方形视频,但是当我尝试使用url播放新导出的文件时,它不会播放。

I am able to export a square video from this, but when i try to play the newly exported file using the url it does not play.

对于原始网址,我试过工作正常并且播放正常。

For the original url ,i tried was working fine and playing properly.

我打开了文件目录电话,发现视频被裁剪,文件被创建,但在quicktimeplayer上播放视频,它看起来很慢,似乎逐帧播放,即太慢。 (不知道这是否与玩家有关。)

I opened the documents directory of the phone and found that the video was getting cropped and a file was created but playing the video on quicktimeplayer it was appearing very slow and seemed to play in frame by frame manner i.e. too slow. (Don't know whether it was an issue with the player).

这是项目的github链接。请看看并纠正我。

Here is a github link for the project. Kindly have a look and correct me.

https ://github.com/ankit-betterbutter/CustomCamera

ViewController 是相机视图
VideoEditorViewController 是录制后播放视频的视图。

ViewController is the camera view VideoEditorViewController is the view for playing the videos after recording.

如果您需要更多详细信息,请告诉我。

Also tell me if you need any more details.

我还经历了许多其他主题,展示了如何录制方形视频,但却无法掌握它们。如果你已经实现了类似的东西,那么你可以给我一个演示真的很有帮助。

I also went through many other topics showing how to record square video but was not able to grasp them. It would be really helpful if you can provide me a demo if you have implemented something similar.

这将是一个很好的帮助伙伴。

It will be a great help mates.

谢谢。

推荐答案

我已经用代码更新了github存储库。

I have updated the github repository with the code.

这些是我纠正的错误:


  • 我在创建文档目录的URL时出错了因此我无法使用该视频。

  • 我没有正确创建videoComposition。创建CMTimeRange时出现问题。

请访问存储库并自行检查。
如果代码对你有帮助,也可以提供支持。
谢谢!!

Please visit the repository and check for yourself. Also upvote if the code helped you in anyway. Thanks!!


回购链接 - https://github.com/ankit-betterbutter/CustomCamera

这篇关于使用AVFoundation的方形视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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