I think the following method can work, I use nvurisrcbin as the soure element
1.Configurate the pipeline clock to ntp clock
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.
- Use mkv as a saving container.
uri_decode_bin.set_property("smart-rec-container", 1)
In mkv, the timestamp of rtp can be preserved.such as
<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.