In this case use has to write his own logic in the application to update the PTS with desired value using probe functions or write appsrc plugin to handle custom requirement.
We think probably setting of DTS and PTS is problematic because user is getting random pts=5266666614 values than expected t = 1611000000000000000
You can debug at your end by adding “identity silent = 0” in the pipeline you are running and investigate if PTS values are printed as expected below.
@Timestamp handling – need to use GST_BUFFER_PTS() API to set the desired PTS value
unsigned long pts = <set_expected_pts_in_nano_seconds>;
GST_BUFFER_PTS (gst_buffer) = pts;
Few debugging tips →
gst-launch my-appsrc → identity silent=0 → h264parse → nvv4l2decoder → nvstreammux → nvvideoconvert → capsfilter → nvinfer → appsink -e -v
Expected prints after adding identity element.
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (40048 bytes, dts: 0:00:00.033333333, pts: 0:00:00.133333333, duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 00002000 delta-unit , meta: none) 0x7fcb100a00d0
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (14921 bytes, dts: 0:00:00.066666666, pts: 0:00:00.100000000 , duration: 0:00:00.033333334, offset: -1, offset_end: -1, flags: 00002000 delta-unit , meta: none) 0x7fcb100a0840
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (41474 bytes, dts: 0:00:00.100000000, pts: 0:00:00.200000000 , duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 00002000 delta-unit , meta: none) 0x7fcb100a0840
/GstPipeline:pipeline0/GstIdentity:identity0: last-message = chain ******* (identity0:sink) (13242 bytes, dts: 0:00:00.133333333, pts: 0:00:00.166666666 , duration: 0:00:00.033333333, offset: -1, offset_end: -1, flags: 00002000 delta-unit , meta: none) 0x7fcb100a0840
If PTS are not printed as expected then setting up of the PTS value in the appsrc could be a problem.
Also the presentation timestamp (pts) in nanoseconds (as a GstClockTime) of the data in the buffer. This needs to be rechecked in the appsrc logic.
This would help you to narrow down the issue.
You can also test and analyze the working pipeline setup and see how PTSes are getting set for better understanding.