Hardware Platform (Jetson / GPU) NX • DeepStream Version 6.1.1 • JetPack Version (valid for Jetson only) 5.02 • TensorRT Version 8.4
Hi,
I am using test5app to process a h264 stream via rtsp.
And I found that after nvv4l2 decoding, the timestamp: NvDsFrameMeta->rtp_timestamp
is based on the FIRST RTCP SR, and on the following frames, related timestamp is calculated by
adding pts to the FIRST absolute timestamp. After thousands of frames processed, there’s a error
around several seconds appeared, that make me not able to sync with my host device.
So, would you please info me, how to let deepstream-app receive every SR and recalculate the following timestamp during the SR interval.
Thank you.
“using system timestamp as pts” cannot let me sync with the host device of rtsp source, I do need the absolute timestamp from the host continuously in one short period.
Deepstream 6.2 document says:
2. NTP timestamp when attached at RTSP source - supported only if RTSP sources send RTCP Sender Reports (SR).
To configure the pipeline to attach these timestamps:
Set attach-sys-ts to FALSE on nvstreammux. Set the attach-sys-ts-as-ntp config parameter to 0 in [streammux] group of the application configuration file in the DeepStream reference app.
After creating an “rtspsrc” element or an “uridecodebin” element, application must call configure_source_for_ntp_sync() function and pass the GstElement pointer to this API. (Refer to create_rtsp_src_bin() in deepstream_source_bin.c file.) The API internally configures the pipeline to parse sender report and calculate NTP timestamps for each frame.
Make sure RTSP source can send RTCP Sender Reports.
in deepstream_source_bin.c, I found 3 times of following:
if (g_strrstr (config->uri, “rtsp://”) == config->uri) {
configure_source_for_ntp_sync (bin->src_elem);
}
I donnot understand how to let deepstream read every SR, and get source timestamp for every SR interval.
Please help. Thank you.
As you attached before: NTP timestamp when attached at RTSP source - supported only if RTSP sources send RTCP Sender Reports (SR).. We have already parse the info from the SR with the configure_source_for_ntp_sync callback. If you follow this instruction to configure, the pts will come from the SR.
As you use test5app, set the parameters of nvstreammux below in your config file.
1.set attach-sys-ts to FALSE on nvstreammux.
2.set the attach-sys-ts-as-ntp config parameter to 0
3.set the live-source to 1
Hi,
the above configurations are already satisfied.
And I am sure deepstream already parsed the FIRST SR’s timestamp,
I found NvDsFrameMeta->ntp_timestamp in pregprocess plug-in is just the same with
the timestamp of 1st SR.
and the timestamps of following frames are calculated by NvDsFrameMeta->ntp_timestamp + PTS.
This method caused a accumulated error, up to several seconds after thousands of frames transfered.
What I need is that deepstream can parse the following SR, and update NvDsFrameMeta->ntp_timestamp, and let reconfigure PTS,start from 0 again.
That will avoid the accumulated timestamp error and make the inter-device sync possible.
The API in deepstream_source_bin.c,
if (g_strrstr (config->uri, “rtsp://”) == config->uri) {
configure_source_for_ntp_sync (bin->src_elem);
It needs variant bin->src_elem,
In the end, my question is, what’s the API for rtcp SR in other plug-in, like preprocess plug-in?
what’s the variant?
Thank you.
What do you mean and let reconfigure PTS, start from 0 again.? Now we get the SR and calculate the pts with our algorithm.
Could you provide a detailed description of your requirements for PTS?
About the bin->src_elem parameter, it’s a gstreamer plugin. If you can ensure that all your sources are rtsp, you can try to add the preprocess plugin for it.
We only synchronize once after the pipeline runs through the configure_source_for_ntp_sync api. Currently, we do not support the situation you mentioned. Could you try to synchronize multiple times with g_timeout_add API?
I am testing that on ubuntu 20, down load redis 6.08, change 3 lines of redis.conf,
to substitue the ip 127.0.0.1 for 192.168.55.100, and bind 127.0.0.1 192.168.55.100,
protect mode = no
cd redis-xxx
src/redis-server redis.conf
another teminal,
cd redis-xxx
src/redis-cli