prominenceai / deepstream-services-library

A shared library of on-demand DeepStream Pipeline Services for Python and C/C++
MIT License
274 stars 64 forks source link

file-source and rtsp-source got warning 'There may be a timestamping problem, or this computer is too slow.' when uses window-sink #1119

Closed YoungjaeDev closed 7 months ago

YoungjaeDev commented 9 months ago

deepstream:6.2 dsl=commit: 0.27.b.alpha pipeline

// Create a list of Pipeline Components to add to the new Pipeline.
 const wchar_t* components[] = {L"uri-source-1", L"primary-gie", 
            L"tracker", L"on-screen-display", L"window-sink", NULL};

The phenomenon is as follows: What's really strange is that my monitor is 1920x1080, and when I sink the window-sink to this size, the rendering suddenly stops, lags for about a few seconds, and then the rendering starts again and the freeze phenomenon repeats. However, it is surprising that this error does not occur when you set the sink size to 1280x720.

_too_late (): /GstPipeline:pipeline/GstBin:sinks-bin/GstBin:window-sink/GstEglGlesSink:window-sink-nveglglessink:
There may be a timestamping problem, or this computer is too slow.
0:00:35.829935158 51389 0x559bd47a6200 INFO                     DSL src/DslPipelineStateMgr.cpp:358:HandleBusWatchMessage:  : Message type : warning
0:00:35.829947043 51389 0x559bd47a6200 INFO                     DSL src/DslPipelineStateMgr.cpp:359:HandleBusWatchMessage:  :    warning   : A lot of buffers are being dropped.
0:00:35.829953343 51389 0x559bd47a6200 INFO                     DSL src/DslPipelineStateMgr.cpp:361:HandleBusWatchMessage:  :    debug     : gstbasesink.c(3003): gst_base_sink_is_too_late (): /GstPipeline:pipeline/GstBin:sinks-bin/GstBin:window-sink/GstEglGlesSink:window-sink-nveglglessink:
There may be a timestamping problem, or this computer is too slow.
0:00:35.901516597 51389 0x559bd47a6200 INFO                     DSL src/DslPipelineStateMgr.cpp:358:HandleBusWatchMessage:  : Message type : warning
0:00:35.901532360 51389 0x559bd47a6200 INFO                     DSL src/DslPipelineStateMgr.cpp:359:HandleBusWatchMessage:  :    warning   : A lot of buffers are being dropped.
0:00:35.901537711 51389 0x559bd47a6200 INFO                     DSL src/DslPipelineStateMgr.cpp:361:HandleBusWatchMessage:  :    debug     : gstbasesink.c(3003): gst_base_sink_is_too_late (): /GstPipeline:pipeline/GstBin:sinks-bin/GstBin:window-sink/GstEglGlesSink:window-sink-nveglglessink:

1280x720 UI image

1920x1080 UI -> no toolbar image

rjhowell44 commented 9 months ago

@youngjae-avikus referring back to the table on the common sink properties

You can see that the max-lateness is set to 20000000 by default. DSL was setting this to -1 (disabled) in all previous releases. I decided to go with the plugin default -- just as I did with the sync and async properties.

_The max-lateness property affects how the Sink deals with buffers that arrive too late. A buffer arrives too late in the Sink when the presentation time (as a combination of the last segment, buffer timestamp and element base_time) plus the duration is before the current time of the clock. If the frame is later than max-lateness (in nanoseconds), the sink will drop the buffer without calling the render method._

It appears this is causing the issue you're reporting. Try setting the property to -1 with dsl_sink_max_lateness_set

re: " However, it is surprising that this error does not occur when you set the sink size to 1280x720."
This makes sense, since the the Sink has less processing to do, it can service it's input queue faster and the max-lateness is avoided.

I will probably disable this by default again in the next release.

YoungjaeDev commented 9 months ago

@youngjae-avikus referring back to the table on the common sink properties

You can see that the max-lateness is set to 20000000 by default. DSL was setting this to -1 (disabled) in all previous releases. I decided to go with the plugin default -- just as I did with the sync and async properties.

_The max-lateness property affects how the Sink deals with buffers that arrive too late. A buffer arrives too late in the Sink when the presentation time (as a combination of the last segment, buffer timestamp and element base_time) plus the duration is before the current time of the clock. If the frame is later than max-lateness (in nanoseconds), the sink will drop the buffer without calling the render method._

It appears this is causing the issue you're reporting. Try setting the property to -1 with dsl_sink_max_lateness_set

re: " However, it is surprising that this error does not occur when you set the sink size to 1280x720." This makes sense, since the the Sink has less processing to do, it can service it's input queue faster and the max-lateness is avoided.

I will probably disable this by default again in the next release.

I set dsl_sink_max_latenessset to -1 and ran the pipeline once again, but it still hangs. It was replayed in FHD. Frame suddenly drops The situation is **max-lateness=-1, sync=True_**

sionFpsAvg:  : Source '0' session FPS avg = 30.2753
0:01:03.991429976 947146 0x561448bb8c00 INFO                     DSL src/DslSourceMeter.h:136:GetIntervalFpsAvg:  : Source '0' interval FPS avg = 29.97
29.970030 30.275275 
0:01:05.993565631 947146 0x561448bb8c00 INFO                     DSL src/DslSourceMeter.h:116:GetSessionFpsAvg:  : Source '0' session FPS avg = 30.2649
0:01:05.993636799 947146 0x561448bb8c00 INFO                     DSL src/DslSourceMeter.h:136:GetIntervalFpsAvg:  : Source '0' interval FPS avg = 29.9551
29.955067 30.264939 
0:01:07.093088822 947146 0x561448bc6b60 INFO                     DSL src/DslSinkBintr.cpp:1352:HandleXWindowEvents:  : Button '1' pressed: xpos = 1328: ypos = 441
0:01:07.995772862 947146 0x561448bb8c00 INFO                     DSL src/DslSourceMeter.h:116:GetSessionFpsAvg:  : Source '0' session FPS avg = 30.2348
0:01:07.995795714 947146 0x561448bb8c00 INFO                     DSL src/DslSourceMeter.h:136:GetIntervalFpsAvg:  : Source '0' interval FPS avg = 28.9456
28.945555 30.234792 
0:01:09.997893755 947146 0x561448bb8c00 INFO                     DSL src/DslSourceMeter.h:116:GetSessionFpsAvg:  : Source '0' session FPS avg = 30.2348
0.000000 30.234792 
0:01:12.000013285 947146 0x561448bb8c00 INFO                     DSL src/DslSourceMeter.h:116:GetSessionFpsAvg:  : Source '0' session FPS avg = 30.2348
0.000000 30.234792 
0:01:14.002123936 947146 0x561448bb8c00 INFO                     DSL src/DslSourceMeter.h:116:GetSessionFpsAvg:  : Source '0' session FPS avg = 30.2348
0.000000 30.234792 
0:01:16.004232654 947146 0x561448bb8c00 INFO                     DSL src/DslSourceMeter.h:116:GetSessionFpsAvg:  : Source '0' session FPS avg = 30.2348
0.000000 30.234792 
0:01:18.006348650 947146 0x561448bb8c00 INFO                     DSL src/DslSourceMeter.h:116:GetSessionFpsAvg:  : Source '0' session FPS avg = 30.2348
FPS 0 (AVG)
0.000000 30.234792 
0:01:20.008461214 947146 0x561448bb8c00 INFO                     DSL src/DslSourceMeter.h:116:GetSessionFpsAvg:  : Source '0' session FPS avg = 30.2348
0.000000 30.234792 
0:01:22.010574568 947146 0x561448bb8c00 INFO