Sending video data to AWS Kinesis Video Stream

Apollo Software Labs
1 min readMay 16, 2022

--

AWS Kinesis video stream Producer SDK allows you to easily send video data to KVS Stream for further processing. But unfortunately, the KVS Producer SDK 1.x version does not account for usage from behind a corporate proxy.

Other AWS SDKs such as the AWS S3 SDK 1.x and 2.x versions provides easy configuration to interact even when you are behind corporate proxy. For example, Here is a snippet to list contents of an S3 bucket using AWS S3 SDK 2.x version.

But in order to put video media data into Kinesis Video Stream for further processing, AmazonKinesisVideoPutMedia client class does not allow us to inject the underlying http connector with proxy configuration. This is a known issue with aws-java-sdk-kinesisvideo 1.x version. See bug report https://github.com/aws/aws-sdk-java/issues/2180

I am not sure why this has not been addressed in 1.x version of the SDK, especially since this functionality doesn't seem available in 2.x version yet. See https://github.com/aws/aws-sdk-java-v2/issues/1330

Hence, a work around for aws-java-sdk-kinesisvideo 1.x version is needed. The original bug reporter, luclement, created a pull request with the workaround — https://github.com/aws/aws-sdk-java/pull/2246/files

I forked AWS SDK 1.12.218 and updated the files to allow us to pass proxy configuration when creating AmazonKinesisVideoPutMedia client. See https://github.com/krishna-thotakura/aws-sdk-java

Build and package using command below.

mvn package -DskipTests -Dgpg.skip=true

Then mvn local install the modified aws-java-sdk-kinesisvideo jar and use it in your project as shown below.

--

--

Apollo Software Labs
Apollo Software Labs

Written by Apollo Software Labs

Hands-on Solution Architect passionate about building secure, scalable, and high performance solutions in the cloud.

No responses yet