【问题标题】:Change video input device QTkit更换视频输入设备 QTkit
【发布时间】:2013-02-28 11:54:56
【问题描述】:

我有一个 videoInput 设备列表。 首先,我添加了用于录制的默认输入设备,设置了压缩、输出和所需的一切。之后我试图更改输入设备,但不知何故,视图停止工作,它只显示黑屏。我在不录制时尝试更改,仅在视图中显示输入。 修改代码如下:

-(void) changeVideoInput:(QTCaptureDevice *)videoDevice{

    BOOL success = NO;
    NSError *error;

    [mCaptureSession stopRunning];
        [mCaptureSession removeInput:mCaptureVideoDeviceInput]; //current input
        [[mCaptureVideoDeviceInput device] close];

        success = [videoDevice open:&error];

        mCaptureVideoDeviceInput2 = [[QTCaptureDeviceInput alloc] initWithDevice:videoDevice]; //new input

        success = [mCaptureSession addInput:mCaptureVideoDeviceInput2 error:&error];

    [mCaptureSession startRunning];    
}

【问题讨论】:

    标签: objective-c video-capture qtkit


    【解决方案1】:

    最后我发现,代码可以正常工作。该问题导致打开默认视频设备(它的名称是:“Blackmagic”)。 不要打开该设备。它是一种通用设备。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-01-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-19
      • 1970-01-01
      • 2021-09-03
      • 2015-11-22
      相关资源
      最近更新 更多