I have an AVMutableComposition
with the following track segments:
video:
empty: Y, {{0/1 = 0.000}, {48/100 = 0.480}}
empty: N, {{48/100 = 0.480}, {600/600 = 1.000}}
empty: Y, {{888/600 = 1.480}, {900/600 = 1.500}}
empty: N, {{894/300 = 2.980}, {1040/600 = 1.733}}
audio:
empty: Y, {{0/1 = 0.000}, {48/100 = 0.480}}
empty: N, {{48/100 = 0.480}, {45056/44100 = 1.022}}
empty: Y, {{66224/44100 = 1.502}, {65194/44100 = 1.478}}
empty: N, {{894/300 = 2.980}, {77824/44100 = 1.765}}
The timing is expressed as CMTimeRange
, the first CMTime
is the start time, the second one is duration. In other words, there are two audio+video chunks with some empty padding space before and between them.
The problem is that when I export this composition and play back the exported video, the second audio segment plays too early, as if the second empty padding audio segment was ignored during the export. IĀ get the first video segment with correct audio, then immediately the second audio segment and then later the second video segment without audio.
What could be wrong?