Syncronize smart record frame with bbox

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) - Jetson Orin Nano Dev kit
• DeepStream Version - 7.1
• JetPack Version (valid for Jetson only) - 6.2.2
• TensorRT Version - 10.3.0
• NVIDIA GPU Driver Version (valid for GPU only) - CUDA 12.6.68
• Issue Type( questions, new requirements, bugs) - new requirements
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

Hi,

I want to sync the bounding box data and video frames recorded by smart record. I am using deepstream-test-sr app and my video input is rtsp. I have came across below ticket and the solution suggested is using nvurisrcbi . I have tried to adopt it for rtspsrc and implemented following

in main()

  /* Create gstreamer elements */
  /* Create Pipeline element that will form a connection of other elements */
  pipeline = gst_pipeline_new ("dstest-sr-pipeline");

  // Create the NTP clock
  // Parameters: name, remote_address, remote_port, base_time
  GstClock *clock = gst_ntp_clock_new("ntp-clock", "time1.google.com", 123, 0);

  // Set the pipeline to use the NTP clock
  gst_pipeline_use_clock(GST_PIPELINE(pipeline), clock);

  source = gst_element_factory_make ("rtspsrc", "rtsp-source");
  g_object_set (G_OBJECT (source), "location", argv[1], "udp-buffer-size", RTSP_UDP_BUFFER_SIZE, NULL);

  configure_source_for_ntp_sync(source);

Also changed container type

#define SMART_REC_CONTAINER 1

Still I am not getting ntp timestamp. I got following

ffprobe -v error   -select_streams v:0   -show_frames   -show_entries frame=pts,pts_time,pkt_dts,pkt_dts_time,best_effort_timestamp,best_effort_timestamp_time,pict_type,key_frame   -of csv With_BBox_00000_20260908-164438_4109.mkv
frame,1,358,0.358000,358,0.358000,Iside_data,H.26[45] User Data Unregistered SEI message

frame,0,362,0.362000,362,0.362000,P
frame,0,366,0.366000,366,0.366000,P
frame,0,370,0.370000,370,0.370000,P
frame,0,424,0.424000,424,0.424000,P
frame,0,447,0.447000,447,0.447000,P
frame,0,461,0.461000,461,0.461000,P
frame,0,495,0.495000,495,0.495000,P
frame,0,528,0.528000,528,0.528000,P
frame,0,561,0.561000,561,0.561000,P
frame,0,595,0.595000,595,0.595000,P
frame,0,629,0.629000,629,0.629000,P
frame,0,661,0.661000,661,0.661000,P
frame,0,694,0.694000,694,0.694000,P
frame,0,727,0.727000,727,0.727000,P
frame,0,728,0.728000,728,0.728000,P
frame,0,761,0.761000,761,0.761000,P
frame,0,761,0.761000,761,0.761000,P

Please let me know how to resolve this.

Hello @the.elite.pro.0224!

Based on the title and content of your topic, it looks like it may receive better visibility and feedback in a different category. We took the liberty of moving it for you.

If this was an incorrect assessment, please send me a direct message.

Disclaimer: this moderation suggestion and message were generated with AI assistance.

This code sets the PTS of the video file saved by “smart record” to use NTP time, because for MP4 files, the starting timestamp of every recording is 0.

The PTS values ​​you have shown are already in NTP time:

frame,
1,                  # key_frame
358,             # pts
0.358000,   # pts_time
358,             # best_effort_timestamp
0.358000,   # best_effort_timestamp_time
I                   # pict_type

In fact, I recommend using the following command to check.

ffprobe -v error \
  -select_streams v:0 \
  -show_packets \
  -of xml \
  With_BBox_00000_20260908-164438_4109.mkv
  1. If this is NTP timestamp then shouldn’t it be the current time.
  2. The video feed to the deepstream over rtsp is of 30 fps but as you can see in the earlier log there are entries with a difference of just 1 ms or even repeat entries. If I use the command you have provide then also the results are same. Below is a snippet for another video
ffprobe -v error \
  -select_streams v:0 \
  -show_packets \
  -of xml \
  With_BBox_00000_20260908-172234_5334.mkv
<?xml version="1.0" encoding="UTF-8"?>
<ffprobe>
    <packets>
        <packet codec_type="video" stream_index="0" pts="33457" pts_time="33.457000" dts="33457" dts_time="33.457000" size="3742" pos="511" flags="K_"/>
        <packet codec_type="video" stream_index="0" pts="33458" pts_time="33.458000" dts="33458" dts_time="33.458000" size="1609" pos="4272" flags="__"/>
        <packet codec_type="video" stream_index="0" pts="33458" pts_time="33.458000" dts="33458" dts_time="33.458000" size="10655" pos="5900" flags="__"/>
        <packet codec_type="video" stream_index="0" pts="33557" pts_time="33.557000" dts="33557" dts_time="33.557000" size="3464" pos="16574" flags="__"/>
        <packet codec_type="video" stream_index="0" pts="33558" pts_time="33.558000" dts="33558" dts_time="33.558000" size="8356" pos="20057" flags="__"/>
        <packet codec_type="video" stream_index="0" pts="33591" pts_time="33.591000" dts="33591" dts_time="33.591000" size="3852" pos="28432" flags="__"/>
  1. I noticed if my Jetson is not connected to the internet then also I am getting the same timestamps
(deepstream-testsr-app:3311): GStreamer-Net-WARNING **: 11:10:15.828: failed to start clock 'netclientinternalclock0' 
  1. When it is connected to the internet then the pipeline ends immediately as it sees EOS.
Running...
In cb_newpad
NvMMLiteOpen : Block : BlockType = 261 
NvMMLiteBlockCreate : Block : BlockType = 261 
nvstreammux: Successfully handled EOS for source_id=0
End of stream
Returned, stopping playback
Deleting pipeline

The three issues mentioned above are independent and do not corroborate one another.

The method I suggested in the other thread configures the GStreamer pipeline to use an NTP clock, allowing the frame PTS values to be based on the NTP time rather than starting from zero. However, since your Jetson cannot access time1.google.com, the NTP clock fails to start and this method cannot work in your environment.

The EOS observed after connecting the Jetson to the network is a separate issue. Please identify which element posts the EOS before investigating it further.

Pardon me for creating the confusion earlier. The issue is that after setting the clock to NTP as mentioned in the referred ticket for the pipeline the pipeline ends quickly. If I don’t implement the code then the pipeline executes as per the video streamed over RTSP.

Running...
In cb_newpad
NvMMLiteOpen : Block : BlockType = 261 
NvMMLiteBlockCreate : Block : BlockType = 261 
nvstreammux: Successfully handled EOS for source_id=0
End of stream
Returned, stopping playback
Deleting pipeline

It seems like the pipeline is skipping the video due to PTS mismatch from the RTSP feed and NTP.

To identify which DeepStream element is triggering the EOS, please provide the complete GStreamer debug logs and the full modified source code.

 GST_DEBUG=3 ./deepstream-testsr-app <RTSP_URI> > log.log 2>&1

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks.