How can I get exact systemtime timestamp with gstreamer

Hi all,

I’m trying to get exact timestamp with my gstreamer.
When I check dts and pts with below command, it started when I enter command.

gst-launch-1.0 -ve v4l2src do-timestamp=true device=/dev/video1 ! “video/x-raw, format=(string)UYVY, width=(int)1920,height=(int)1080” ! nvvidconv ! “video/x-raw(memory:NVMM), format=(string)I420” ! fakesink silent=false

/GstPipeline:pipeline0/GstFakeSink:fakesink0: last-message = chain ******* (fakesink0:sink) (976 bytes, dts: 0:00:06.179406338, pts: 0:00:06.146063109, duration: 0:00:00.033333333, offset: 174, offset_end: 175, flags: 00000000 , meta: none) 0x7f8c017510

As I checked nvidia vi files, it set timestamp with ‘set_timestamp’ function in channel.c.
Can I get that timestamp with my gstreamer application?

Thanks in advance.

Looks like when you set v4l2src do-timestamp=true, it enables timestamp mechanism of gstreamer. For getting kernel timestamp, you may need to use jetson_multiemdia_api and refer to 12_camera_v4l2_cuda.

If you use r32.4.3, we have implemented nvv4l2camerasrc plugin and open source. You can download the source code and customize it to get kernel timestamp. The source code is in

Hi @DaneLLL

Thank you for your reply.
I’ll check jetson_multimedia_api and update it.

BTW, can I get the frame metadata info from v4l2src gstreamer command?
I thought I could get the timestamp from metadata but I couldn’t find the way.

Dongjin Ha.

Not sure but I think it is not implemented in default code. Suggest you go to gastreamer forum to get further information.

It is native gstreamer plugin and open source in
You can look at the source code and check if you can customize it and rebuild We have build instructions in gstreamer user guide.

1 Like

Hi @DaneLLL

Thank you for your comment.
Then can I supposed that there’s no way to get kernel timestamp from gstreamer except customizing gstreamer plugin?


Yes. I think it does not get kernel timestamp in default implementation.

1 Like