Overlay Two Videos with AVFoundation

后端 未结 1 433
既然无缘
既然无缘 2021-01-03 05:26

I am trying to overlay two videos, with the foreground video being somewhat alpha transparent. I have been following the Apple Docs as well as This tutorial.

Whenev

相关标签:
1条回答
  • 2021-01-03 06:09

    Your min should be max...

    Replace this line

    instruction.timeRange = CMTimeRangeMake(kCMTimeZero, min(firstAsset.duration, secondAsset.duration))
    

    With this line and it will work :

    instruction.timeRange = CMTimeRangeMake(kCMTimeZero, max(firstAsset.duration, secondAsset.duration))
    
    0 讨论(0)
提交回复
热议问题