Changing AVCaptureDeviceInput leads to AVAssetWriterStatusFailed

后端 未结 1 1387
粉色の甜心
粉色の甜心 2020-12-17 23:15

I am trying to change the Camera View Front and Back.it is working well.if video is recorded without flipping with Pause/Record Option

相关标签:
1条回答
  • 2020-12-18 00:17

    The problem is this line:

    if (connection != _videoConnection)
        {
            bVideo = NO;
        }
    

    When you change the camera a new videoConnection is created, I don't know where either how. But if you change this line like below it works:

    //if (connection != _videoConnection)
    if ([connection.output connectionWithMediaType:AVMediaTypeVideo] == nil)
        {
            bVideo = NO;
        }
    
    0 讨论(0)
提交回复
热议问题