-
QuestionHi, I am testing SRT streaming using HaishinKit and I have a question regarding the However, when receiving Background / Tried StepsBelow are the URLs used: Caller: This is the output code: actor SrtStreamOutput: StreamOutput {
nonisolated func stream(_ stream: some HaishinKit.StreamConvertible, didOutput audio: AVAudioBuffer, when: AVAudioTime) {
}
nonisolated func stream(_ stream: some HaishinKit.StreamConvertible, didOutput video: CMSampleBuffer) {
guard let pixelBuffer = CMSampleBufferGetImageBuffer(video) else { return }
let pts = video.presentationTimeStamp
print("video ts", pts)
}
}Example log showing timestamps not arriving in increasing order: EnvironmentiPad mini 7 - iOS 26 Is there a recommended or correct way to configure tsbpd within HaishinKit so that frames are delivered in presentation-time order? Thank you for your guidance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
I found a way to resolve this issue, which might help others facing the same problem. Setting |
Beta Was this translation helpful? Give feedback.
-
|
The TimeStamp mentioned here refers to something different from the When using H.264 Main profile or higher, or when using H.265, B-frames become enabled. Therefore, you will need to choose one of the two approaches:
Option 2 relies on the |
Beta Was this translation helpful? Give feedback.
The TimeStamp mentioned here refers to something different from the
CMSampleBuffer.presentationTimeStamp.https://datatracker.ietf.org/doc/html/draft-sharabayko-srt-01#section-4.5
When using H.264 Main profile or higher, or when using H.265, B-frames become enabled.
In that case, the order of PTS (presentationTimeStamp) will match the result you observed.
Therefore, you will need to choose one of the two approaches:
videoSettings.allowFrameReordering = falseOption 2 relies on the
VideoToolboxfeature.