Justin
Justin

Reputation: 3397

Get playhead position based on pts

I'm trying to determine if it is possible to get a playhead position based on the pts of a TS file.

Most articles I have found just talk about using ffmpeg and I'm not using that.

My understanding is that pts is based on the pcr, which is an optional field in the MPEG TS spec. But given that can a frame's position be computed to seconds into a stream based on to pts. If so, how do I go about the calculation?

Upvotes: 0

Views: 505

Answers (1)

szatmary
szatmary

Reputation: 31120

Not really, but maybe if you know the pts of the first frame. Then you can do the math. Note, pts will overflow every 26 hours or so, so you many need to check the entire file/manifest if you expect streams that long. In addition, the pts can be reset to any value at any point if the dicontinuity bit is set.

Upvotes: 1

Related Questions