0

I am using Kinesis Video Streaming for a solution and I am facing some problems with few RTSP sources. To all rtsp sources I am also validating on VLC and it is working well, except for a huge delay to start to stream the video.

I am using gst-launch-1.0 to stream to Kinesis

gst-launch-1.0 -q rtspsrc location=MYRTSP_URL short-header=TRUE ! rtph264depay ! h264parse ! kvssink stream-name=MYSTREAM_NAME storage-size=128 access-key=MYACCESS_KEY secret-key=MYSECRET_KEY aws-region=us-east-1 retention-period=168

Below there is result after command execution:

log4cplus:ERROR could not open file ../kvs_log_configuration
INFO - createKinesisVideoClient(): Creating Kinesis Video Client

2022-07-04 19:37:21 [140474457073472] INFO - heapInitialize(): Initializing native heap with limit size 134217728, spill ratio 0% and flags 0x00000001

2022-07-04 19:37:21 [140474457073472] INFO - heapInitialize(): Creating AIV heap.
2022-07-04 19:37:21 [140474457073472] INFO - heapInitialize(): Heap is initialized OK
2022-07-04 19:37:21 [140474457073472] DEBUG - getSecurityTokenHandler invoked
2022-07-04 19:37:21 [140474457073472] DEBUG - Refreshing credentials. Force refreshing: 0 Now time is: 1656963441548249256 Expiration: 0
2022-07-04 19:37:21 [140474457073472] INFO - createDeviceResultEvent(): Create device result event.
2022-07-04 19:37:21 [140474457073472] DEBUG - clientReadyHandler invoked
2022-07-04 19:37:21 [140474457073472] INFO - try creating stream
2022-07-04 19:37:21 [140474457073472] INFO - Creating Kinesis Video Stream MYSTREAM_NAME
2022-07-04 19:37:21 [140474457073472] INFO - createKinesisVideoStream(): Creating Kinesis Video Stream.
2022-07-04 19:37:21 [140474457073472] INFO - logStreamInfo(): SDK version: 70f74f14cf27b09f71dc1889f36eb6e04cdd90a8
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Kinesis Video Stream Info
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Stream name: MYSTREAM_NAME
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Streaming type: STREAMING_TYPE_REALTIME
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Content type: video/h264
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Max latency (100ns): 600000000
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Fragment duration (100ns): 20000000
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Key frame fragmentation: Yes
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Use frame timecode: Yes
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Absolute frame timecode: Yes
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Nal adaptation flags: 0
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Average bandwith (bps): 4194304
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Framerate: 25
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Buffer duration (100ns): 1200000000
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Replay duration (100ns): 400000000
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Connection Staleness duration (100ns): 600000000
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Store Pressure Policy: 1
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): View Overflow Policy: 1
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Segment UUID: NULL
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Frame ordering mode: 0
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Track list
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Track id: 1
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Track name: kinesis_video
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Codec id: V_MPEG4/ISO/AVC
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Track type: TRACK_INFO_TYPE_VIDEO
2022-07-04 19:37:21 [140474457073472] DEBUG - logStreamInfo(): Track cpd: NULL
2022-07-04 19:37:21 [140474457073472] INFO - writeHeaderCallback(): RequestId: 9165f977-7fe3-413b-9b22-6ac81a5f7e8a
2022-07-04 19:37:22 [140474293741120] DEBUG - describeStreamCurlHandler(): DescribeStream API response: {"StreamInfo":{"CreationTime":1.656961857643E9,"DataRetentionInHours":168,"DeviceName":"Kinesis_Video_Device","IngestionConfiguration":null,"KmsKeyId":"arn:aws:kms:us-east-1:MYACCOUNT_NUMBER:alias/aws/kinesisvideo","MediaType":"video/h264","Status":"ACTIVE","StreamARN":"arn:aws:kinesisvideo:us-east-1:MYACCOUNT_NUMBER:stream/MYSTREAM_NAME/1656961857643","StreamName":"MYSTREAM_NAME","Version":"MYVERSION"}}
2022-07-04 19:37:22 [140474293741120] INFO - describeStreamResultEvent(): Describe stream result event.
2022-07-04 19:37:22 [140474293741120] INFO - writeHeaderCallback(): RequestId: 65213fea-917f-4d14-88d6-fb854d3a08cd
2022-07-04 19:37:22 [140474285348416] DEBUG - getStreamingEndpointCurlHandler(): GetStreamingEndpoint API response: {"DataEndpoint":"https://AAAAAAA.kinesisvideo.us-east-1.amazonaws.com"}
2022-07-04 19:37:22 [140474285348416] INFO - getStreamingEndpointResultEvent(): Get streaming endpoint result event.
2022-07-04 19:37:22 [140474285348416] DEBUG - getStreamingTokenHandler invoked
2022-07-04 19:37:22 [140474285348416] DEBUG - Refreshing credentials. Force refreshing: 1 Now time is: 1656963442867748518 Expiration: 18446744073709551615
2022-07-04 19:37:22 [140474285348416] INFO - getStreamingTokenResultEvent(): Get streaming token result event.
2022-07-04 19:37:22 [140474285348416] DEBUG - streamReadyHandler invoked
2022-07-04 19:37:22 [140474285348416] Stream is ready
INFO - kinesisVideoStreamFormatChanged(): Stream format changed.

DEBUG - Dropping frame with flag: 97920:02:08.5 / 99:99:99.
2022-07-04 19:39:31 [140473742124608] INFO - putStreamResultEvent(): Put stream result event. New upload handle 0
INFO - writeHeaderCallback(): RequestId: dc9a7e24-b124-5e42-87a7-3a109b2af291
2022-07-04 19:39:32 [140473750517312]
DEBUG - Dropping frame with flag: 1536
DEBUG - postReadCallback(): Pausing CURL read for upload handle: 0

DEBUG - Dropping frame with flag: 15360:02:10.0 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:10.6 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:11.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:12.6 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:13.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:14.6 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:15.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:16.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:17.6 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:18.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:19.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:20.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:21.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:22.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:23.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:24.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:25.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:26.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:27.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:28.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:29.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:30.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:31.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:32.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:33.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:34.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:35.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:36.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:37.5 / 99:99:99.
WARN - curlCompleteSync(): curl perform failed for url https://AAAAAAA.kinesisvideo.us-east-1.amazonaws.com/putMedia with result Timeout was reached: Operation too slow. Less than 30 bytes/sec transferred the last 30 seconds
2022-07-04 19:40:02 [140473750517312] WARN - curlCompleteSync(): HTTP Error 0 : Response: (null) Request URL: https://AAAAAAA.kinesisvideo.us-east-1.amazonaws.com/putMedia Request Headers: Authorization: AWS4-HMAC-SHA256 Credential=MYACCESS_KEY/
20220704/us-east-1/kinesisvideo/aws4_request, SignedHeaders=connection;host;transfer-encoding;user-agent;x-amz-date;x-amzn-fragment-acknowledgment-required;x-amzn-fragment-timecode-type;x-amzn-producer-start-timestamp;x-amzn-stream-name, Signature=4c548d1966bfc9d90980b92b71409750a85cd756ed23271
2022-07-04 19:40:02 [140473750517312] DEBUG - putStreamCurlHandler(): Network thread for Kinesis Video stream: MYSTREAM_NAME with upload handle: 0 exited. http status: 0
2022-07-04 19:40:02 [140473750517312] WARN - putStreamCurlHandler(): Stream with streamHandle 94086962655504 uploadHandle 0 has exited without triggering end-of-stream. Service call result: 599
2022-07-04 19:40:02 [140473750517312] INFO - kinesisVideoStreamTerminated(): Stream 0x559253fcb110 terminated upload handle 0 with service call result 599.
2022-07-04 19:40:02 [140473750517312] DEBUG - defaultStreamStateTransitionHook(): Stream state machine retry count: 0
2022-07-04 19:40:02 [140473750517312] DEBUG - defaultStreamStateTransitionHook(): KinesisVideoStream base result is [599]. Executing KVS retry handler of retry strategy type [1]
DEBUG - Dropping frame with flag: 15360:02:39.4 / 99:99:99.
2022-07-04 19:40:02 [140473742124608] DEBUG - defaultStreamStateTransitionHook(): Stream state machine retry count: 1
2022-07-04 19:40:02 [140473742124608] DEBUG - defaultStreamStateTransitionHook(): KinesisVideoStream base result is [599]. Executing KVS retry handler of retry strategy type [1]
2022-07-04 19:40:02 [140473742124608] DEBUG - streamReadyHandler invoked
2022-07-04 19:40:02 [140473742124608] DEBUG - defaultStreamStateTransitionHook(): Stream state machine retry count: 2
2022-07-04 19:40:02 [140473742124608] DEBUG - defaultStreamStateTransitionHook(): KinesisVideoStream base result is [599]. Executing KVS retry handler of retry strategy type [1]
2022-07-04 19:40:02 [140473742124608] INFO - putStreamResultEvent(): Put stream result event. New upload handle 1
DEBUG - Dropping frame with flag: 15360:02:39.6 / 99:99:99.
INFO - writeHeaderCallback(): RequestId: dc2f1583-c74c-3c15-8712-51d03e572d8f
DEBUG - postReadCallback(): Pausing CURL read for upload handle: 1
DEBUG - Dropping frame with flag: 15360:02:41.4 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:41.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:42.6 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:43.6 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:44.6 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:45.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:46.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:47.6 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:48.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:49.6 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:50.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:51.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:52.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:53.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:54.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:55.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:56.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:57.5 / 99:99:99.
DEBUG - Dropping frame with flag: 15360:02:58.5 / 99:99:99.

After receive this output I closed it using CTRL+C.

Anyone knows what can be done to solve this problem?

Thanks in advance.

1 Answers1

0

Solved by replacing /cam/realmonitor?channel=1&subtype=0 by /cam/realmonitor?channel=1&subtype=0 on RTSP, on Linux & is a reserved character.