Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU): Jetson AGX Xavier
• DeepStream Version: 5.0
• JetPack Version (valid for Jetson only): 4.4
• TensorRT Version: 7.1.3
• Issue Type( questions, new requirements, bugs): question
My pipeline:
Simplified:
queue -> appsink
/
v4l2src -> tee1
\
\ / queue -> videosink
queue -> tee2
\
queue -> filesink
Code for appsink:
[...]
/* The appsink has received a buffer */
static GstFlowReturn new_sample(GstElement *sink, gpointer *data)
{
GstSample *sample;
/* Retrieve the buffer */
sample = gst_app_sink_pull_sample(GST_APP_SINK(sink));
if (gst_app_sink_is_eos(GST_APP_SINK(sink)))
{
g_print("EOS received in Appsink********\n");
}
if (sample)
{
/* print a * to indicate a received buffer */
g_print("*");
sleep(1);
gst_sample_unref(sample);
return GST_FLOW_OK;
}
return GST_FLOW_ERROR;
}
[...]
int main(int argc, char *argv[])
{
[...]
g_signal_connect(appsink, "new-sample", G_CALLBACK(new_sample), NULL);
[...]
}
The use case: when a buffer arrive at appsink with metadata attached by nvinfer, the appsink read the metadata and if a condition is met, call function A, after X amount of time, call function B. I tried to simulate this with the sleep() function but doing that lead to many loss frame from the source and affect the result of other sinks in the pipeline:
v4l2src gstv4l2src.c:976:gst_v4l2src_create:<camera-source> lost frames detected: count = 28 - ts: 0:00:12.084989155
I think the reason why the issue happens is because the appsink couldn’t keep up the the source element due to the delay introduced (i.e., wait for X amount of time before calling function B), which is why we see v4l2src reports lost frames and prevent those lost frames to be received by other sinks (videosink and filesink). Is that correct?
I’m not sure how to solve this issue, any pointer would be appreciated.