avdec_h264 producing sudden PTS jumps in RTSP streams
Hello!
I'm receiving a 30 FPS video stream from a RTSP camera via TCP. Every few seconds I experience sudden choppy playback:
rtspsrc latency=2000 location=rtspt://guest:gstreamer1@sala.ath.cx:5540/Streaming/Channels/101 ! rtph264depay ! h264parse ! identity name=id_parse ! avdec_h264 ! identity name=id_avdec ! watchdog timeout=10000 ! autovideosink
I've been trying to wrap my head around this problem for quite a while and finally wrote a python script which shows me the PTS offsets in different parts of the pipeline (gst.py script attached)
h264parse
produces a small jump in PTS only in the beginning of the playback, but stays more or less at 0.0333 afterwards (which is consistent with 30 FPS).
avdec_h264
, however, produces jumps every several seconds:
[pts= 0.194 ] pts_parse delta from previous PTS not 0.0333 = 0.193780327
[pts= 0.194 ] pts_avdec delta from previous PTS not 0.0333 = 0.193780327
[pts= 4.31 ] pts_avdec delta from previous PTS not 0.0333 = 0.06699949600000021
[pts= 6.509 ] pts_avdec delta from previous PTS not 0.0333 = 0.06690735799999992
[pts= 8.307 ] pts_avdec delta from previous PTS not 0.0333 = 0.06704043799999937
[pts= 12.306 ] pts_avdec delta from previous PTS not 0.0333 = 0.06695861200000053
[pts= 13.705 ] pts_avdec delta from previous PTS not 0.0333 = 0.06703847100000004
[pts= 20.308 ] pts_avdec delta from previous PTS not 0.0333 = 0.06702971500000032
[pts= 20.642 ] pts_avdec delta from previous PTS not 0.0333 = 0.09999486099999899
[pts= 23.275 ] pts_avdec delta from previous PTS not 0.0333 = 0.06699473599999806
[pts= 24.341 ] pts_avdec delta from previous PTS not 0.0333 = 0.09999411300000105
Is it a bug? Or I should write a wrapper script which fixes the PTS after avdec_h264
myself?