I’m trying to achieve duration accurate 24h playback with AVQueuePlayer but keep getting longer total times. AVQueuePlayer items are inserted in async task. Perceptually, playback is gapless but total duration extends by between 1 minute and 1.5 minutes. Also if I print the diff of timestamps on playerItemReachedEnd, I consistently get durations between 110 and 170 ms longer than AVAsset duration value. I’ve check with lsof that newer items are being accessed before playback.
All video assets are local, on SSD, constant framerate. All were processed by FFMPEG and have very small but variable differences between video and audio track durations.
So, the question is:
How can I get AVQueuePlayer to be strict about timerange playback?
If I create a AVMutableComposition with the timeRange of the video track I seem to get correct values (a couple of ms difference, perfectly inside the notification delay).