awslabs / amazon-kinesis-video-streams-producer-c

https://awslabs.github.io/amazon-kinesis-video-streams-producer-c/group__PublicMemberFunctions.html
Apache License 2.0
55 stars 77 forks source link

Kinesis Video Stream with Dahua/Intelbras RTSP URl #312

Closed winnermartins closed 2 years ago

winnermartins commented 2 years ago

Hello Weveryone, I am trying to put the following RTSP into KVS using Gstreamer, but it is not working. The RTSP that belongs to Dahua and Intelbras Cameras.

I am performing the following command:

gst-launch-1.0 rtspsrc location=rtsp://MYRTSPANDCREDENTIALS:554/cam/realmonitor?channel=11&subtype=1 ! rtph264depay ! h264parse ! kvssink stream-name=MYSTREAMNAME storage-size=128 access-key=MYACCESSKEY secret-key=MYSECRETKEY aws-region=us-east-1 retention-period=168

And got the following Error, not that in bold line the &subtype=1 was supressed, I also tried to replace the & with an %26, withou success.

[2] 42753 Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... Progress: (open) Opening Stream Pipeline is PREROLLED ... Prerolled, waiting for progress to finish... Progress: (connect) Connecting to rtsp://MYRTSPANDCREDENTIALS:554/cam/realmonitor?channel=11 !: command not found Progress: (open) Retrieving server options Progress: (open) Retrieving media info ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Not found Additional debug info: ../gst/rtsp/gstrtspsrc.c(6736): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Not Found (404) ERROR: pipeline doesn't want to preroll. Setting pipeline to NULL ... Freeing pipeline ...

Has anyone faced this problem in the past?

hassanctech commented 2 years ago

This is a pretty common use case so it should work without issue, I would advise you to open this question against the cpp sdk which actually contains the kvssink plugin.

Have you tried to open that url in VLC player and verify that it plays?

If it plays fine there then see here we have example pipelines with what you're trying to do:

https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/blob/master/docs/linux.md

The first thing I'd try here is to set the short-header=TRUE property on rtspsrc

winnermartins commented 2 years ago

This is a pretty common use case so it should work without issue, I would advise you to open this question against the cpp sdk which actually contains the kvssink plugin.

Have you tried to open that url in VLC player and verify that it plays?

If it plays fine there then see here we have example pipelines with what you're trying to do:

https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/blob/master/docs/linux.md

The first thing I'd try here is to set the short-header=TRUE property on rtspsrc

The problem was solved by replacing /cam/realmonitor?channel=1&subtype=0 by /cam/realmonitor?channel=1&subtype=0 (& by \&) on RTSP, on Linux & is a reserved character. There was also a configuration on some cameras where the I-Frames interval were set to 50 seconds, according to what I`ve been searching the limit of kvssink is 10 seconds. The main stream was set to exactly 10 seconds, but the latency of the network were the cameras are installed is very high and unstable making some I-frames lost/dropped so I reduced this interval to 2 seconds.