awslabs / amazon-kinesis-video-streams-producer-sdk-cpp

Amazon Kinesis Video Streams Producer SDK for C++ is for developers to install and customize for their connected camera and other devices to securely stream video, audio, and time-encoded data to Kinesis Video Streams.
Apache License 2.0
376 stars 337 forks source link

[QUESTION] kvssink is taking 2 minutes to shut down after EOS is sent to the Gstreamer pipeline #1199

Closed bkovacs-orca closed 3 weeks ago

bkovacs-orca commented 2 months ago

I have a Gstreamer pipeline that ends with kvssink, and sometimes it is taking 2 minutes to shut down after EOS is sent to the Gstreamer pipeline. In what situations is this possible? What can be the reason for this?

Logging I don't have logs yet, because I don't have an easy way to reproduce this case, it happens sporadically.

Any design considerations/constraints Using the following Gstreamer pipeline:

appsrc name=appsrcvideo block=false leaky-type=downstream max-bytes=5000000 ! h264parse name=parser ! kvssink name=kvssink stream-name=X storage-size=512 streaming-type=2 file-start-time=0 retention-period=1 access-key=X secret-key=X aws-region=us-west-2 stream-tags=X  appsrc name=appsrcaudio block=false leaky-type=downstream max-bytes=5000000 ! audio/mpeg,mpegversion=4,rate=(int)48000,channels=1,stream-format=(string)raw,codec_data=(buffer)1188 ! aacparse ! queue ! kvssink.
stefankiesz commented 2 months ago

Hi, can you please expand on how you are observing that an EOS is sent and what you consider as a kvssink shutdown?

bkovacs-orca commented 2 months ago

Hey Stefan,

Thanks for the reply. I send EOS with gst_element_send_event(pipeline, gst_event_new_eos());, so I know for a fact it's sent, I don't observe it any other way.

I consider the pipeline has shut down, including kvssink after the call below returns, but it's stuck here:

  gst_element_set_state(pipeline, GST_STATE_NULL);
bkovacs-orca commented 1 month ago

Following up on this. Do you need any more information to debug this? Thank you!

stefankiesz commented 1 month ago

Hey @bkovacs-orca, I'll be looking into this issue with dedicated time starting next week, apologies for the delay.

stefankiesz commented 1 month ago

@bkovacs-orca, it’s difficult to assess whether the shutdown delay originates from kvssink solely based on its presence in your pipeline. Could you please provide logs when they become available and, if possible, run some control experiments by replacing kvssink with other sink elements to see if the behavior persists?

niyatim23 commented 3 weeks ago

Closing due to staleness