Kinesis video streams is one of the easiest way to stream your videos to internet. We will try it today using a raspberry pi.
I am using the below hardware for streaming video.
Hardware that I will use:
Raspberry pi - https://www.raspberrypi.org/products/raspberry-pi-4-model-b/
1. On raspberry pi
Enable camera by running below and selecting appropriate options
sudo apt-get install byacc flex sudo apt-get install cmake git clone https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp --recursive
Note: Do not miss –recursive flag. If you miss it it will result in compilation errors later due to missing submodules.
git checkout 5080cba # checking out to this commit will ensure that the steps below will work (Can't guarantee submodules though).
cd amazon-kinesis-video-streams-producer-sdk-cpp/ && mkdir build && cd build
time cmake .. -DBUILD_GSTREAMER_PLUGIN=ON
It took 17 minutes to run on my raspberry pi 4b
This took another 1 minute 33 seconds
This will produce some binaries in your build folder like:
You can use the above ninaries to push video streams to a kinesis video stream on AWS.
Let’s set the credentials in environment variables first
export AWS_ACCESS_KEY_ID=<Access Key ID> export AWS_SECRET_ACCESS_KEY=<Secret Access Key>
Now let’s stream
kinesis_video_gstreamer_sample_app <name of your kinesis video stream>
2. On your laptop
Get the stream viewer:
open the index.html file in browser. Pass the 1. AWS credentials 1. stream name
Click “Start Playback”. You are done.