从前后摄像头同时捕捉视频 [英] Capture video simultaneously from both front and rear camera

查看:110
本文介绍了从前后摄像头同时捕捉视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正面临一个难题,我正在开发一款应用程序,可以在iPhone 4上同时从前后摄像头捕获视频而无需越狱,并将其保存为一个AVI格式的视频。我面临两个问题:
1.同时从两个摄像头(前后)捕捉视频。
2.将捕获的视频保存到只有一个AVI格式的文件。

I'm facing a hard problem, I'm developing an app to capture video from both front and rear camera simultaneously on IPhone 4 without jail-break and save it to one video with AVI format. I'm facing 2 problems: 1. Capture videos simultaneously from both camera (front and rear). 2. Save captured videos to only 1 file with AVI format.

我在IPhone SDK中使用多媒体库进行了工作,并知道UIImagePicker类支持我捕获iPhone上的视频,但它只支持一个摄像头设备,通过设置UIImagePicker的cameraDevice属性。似乎UIImagePicker无法帮助我....

I have worked arround with multimedia lib in IPhone SDK and know that UIImagePicker class support me capture video on IPhone, but it only support one camera device by setting cameraDevice property of UIImagePicker . Seem UIImagePicker can't help me more....

我想在屏幕上显示来自两个摄像头的2个捕获视频,一个是背景视频(全屏)和一个前景视频,如PIP效果(电影节目中的画中画视频效果),然后我想将它们(捕获的视频)保存到只有1个视频格式的视频文件,正确的AVI格式。

I want to display 2 captured videos from both camera in screen, one is background video (full screen) and one foreground video, like PIP effect (picture in picture video effect on Television program), then I wanna save them (captured videos) to only 1 video file with video format, properly AVI format.

出于这些目的,我确实搜索了谷歌,并知道FFMPEG似乎支持合并2视频与PIP效果,但我没有看到任何关于它的教程。我之前在FFMPEG上没有任何exp ....

For those purpose, I did search around on google, and know that FFMPEG seem support merge 2 video with PIP effect but I don't see any tutorial about it. I don't have any exp on FFMPEG before....

问题(1)& (2)还在那里。我不知道如何在iPhone上同时捕捉视频,然后将它们合并并保存在1个视频文件中,如PIP效果。

The problem (1) & (2) are still there. I don't know how to capture videos simultaneously on IPhone, then merge and save them in only 1 video file like PIP effect.

任何人都知道我的问题吗?请帮我 !

Anyone have idea about my those problems ? please help me !

推荐答案

我很确定这在公开的API中是不可能的。

I'm fairly sure that this is not possible in the publicly available API's.

你的断言是正确的 UIImagePicker 只允许指定一个摄像机。

You are correct in your assertion that the UIImagePicker only allows for a single camera to be specified.

Facetime,它可以做你想要的PiP,是iPhone的一个低级部分,由Apple精心制作,可能有大量的优化和低级代码来实现这一目标。

编辑:在Nestor的评论之后,我更详细地了解了Factuime的工作原理(我自己没有iPhone)。 Nestor是正确的,它不显示来自两个摄像头的流,而是显示其他手机视频,然后是相机的PIP。

After the comment from Nestor, I had a more detailed lookinto how Factuime works (not having an iPhone myself). Nestor is correct, it doesn't show streams from both cameras, rather the other phones video and then a PIP of your camera.

这篇关于从前后摄像头同时捕捉视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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