Black Video CAAnimation and AVFoundation AVAssetExportSession

后端 未结 2 1872
日久生厌
日久生厌 2021-01-07 07:28

I\'m a relative newbie on the whole AVFoundation video editing circuit.

My current test app is a two screen application, the first screen does an AVFoundation Video

相关标签:
2条回答
  • 2021-01-07 07:49

    The problem was with the following lines.

    parentLayer.frame = CGRectMake(0,0, videoSize.width, videoSize.height); 
    videoLayer.frame = CGRectMake(0,0, videoSize.width, videoSize.height); 
    

    Changing videoSize.width to 320, and videoSize.height = 480 fixed the issue.

    0 讨论(0)
  • 2021-01-07 08:01

    But if the size of the video wont be 320X480, it will mess up. Try to use this one to get the video size.

            CGSize videoSize = [[[self.videoAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0] naturalSize];
    
    0 讨论(0)
提交回复
热议问题