Gstreamer getting wrong pts after seeking.

I am getting wrong pts after performing two consecutive seeks with some wait in between.

I am using the below pipeline:

“filesrc location=input.avi ! avidemux ! video/x-h264 ! queue ! h264parse !
omxh264dec ! nvvidconv ! video/x-raw, format=GRAY8 ! appsink name=sinkDec
sync=false max-buffers=50 drop=false”

What I am observing is that the frames I pull from appsink after performing two consecutive seeks with some wait in between have incorrect pts.
One thing I notice is that this happens only if the first seek I performed is closer to the end of the file.

I have also validated the above problem from the logs.
When this problem occurs, the videodecoder show below logs:

videodecoder gstvideodecoder.c:2737:gst_video_decoder_prepare_finish_frame:
decreasing timestamp (0:01:18.000000000 < 0:01:19.960000000)
videodecoder gstvideodecoder.c:2700:gst_video_decoder_prepare_finish_frame:
invalidating PTS

The sample code can be found here :

The sample video can be found here :

Can someone explain me why I am getting wrong pts?

Hi rastogishubham20,
I think the issue is in avidemux. We have verified it with MP4 and it works fine: