我需要在上传之前保存视频
我有一个可以录制视频并上传的应用程序。 从 UIImagePickerView 获取视频后,我使用 ASIHTTPRequest 使用 PUT 方法上传它。
我收到内存警告,有时上传超时。 我想在上传之前我必须保存视频。
我的问题的最佳解决方案是什么?
问候, 乔治
I have an application that has the possibility to record a video and to upload it.
After i get the video from UIImagePickerView i upload it using a PUT method using ASIHTTPRequest.
I get memory warnings and sometimes the upload times out.
I was thinking that i have to save the video before uploading.
What is the best solution for my problem?
Regards,
George
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我不知道您的视频有多大,但我认为 AVFoundation 或 MediaPlayer 都有从视频中获取特定帧的方法。
如果内存不足,您可以将其拆分为帧并循环上传每个帧,或者将视频拆分为 n 秒部分,其中 n 秒是具有良好上传时间和良好性能的子视频内存占用。
我已经在项目中使用了AVAssetImageGenerator,从视频中获取UIImages并上传它们,效果很好。
Well I don't know how big your video is, but I think either AVFoundation or MediaPlayer have methods for getting specific frames out of the video.
If you get out of memory, you can get either split it up to frames and upload each one of them in a loop, or split the video in n-second parts, where n seconds is a sub video that has good uploading time and good memory footprint.
I already have used in a project AVAssetImageGenerator, to get UIImages from a video and upload them, and it worked fine.