Me and my team have an issue that we can't fix for few weeks now.
When we seek forward between two videos in AVComposition - the preview freezes. It gets stuck on last frame of first video. It doesn’t freeze if it’s a simple playback (not a seek) or if seek is quick.
Here is screen recording of what's happening:
https://www.icloud.com/iclouddrive/0651H_IA679ENDk9fLANNvwXA#AVCompositionFreezeScreenRecording
It feels like we tried everything, and nothing helps. When adding second video, we ask AVMutableComposition for a compatible track, and it returns us existing track, thus we conclude that both assetTrack's are compatible.
All the ranges and duration checked many times.
It fails both when videoComposition is set on playerItem and when not.
My current theory is even tho composition says that existing compositionTrack is compatible for second video, we can’t just put second video in it for some reason, maybe the transform is incompatible or I don’t know.
One more note - if we take range of source videoAssetTrack with duration that is shorter than videoAssetTrack.timeRange.duration - then everything works. Maybe some issue with segment time mapping, but anything that we tried with it failed.
I tried to minimize the amount of code needed to demonstrate the issue, so hopefully it will be easy to see what I’m talking about. Just seek slowly from end of video1 to start of video2 and it will get stuck.
https://www.icloud.com/iclouddrive/0tDFgcQHKsIS7obiCA9yMHAEA#AVCompositionFreezeDemo
Thanks very much in advance, any help would be much appreciated!