Unstable PTS when streaming via RTP

I’m using webrtcbin to stream video. On the sender sider, I have a smooth PTS with delta of 16.6 ms (60HZ). But on the receiver side, the PTS is not smooth. The video gets very choppy when the PTS fluctuates.
Sender

Frame PTS: 1000:02:08.750000000, PTS diff: 16666667
Frame PTS: 1000:02:08.766666666, PTS diff: 16666666
Frame PTS: 1000:02:08.783333333, PTS diff: 16666667
Frame PTS: 1000:02:08.800000000, PTS diff: 16666667
Frame PTS: 1000:02:08.816666666, PTS diff: 16666666
Frame PTS: 1000:02:08.833333333, PTS diff: 16666667
Frame PTS: 1000:02:08.850000000, PTS diff: 16666667
Frame PTS: 1000:02:08.866666666, PTS diff: 16666666
Frame PTS: 1000:02:08.883333333, PTS diff: 16666667
Frame PTS: 1000:02:08.900000000, PTS diff: 16666667
Frame PTS: 1000:02:08.916666666, PTS diff: 16666666
Frame PTS: 1000:02:08.933333333, PTS diff: 16666667
Frame PTS: 1000:02:08.950000000, PTS diff: 16666667

Receiver

Received frame PTS: 0:00:55.911666502, PTS diff: 16158961
Received frame PTS: 0:00:55.927814914, PTS diff: 16148412
Received frame PTS: 0:00:55.943917546, PTS diff: 16102632
Received frame PTS: 0:00:55.959973605, PTS diff: 16056059
Received frame PTS: 0:00:55.975952291, PTS diff: 15978686
Received frame PTS: 0:00:55.991889225, PTS diff: 15936934
Received frame PTS: 0:00:56.071973521, PTS diff: 80084296
Received frame PTS: 0:00:56.088685587, PTS diff: 16712066
Received frame PTS: 0:00:56.105349685, PTS diff: 16664098
Received frame PTS: 0:00:56.122010534, PTS diff: 16660849
Received frame PTS: 0:00:56.138613082, PTS diff: 16602548
Received frame PTS: 0:00:56.155158977, PTS diff: 16545895

I’m quite new to network stuff, so I would really appreciate it if someone could explain a bit.

Answered on Matrix already. This is a bug in h264parse where it sometimes doesn’t put PTS on output buffers, and this was worked around here by not having h264parse at all in the receiver pipeline.

Also PTS are not transmitted verbatim via RTP, and on the receiver side rtpjitterbuffer is transforming the sender PTS into PTS that make sense according to the pipeline clock.

1 Like