Overlay Two Videos with AVFoundation

后端 未结 1 447
既然无缘
既然无缘 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)
提交回复
热议问题