Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/102.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何在AVPlayer中显示实时摄像机馈送?_Ios_Objective C_Camera_Avplayer - Fatal编程技术网

Ios 如何在AVPlayer中显示实时摄像机馈送?

Ios 如何在AVPlayer中显示实时摄像机馈送?,ios,objective-c,camera,avplayer,Ios,Objective C,Camera,Avplayer,有没有办法将手机摄像头的实时视频流直接传输到AVPlayer?它似乎只接受NSURL参数。如何访问摄像头馈送并将其导入视频播放器 下面是一个例子: NSString *videoPath = [[NSBundle mainBundle] pathForResource:@"congo" ofType:@"mp4"]; NSURL *videoURL = [[NSURL alloc] initFileURLWithPath:videoPath]; _player = [AVPlayer playe

有没有办法将手机摄像头的实时视频流直接传输到AVPlayer?它似乎只接受NSURL参数。如何访问摄像头馈送并将其导入视频播放器

下面是一个例子:

NSString *videoPath = [[NSBundle mainBundle] pathForResource:@"congo" ofType:@"mp4"];
NSURL *videoURL = [[NSURL alloc] initFileURLWithPath:videoPath];
_player = [AVPlayer playerWithURL:videoURL];

这很接近,但我不想播放电影文件。

为什么要使用
AVPlayer
来显示实时视频源?我使用的是谷歌VR示例代码。我应该用什么来代替呢?我不能与谷歌VR示例代码对话,但通常你会使用
AVCaptureVideoPreviewLayer
AVCaptureSession
来显示一个实时视频源。好的,太好了!我有一个现场的摄像机。有没有办法显示同一摄像机的两个实例?