# Smart Record timestamp

**URL:** <https://forums.developer.nvidia.com/t/smart-record-timestamp/308437>\
**Category:** DeepStream SDK\
**Tags:** deepstream\
**Created:** [October 1, 2024, 1:03pm UTC](https://forums.developer.nvidia.com/t/smart-record-timestamp/308437 "2024-10-01T13:03:03Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![junshengy](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/junshengy/32/251332_2.png) [@junshengy](https://forums.developer.nvidia.com/u/junshengy)\
**Post date:** [October 28, 2024, 8:00am UTC](https://forums.developer.nvidia.com/t/smart-record-timestamp/308437/7 "2024-10-28T08:00:54Z")

</div>

I think the following method can work, I use `nvurisrcbin` as the soure element

1.Configurate the pipeline clock to ntp clock

```auto
from gi.repository import GLib, Gst, GstNet

pipeline = Gst.Pipeline()
 
 # Create the NTP clock
 clock = GstNet.NtpClock.new("ntp-clock", "time1.google.com", 123, 0)

 # Set the pipeline to use the NTP clock
pipeline.use_clock(clock)

```

Now the PTS of GstBuffer is ntp\_timestamp.

1. Use mkv as a saving container.

```auto
uri_decode_bin.set_property("smart-rec-container", 1)

```

In mkv, the timestamp of rtp can be preserved.such as

```auto
 <packet codec_type="video" stream_index="0" pts="3939093403552" pts_time="3939093403.552000" dts="3939093403552" dts_time="3939093403.552000" duration="66" duration_time="0.066000" size="51850" pos="517" flags="K_"/>
 <packet codec_type="video" stream_index="0" pts="3939093403585" pts_time="3939093403.585000" dts="3939093403585" dts_time="3939093403.585000" duration="66" duration_time="0.066000" size="21775" pos="52375" flags="__"/>

```

3.Find the desired frame from the mkv file.

---

_[View the full topic](https://forums.developer.nvidia.com/t/smart-record-timestamp/308437)._
