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
379 stars 334 forks source link

no fragments found in kinesis video stream #170

Closed sujithaperumal closed 5 years ago

sujithaperumal commented 5 years ago

I tried streaming video from my laptop webcam to KVS using MinGW(c++ producer SDK). But it shows no fragments found. I have a lenovo ideapad y700 laptop. When run in MinGW, the following log was found.

(gst-launch-1.0:12932): GStreamer-WARNING **: 01:10:21.774: Failed to load plugin 'C:\msys64\mingw64\lib\gstreamer-1.0\libgstx265.dll': 'C:\msys64\mingw64\lib\gstreamer-1.0\libgstx265.dll': The specified procedure could not be found. Setting pipeline to PAUSED ... [INFO ][2019-02-06 19:40:21] Initializing curl. [INFO ][2019-02-06 19:40:21] createKinesisVideoClient(): Creating Kinesis Video Client [INFO ][2019-02-06 19:40:21] heapInitialize(): Initializing native heap with limit size 10485760, spill ratio 0% and flags 0x00000001 [INFO ][2019-02-06 19:40:21] heapInitialize(): Creating AIV heap. [INFO ][2019-02-06 19:40:21] heapInitialize(): Heap is initialized OK [INFO ][2019-02-06 19:40:21] Refreshing credentials. Force refreshing: 0 Now time is: 1549482021798189800 Expiration: 0 [INFO ][2019-02-06 19:40:21] New credentials expiration is 1549484421 [DEBUG][2019-02-06 19:40:21] createDeviceHandler invoked [INFO ][2019-02-06 19:40:21] createDeviceResultEvent(): Create device result event. [DEBUG][2019-02-06 19:40:21] clientReadyHandler invoked [DEBUG][2019-02-06 19:40:21] Awaiting for the producer to become ready... [DEBUG][2019-02-06 19:40:21] Kinesis Video producer is Ready. [INFO ][2019-02-06 19:40:21] try creating stream [INFO ][2019-02-06 19:40:21] Creating Kinesis Video Stream ExampleStream [INFO ][2019-02-06 19:40:21] createKinesisVideoStream(): Creating Kinesis Video Stream. [DEBUG][2019-02-06 19:40:21] describeStreamHandler invoked [DEBUG][2019-02-06 19:40:21] Awaiting for the stream to become ready... [INFO ][2019-02-06 19:40:21] Refreshing credentials. Force refreshing: 0 Now time is: 1549482021799832400 Expiration: 0 [DEBUG][2019-02-06 19:40:23] describeStream response: {"StreamInfo":{"CreationTime":1.549478491599E9,"DataRetentionInHours":2,"DeviceName":"Kinesis_Video_Device","KmsKeyId":"arn:aws:kms:us-west-2:073686542274:alias/aws/kinesisvideo","MediaType":"video/h264","Status":"ACTIVE","StreamARN":"arn:aws:kinesisvideo:us-west-2:073686542274:stream/ExampleStream/1549478491599","StreamName":"ExampleStream","Version":"vv3HSwA86BBEqZZyCimR"}} [INFO ][2019-02-06 19:40:23] Discovered existing Kinesis Video stream: arn:aws:kinesisvideo:us-west-2:073686542274:stream/ExampleStream/1549478491599 [INFO ][2019-02-06 19:40:23] stream arn in stream_info struct: arn:aws:kinesisvideo:us-west-2:073686542274:stream/ExampleStream/1549478491599 [INFO ][2019-02-06 19:40:23] describeStreamResultEvent(): Describe stream result event. [DEBUG][2019-02-06 19:40:23] streamingEndpointHandler invoked [INFO ][2019-02-06 19:40:23] Refreshing credentials. Force refreshing: 0 Now time is: 1549482023699084600 Expiration: 0 [DEBUG][2019-02-06 19:40:25] getStreamingEndpoint response: {"DataEndpoint":"https://s-4010bf70.kinesisvideo.us-west-2.amazonaws.com"} [INFO ][2019-02-06 19:40:25] streaming to endpoint: https://s-4010bf70.kinesisvideo.us-west-2.amazonaws.com [INFO ][2019-02-06 19:40:25] getStreamingEndpointResultEvent(): Get streaming endpoint result event. [DEBUG][2019-02-06 19:40:25] streamingTokenHandler invoked [INFO ][2019-02-06 19:40:25] Refreshing credentials. Force refreshing: 1 Now time is: 1549482025045338000 Expiration: 1549484421 [INFO ][2019-02-06 19:40:25] New credentials expiration is 1549484425 [INFO ][2019-02-06 19:40:25] getStreamingTokenResultEvent(): Get streaming token result event. [DEBUG][2019-02-06 19:40:25] streamReadyHandler invoked [DEBUG][2019-02-06 19:40:25] Kinesis Video stream ExampleStream is Ready. Stream is ready Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... New clock: GstSystemClock Redistribute latency... [INFO ][2019-02-06 19:40:28] try starting stream. Stream handle: 53458096 [INFO ][2019-02-06 19:40:28] kinesisVideoStreamFormatChanged(): Stream format changed. [DEBUG][2019-02-06 19:40:28] putStreamHandler invoked [DEBUG][2019-02-06 19:40:28] Created a new PutMedia request with stream upload handle: 0 [INFO ][2019-02-06 19:40:28] putStreamResultEvent(): Put stream result event. [INFO ][2019-02-06 19:40:28] getKinesisVideoStreamMetrics(): Get stream metrics for Stream 00000000032fb4b0. [INFO ][2019-02-06 19:40:28] getKinesisVideoMetrics(): Get the memory metrics size. [INFO ][2019-02-06 19:40:28] Creating new connection for Kinesis Video stream: ExampleStream [INFO ][2019-02-06 19:40:28] Refreshing credentials. Force refreshing: 0 Now time is: 1549482028871138300 Expiration: 0 [DEBUG][2019-02-06 19:40:28] Kinesis Video client and stream metrics

Overall storage byte size: 10485760 Available storage byte size: 10478760 Allocated storage byte size: 7000 Total view allocation byte size: 144072 Total streams frame rate (fps): 25 Total streams transfer rate (bps): 33554432 (32768 Kbps) Current view duration (ms): 2 Overall view duration (ms): 2 Current view byte size: 6959 Overall view byte size: 6959 Current frame rate (fps): 25 Current transfer rate (bps): 33554432 (32768 Kbps) [DEBUG][2019-02-06 19:40:30] Curl post header write function returned:HTTP/1.1 100 Continue

[DEBUG][2019-02-06 19:40:30] Curl post header write function returned:

[DEBUG][2019-02-06 19:40:30] Wrote 16372 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:30] Wrote 9917 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:30] Pausing CURL read for upload handle: 0 [DEBUG][2019-02-06 19:40:30] Curl post header write function returned:HTTP/1.1 200 OK

[DEBUG][2019-02-06 19:40:30] Curl post header write function returned:x-amzn-RequestId: f5de3f84-a818-4ba1-b34e-dbbd4ac27fb8

[DEBUG][2019-02-06 19:40:30] Curl post header write function returned:Content-Type: application/json

[DEBUG][2019-02-06 19:40:30] Curl post header write function returned:Transfer-Encoding: chunked

[DEBUG][2019-02-06 19:40:30] Curl post header write function returned:Date: Wed, 06 Feb 2019 19:40:29 GMT

[DEBUG][2019-02-06 19:40:30] Curl post header write function returned:

[INFO ][2019-02-06 19:40:31] Curl post body write function for stream: ExampleStream and upload handle: 0 returned: {"EventType":"BUFFERING","FragmentTimecode":0,"FragmentNumber":"91343852333181447247962534042408424052728840414"}

[DEBUG][2019-02-06 19:40:31] fragmentAckReceivedHandler invoked [DEBUG][2019-02-06 19:40:31] Wrote 11313 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:31] Pausing CURL read for upload handle: 0 [INFO ][2019-02-06 19:40:31] getKinesisVideoStreamMetrics(): Get stream metrics for Stream 00000000032fb4b0. [INFO ][2019-02-06 19:40:31] getKinesisVideoMetrics(): Get the memory metrics size. [DEBUG][2019-02-06 19:40:31] Kinesis Video client and stream metrics

Overall storage byte size: 10485760 Available storage byte size: 10423477 Allocated storage byte size: 62283 Total view allocation byte size: 144072 Total streams frame rate (fps): 16 Total streams transfer rate (bps): 30295360 (29585 Kbps) Current view duration (ms): 802 Overall view duration (ms): 2993 Current view byte size: 23097 Overall view byte size: 60397 Current frame rate (fps): 16.2896 Current transfer rate (bps): 30295360 (29585 Kbps) [DEBUG][2019-02-06 19:40:32] Wrote 16372 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:32] Wrote 10529 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:32] Pausing CURL read for upload handle: 0 [INFO ][2019-02-06 19:40:32] Curl post body write function for stream: ExampleStream and upload handle: 0 returned: {"EventType":"RECEIVED","FragmentTimecode":0,"FragmentNumber":"91343852333181447247962534042408424052728840414"}

[DEBUG][2019-02-06 19:40:32] fragmentAckReceivedHandler invoked [DEBUG][2019-02-06 19:40:32] Wrote 16372 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:32] Wrote 1282 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:32] Pausing CURL read for upload handle: 0 [INFO ][2019-02-06 19:40:32] Curl post body write function for stream: ExampleStream and upload handle: 0 returned: {"EventType":"BUFFERING","FragmentTimecode":2991,"FragmentNumber":"91343852333181447252914294199549945587511433104"}

[DEBUG][2019-02-06 19:40:32] fragmentAckReceivedHandler invoked [INFO ][2019-02-06 19:40:32] Curl post body write function for stream: ExampleStream and upload handle: 0 returned: {"EventType":"PERSISTED","FragmentTimecode":0,"FragmentNumber":"91343852333181447247962534042408424052728840414"}

[DEBUG][2019-02-06 19:40:32] fragmentAckReceivedHandler invoked [DEBUG][2019-02-06 19:40:32] Wrote 4189 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:32] Pausing CURL read for upload handle: 0 [DEBUG][2019-02-06 19:40:33] Wrote 16372 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:33] Wrote 3780 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:33] Pausing CURL read for upload handle: 0 [DEBUG][2019-02-06 19:40:33] Wrote 1314 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:33] Pausing CURL read for upload handle: 0 [INFO ][2019-02-06 19:40:33] getKinesisVideoStreamMetrics(): Get stream metrics for Stream 00000000032fb4b0. [INFO ][2019-02-06 19:40:33] getKinesisVideoMetrics(): Get the memory metrics size. [DEBUG][2019-02-06 19:40:33] Kinesis Video client and stream metrics

Overall storage byte size: 10485760 Available storage byte size: 10414189 Allocated storage byte size: 71571 Total view allocation byte size: 144072 Total streams frame rate (fps): 15 Total streams transfer rate (bps): 26004600 (25395 Kbps) Current view duration (ms): 66 Overall view duration (ms): 2130 Current view byte size: 12258 Overall view byte size: 70218 Current frame rate (fps): 15.5586 Current transfer rate (bps): 26004600 (25395 Kbps) [DEBUG][2019-02-06 19:40:34] Wrote 16372 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:34] Wrote 16372 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:34] Wrote 3862 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:34] Pausing CURL read for upload handle: 0 [INFO ][2019-02-06 19:40:35] Curl post body write function for stream: ExampleStream and upload handle: 0 returned: {"EventType":"RECEIVED","FragmentTimecode":2991,"FragmentNumber":"91343852333181447252914294199549945587511433104"}

[DEBUG][2019-02-06 19:40:35] fragmentAckReceivedHandler invoked [DEBUG][2019-02-06 19:40:35] Wrote 14035 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:35] Pausing CURL read for upload handle: 0 [INFO ][2019-02-06 19:40:35] Curl post body write function for stream: ExampleStream and upload handle: 0 returned: {"EventType":"BUFFERING","FragmentTimecode":5119,"FragmentNumber":"91343852333181447257866054356691467453493616643"}

[DEBUG][2019-02-06 19:40:35] fragmentAckReceivedHandler invoked [INFO ][2019-02-06 19:40:35] Curl post body write function for stream: ExampleStream and upload handle: 0 returned: {"EventType":"PERSISTED","FragmentTimecode":2991,"FragmentNumber":"91343852333181447252914294199549945587511433104"}

[DEBUG][2019-02-06 19:40:35] fragmentAckReceivedHandler invoked [DEBUG][2019-02-06 19:40:35] Wrote 2939 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:35] Pausing CURL read for upload handle: 0 [DEBUG][2019-02-06 19:40:36] Wrote 15764 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:36] Pausing CURL read for upload handle: 0 [INFO ][2019-02-06 19:40:36] getKinesisVideoStreamMetrics(): Get stream metrics for Stream 00000000032fb4b0. [INFO ][2019-02-06 19:40:36] getKinesisVideoMetrics(): Get the memory metrics size. [DEBUG][2019-02-06 19:40:36] Kinesis Video client and stream metrics

Overall storage byte size: 10485760 Available storage byte size: 10398459 Allocated storage byte size: 87301 Total view allocation byte size: 144072 Total streams frame rate (fps): 15 Total streams transfer rate (bps): 22331160 (21807 Kbps) Current view duration (ms): 338 Overall view duration (ms): 2994 Current view byte size: 17878 Overall view byte size: 85415 Current frame rate (fps): 15.3219 Current transfer rate (bps): 22331160 (21807 Kbps) [DEBUG][2019-02-06 19:40:37] Wrote 16372 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:37] Wrote 8565 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:37] Pausing CURL read for upload handle: 0 [INFO ][2019-02-06 19:40:38] Curl post body write function for stream: ExampleStream and upload handle: 0 returned: {"EventType":"RECEIVED","FragmentTimecode":5119,"FragmentNumber":"91343852333181447257866054356691467453493616643"}

[DEBUG][2019-02-06 19:40:38] fragmentAckReceivedHandler invoked [DEBUG][2019-02-06 19:40:38] Wrote 5830 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:38] Pausing CURL read for upload handle: 0 [INFO ][2019-02-06 19:40:38] Curl post body write function for stream: ExampleStream and upload handle: 0 returned: {"EventType":"BUFFERING","FragmentTimecode":8111,"FragmentNumber":"91343852333181447262817814513832989291304493906"}

[DEBUG][2019-02-06 19:40:38] fragmentAckReceivedHandler invoked [INFO ][2019-02-06 19:40:38] Curl post body write function for stream: ExampleStream and upload handle: 0 returned: {"EventType":"PERSISTED","FragmentTimecode":5119,"FragmentNumber":"91343852333181447257866054356691467453493616643"}

[DEBUG][2019-02-06 19:40:38] fragmentAckReceivedHandler invoked [DEBUG][2019-02-06 19:40:38] Wrote 2276 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:38] Pausing CURL read for upload handle: 0 [DEBUG][2019-02-06 19:40:39] Wrote 10363 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:39] Pausing CURL read for upload handle: 0 [INFO ][2019-02-06 19:40:39] getKinesisVideoStreamMetrics(): Get stream metrics for Stream 00000000032fb4b0. [INFO ][2019-02-06 19:40:39] getKinesisVideoMetrics(): Get the memory metrics size. [DEBUG][2019-02-06 19:40:39] Kinesis Video client and stream metrics

Overall storage byte size: 10485760 Available storage byte size: 10426526 Allocated storage byte size: 59234 Total view allocation byte size: 144072 Total streams frame rate (fps): 15 Total streams transfer rate (bps): 19165400 (18716 Kbps) Current view duration (ms): 530 Overall view duration (ms): 2994 Current view byte size: 18799 Overall view byte size: 57348 Current frame rate (fps): 15.2386 Current transfer rate (bps): 19165400 (18716 Kbps) [DEBUG][2019-02-06 19:40:40] Wrote 16372 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:40] Wrote 7160 bytes to Kinesis Video. Upload stream handle: 0 [DEBUG][2019-02-06 19:40:40] Pausing CURL read for upload handle: 0 [INFO ][2019-02-06 19:40:40] Curl post body write function for stream: ExampleStream and upload handle: 0 returned: {"EventType":"RECEIVED","FragmentTimecode":8111,"FragmentNumber":"91343852333181447262817814513832989291304493906"}

I don't know what is happening here. Can anyone please help me? Thanks in advance!

zhiyua-git commented 5 years ago

Can you check if you are trying to view the video in us-west-2(Oregon) region?

Thanks, -ZH

sujithaperumal commented 5 years ago

@zhiyua-git I did just now. It works now. Thanks!