I want to stream RTSP stream data to AWS Kinesis Video Streaming using network camera "XNO-6120R"
I want to stream RTSP stream data to AWS Kinesis Video Streaming using network camera "XNO-6120R". A simple configuration is as follows. Camera (XNO-6120R) --> Gstreamer (Ubuntu22.04 container) --> AWS KVS
After downloading the GStreamer package and building the AWS KVS SDK, I'm trying to transfer rtsp data with the following command, but an error is output.
- command1
./kvs_gstraemer_sample $STREAM_NAME $RTSP_URL 2>&1 | tee /log/rtsp2kvs-kvsSample.log
Output
Click to expand
[INFO ] [01-05-2023 07:28:37:713.777 GMT] Using region: ap-northeast-1 [INFO ] [01-05-2023 07:28:37:713.799 GMT] Using aws credentials for Kinesis Video Streams [INFO ] [01-05-2023 07:28:37:713.802 GMT] No session token was detected. [INFO ] [01-05-2023 07:28:37:714.361 GMT] createKinesisVideoClient(): Creating Kinesis Video Client [INFO ] [01-05-2023 07:28:37:714.385 GMT] heapInitialize(): Initializing native heap with limit size 134217728, spill ratio 0% and flags 0x00000001 [INFO ] [01-05-2023 07:28:37:714.388 GMT] heapInitialize(): Creating AIV heap. [INFO ] [01-05-2023 07:28:37:714.397 GMT] heapInitialize(): Heap is initialized OK [DEBUG] [01-05-2023 07:28:37:714.449 GMT] getSecurityTokenHandler invoked [DEBUG] [01-05-2023 07:28:37:714.463 GMT] Refreshing credentials. Force refreshing: 0 Now time is: 1682926117714454898 Expiration: 0 [INFO ] [01-05-2023 07:28:37:714.467 GMT] New credentials expiration is 1682929717 [INFO ] [01-05-2023 07:28:37:714.477 GMT] createDeviceResultEvent(): Create device result event. [DEBUG] [01-05-2023 07:28:37:714.482 GMT] clientReadyHandler invoked [DEBUG] [01-05-2023 07:28:37:714.497 GMT] Client is ready [INFO ] [01-05-2023 07:28:37:714.526 GMT] Creating Kinesis Video Stream stream-test-20230424 [INFO ] [01-05-2023 07:28:37:714.538 GMT] createKinesisVideoStream(): Creating Kinesis Video Stream. [INFO ] [01-05-2023 07:28:37:714.542 GMT] logStreamInfo(): SDK version: e99e7e94d897f309c773cb3bb677cab5c9b5f587 [DEBUG] [01-05-2023 07:28:37:714.545 GMT] logStreamInfo(): Kinesis Video Stream Info [DEBUG] [01-05-2023 07:28:37:714.547 GMT] logStreamInfo(): Stream name: stream-test-20230424 [DEBUG] [01-05-2023 07:28:37:714.550 GMT] logStreamInfo(): Streaming type: STREAMING_TYPE_REALTIME [DEBUG] [01-05-2023 07:28:37:714.552 GMT] logStreamInfo(): Content type: video/h264 [DEBUG] [01-05-2023 07:28:37:714.555 GMT] logStreamInfo(): Max latency (100ns): 600000000 [DEBUG] [01-05-2023 07:28:37:714.558 GMT] logStreamInfo(): Fragment duration (100ns): 20000000 [DEBUG] [01-05-2023 07:28:37:714.565 GMT] logStreamInfo(): Key frame fragmentation: Yes [DEBUG] [01-05-2023 07:28:37:714.567 GMT] logStreamInfo(): Use frame timecode: Yes [DEBUG] [01-05-2023 07:28:37:714.570 GMT] logStreamInfo(): Absolute frame timecode: Yes [DEBUG] [01-05-2023 07:28:37:714.572 GMT] logStreamInfo(): Nal adaptation flags: 0 [DEBUG] [01-05-2023 07:28:37:714.575 GMT] logStreamInfo(): Average bandwith (bps): 4194304 [DEBUG] [01-05-2023 07:28:37:714.577 GMT] logStreamInfo(): Framerate: 25 [DEBUG] [01-05-2023 07:28:37:714.580 GMT] logStreamInfo(): Buffer duration (100ns): 1200000000 [DEBUG] [01-05-2023 07:28:37:714.582 GMT] logStreamInfo(): Replay duration (100ns): 400000000 [DEBUG] [01-05-2023 07:28:37:714.585 GMT] logStreamInfo(): Connection Staleness duration (100ns): 600000000 [DEBUG] [01-05-2023 07:28:37:714.587 GMT] logStreamInfo(): Store Pressure Policy: 1 [DEBUG] [01-05-2023 07:28:37:714.590 GMT] logStreamInfo(): View Overflow Policy: 1 [DEBUG] [01-05-2023 07:28:37:714.592 GMT] logStreamInfo(): Segment UUID: NULL [DEBUG] [01-05-2023 07:28:37:714.595 GMT] logStreamInfo(): Frame ordering mode: 0 [DEBUG] [01-05-2023 07:28:37:714.597 GMT] logStreamInfo(): Track list [DEBUG] [01-05-2023 07:28:37:714.600 GMT] logStreamInfo(): Track id: 1 [DEBUG] [01-05-2023 07:28:37:714.602 GMT] logStreamInfo(): Track name: kinesis_video [DEBUG] [01-05-2023 07:28:37:714.605 GMT] logStreamInfo(): Codec id: V_MPEG4/ISO/AVC [DEBUG] [01-05-2023 07:28:37:714.607 GMT] logStreamInfo(): Track type: TRACK_INFO_TYPE_VIDEO [DEBUG] [01-05-2023 07:28:37:714.610 GMT] logStreamInfo(): Track cpd: NULL [INFO ] [01-05-2023 07:28:37:929.061 GMT] writeHeaderCallback(): RequestId: ce6bbea4-ff93-464f-a324-6c04b757cc26 [DEBUG] [01-05-2023 07:28:37:929.103 GMT] describeStreamCurlHandler(): DescribeStream API response: {"StreamInfo":{"CreationTime":1.682322102808E9,"DataRetentionInHours":24,"DeviceName":null,"IngestionConfiguration":null,"KmsKeyId":"xxx","MediaType":null,"Status":"ACTIVE","Stre (kvs_gstreamer_sample:1114): GStreamer-WARNING **: 07:28:38.165: External plugin loader failed. This most likely means that the plugin loader helper binary was not found or could not be run. You might need to set the GST_PLUGIN_SCANNER environment variable if your setup is unusual. This should normally not be required though. amARN":"xxx","StreamName":"stream-test-20230424","Version":"TZsORArcf5fLv5mCq0IR"}} [INFO ] [01-05-2023 07:28:37:929.770 GMT] describeStreamResultEvent(): Describe stream result event. [WARN ] [01-05-2023 07:28:37:929.791 GMT] describeStreamResult(): Retention period returned from the DescribeStream call doesn't match the one specified in the StreamInfo [WARN ] [01-05-2023 07:28:37:929.793 GMT] describeStreamResult(): Content type returned from the DescribeStream call doesn't match the one specified in the StreamInfo [INFO ] [01-05-2023 07:28:38:157.736 GMT] writeHeaderCallback(): RequestId: 9a4a52f3-f75a-46f1-8795-bb1b5ff51522 [DEBUG] [01-05-2023 07:28:38:157.770 GMT] getStreamingEndpointCurlHandler(): GetStreamingEndpoint API response: {"DataEndpoint":"xxx"} [INFO ] [01-05-2023 07:28:38:158.180 GMT] getStreamingEndpointResultEvent(): Get streaming endpoint result event. [DEBUG] [01-05-2023 07:28:38:158.197 GMT] getStreamingTokenHandler invoked [DEBUG] [01-05-2023 07:28:38:158.205 GMT] Refreshing credentials. Force refreshing: 1 Now time is: 1682926118158203675 Expiration: 1682929717 [INFO ] [01-05-2023 07:28:38:158.209 GMT] New credentials expiration is 1682929718 [INFO ] [01-05-2023 07:28:38:158.217 GMT] getStreamingTokenResultEvent(): Get streaming token result event. [DEBUG] [01-05-2023 07:28:38:158.225 GMT] streamReadyHandler invoked [DEBUG] [01-05-2023 07:28:38:158.362 GMT] Stream is ready [INFO ] [01-05-2023 07:28:38:166.388 GMT] Streaming from rtsp source New pad found: recv_rtp_src_0_3929480219_26 [INFO ] [01-05-2023 07:28:38:253.416 GMT] Pad link failed New pad found: recv_rtp_src_1_45886901_107
GST_DEBUG=6 rtsp2kvs-kvsSample_level6.log
- command2
gst-launch-1.0 rtspsrc location=$RTSP_URL protocols=udp short-header=TRUE ! \ rtph264depay ! \ h264parse ! \ kvssink stream-name=$STREAM_NAME 2>&1 | tee /log/rtsp2kvs-gstLaunch.log
Output
Click to expand
(gst-launch-1.0:1065): GStreamer-WARNING **: 07:27:45.151: External plugin loader failed. This most likely means that the plugin loader helper binary was not found or could not be run. You might need to set the GST_PLUGIN_SCANNER environment variable if your setup is unusual. This should normally not be required though. Setting pipeline to PAUSED ... [INFO ] [01-05-2023 07:27:45:161.642 GMT] createKinesisVideoClient(): Creating Kinesis Video Client [INFO ] [01-05-2023 07:27:45:161.692 GMT] heapInitialize(): Initializing native heap with limit size 134217728, spill ratio 0% and flags 0x00000001 [INFO ] [01-05-2023 07:27:45:161.697 GMT] heapInitialize(): Creating AIV heap. [INFO ] [01-05-2023 07:27:45:161.712 GMT] heapInitialize(): Heap is initialized OK [DEBUG] [01-05-2023 07:27:45:161.777 GMT] getSecurityTokenHandler invoked [DEBUG] [01-05-2023 07:27:45:161.787 GMT] Refreshing credentials. Force refreshing: 0 Now time is: 1682926065161783781 Expiration: 0 [INFO ] [01-05-2023 07:27:45:161.796 GMT] createDeviceResultEvent(): Create device result event. [DEBUG] [01-05-2023 07:27:45:161.803 GMT] clientReadyHandler invoked [INFO ] [01-05-2023 07:27:45:161.826 GMT] try creating stream [INFO ] [01-05-2023 07:27:45:161.841 GMT] Creating Kinesis Video Stream stream-test-20230424 [INFO ] [01-05-2023 07:27:45:161.847 GMT] createKinesisVideoStream(): Creating Kinesis Video Stream. [INFO ] [01-05-2023 07:27:45:161.860 GMT] logStreamInfo(): SDK version: e99e7e94d897f309c773cb3bb677cab5c9b5f587 [DEBUG] [01-05-2023 07:27:45:161.864 GMT] logStreamInfo(): Kinesis Video Stream Info [DEBUG] [01-05-2023 07:27:45:161.868 GMT] logStreamInfo(): Stream name: stream-test-20230424 [DEBUG] [01-05-2023 07:27:45:161.872 GMT] logStreamInfo(): Streaming type: STREAMING_TYPE_REALTIME [DEBUG] [01-05-2023 07:27:45:161.876 GMT] logStreamInfo(): Content type: video/h264 [DEBUG] [01-05-2023 07:27:45:161.880 GMT] logStreamInfo(): Max latency (100ns): 600000000 [DEBUG] [01-05-2023 07:27:45:161.884 GMT] logStreamInfo(): Fragment duration (100ns): 20000000 [DEBUG] [01-05-2023 07:27:45:161.888 GMT] logStreamInfo(): Key frame fragmentation: Yes [DEBUG] [01-05-2023 07:27:45:161.893 GMT] logStreamInfo(): Use frame timecode: Yes [DEBUG] [01-05-2023 07:27:45:161.896 GMT] logStreamInfo(): Absolute frame timecode: Yes [DEBUG] [01-05-2023 07:27:45:161.900 GMT] logStreamInfo(): Nal adaptation flags: 0 [DEBUG] [01-05-2023 07:27:45:161.904 GMT] logStreamInfo(): Average bandwith (bps): 4194304 [DEBUG] [01-05-2023 07:27:45:161.908 GMT] logStreamInfo(): Framerate: 25 [DEBUG] [01-05-2023 07:27:45:161.912 GMT] logStreamInfo(): Buffer duration (100ns): 1200000000 [DEBUG] [01-05-2023 07:27:45:161.916 GMT] logStreamInfo(): Replay duration (100ns): 400000000 [DEBUG] [01-05-2023 07:27:45:161.919 GMT] logStreamInfo(): Connection Staleness duration (100ns): 600000000 [DEBUG] [01-05-2023 07:27:45:161.924 GMT] logStreamInfo(): Store Pressure Policy: 1 [DEBUG] [01-05-2023 07:27:45:161.928 GMT] logStreamInfo(): View Overflow Policy: 1 [DEBUG] [01-05-2023 07:27:45:161.932 GMT] logStreamInfo(): Segment UUID: NULL [DEBUG] [01-05-2023 07:27:45:161.936 GMT] logStreamInfo(): Frame ordering mode: 0 [DEBUG] [01-05-2023 07:27:45:161.940 GMT] logStreamInfo(): Track list [DEBUG] [01-05-2023 07:27:45:161.944 GMT] logStreamInfo(): Track id: 1 [DEBUG] [01-05-2023 07:27:45:161.948 GMT] logStreamInfo(): Track name: kinesis_video [DEBUG] [01-05-2023 07:27:45:161.952 GMT] logStreamInfo(): Codec id: V_MPEG4/ISO/AVC [DEBUG] [01-05-2023 07:27:45:161.955 GMT] logStreamInfo(): Track type: TRACK_INFO_TYPE_VIDEO [DEBUG] [01-05-2023 07:27:45:161.959 GMT] logStreamInfo(): Track cpd: NULL [INFO ] [01-05-2023 07:27:45:372.623 GMT] writeHeaderCallback(): RequestId: 1a5b505b-9c0a-467b-91b8-bf151fe12615 [DEBUG] [01-05-2023 07:27:45:372.666 GMT] describeStreamCurlHandler(): DescribeStream API response: {"StreamInfo":{"CreationTime":1.682322102808E9,"DataRetentionInHours":24,"DeviceName":null,"IngestionConfiguration":null,"KmsKeyId":"arn:xxx","MediaType":null,"Status":"ACTIVE","StreamARN":"xxx","StreamName":"stream-test-20230424","Version":"TZsORArcf5fLv5mCq0IR"}} [INFO ] [01-05-2023 07:27:45:373.222 GMT] describeStreamResultEvent(): Describe stream result event. [WARN ] [01-05-2023 07:27:45:373.234 GMT] describeStreamResult(): Retention period returned from the DescribeStream call doesn't match the one specified in the StreamInfo [WARN ] [01-05-2023 07:27:45:373.242 GMT] describeStreamResult(): Content type returned from the DescribeStream call doesn't match the one specified in the StreamInfo [INFO ] [01-05-2023 07:27:45:563.142 GMT] writeHeaderCallback(): RequestId: 8c933c7d-832e-4308-bd7e-a691672d30ba [DEBUG] [01-05-2023 07:27:45:563.179 GMT] getStreamingEndpointCurlHandler(): GetStreamingEndpoint API response: {"DataEndpoint":"xxx"} [INFO ] [01-05-2023 07:27:45:563.701 GMT] getStreamingEndpointResultEvent(): Get streaming endpoint result event. [DEBUG] [01-05-2023 07:27:45:563.719 GMT] getStreamingTokenHandler invoked [DEBUG] [01-05-2023 07:27:45:563.727 GMT] Refreshing credentials. Force refreshing: 1 Now time is: 1682926065563724704 Expiration: 18446744073709551615 [INFO ] [01-05-2023 07:27:45:563.739 GMT] getStreamingTokenResultEvent(): Get streaming token result event. [DEBUG] [01-05-2023 07:27:45:563.750 GMT] streamReadyHandler invoked Stream is ready 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://192.168.0.100:554/0/onvif/profile1/media.smp Progress: (open) Retrieving server options Progress: (open) Retrieving media info Progress: (request) SETUP stream 0 Progress: (request) SETUP stream 1 Progress: (open) Opened Stream Setting pipeline to PLAYING ... New clock: GstSystemClock Progress: (request) Sending PLAY request Redistribute latency... Redistribute latency... Progress: (request) Sending PLAY request Redistribute latency... Redistribute latency... Progress: (request) Sent PLAY request Redistribute latency... Redistribute latency... Redistribute latency... WARNING: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Delayed linking failed. Additional debug info: gst/parse/grammar.y(540): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: failed delayed linking some pad of GstRTSPSrc named rtspsrc0 to some pad of GstRtpH264Depay named rtph264depay0 Redistribute latency...
GST_DEBUG=6 rtsp2kvs-gstLaunch_level6.log
By the way, it correctly works on other systems that output RTSP stream data.
ex)
- rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4
- Live-Reporter (link)
Please help me.