I am using an AVSampleBufferDisplayLayer to display CMSampleBuffers which are coming over a network connection in the h.264 format. Video playback is smooth and working corr
Hit with the same issue, managed to play several streams one after another without lags with following timing in CMSampleBufferCreate creation
CMSampleTimingInfo timingdata ={
.presentationTimeStamp = CMTimeMakeWithSeconds(self.frame0time+(1/self.frameFPS)*self.frameActive, 1000),
.duration = CMTimeMakeWithSeconds(1/self.frameFPS, 1000),
.decodeTimeStamp = kCMTimeInvalid
};
No need to use kCMSampleAttachmentKey_DisplayImmediately with this approach, you just have to self.frameActive++ on every Iframe and BFrame and make self.frame0time = CACurrentMediaTime(); on first frame