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
Add 'kvs_gstreamer_webcam.cpp' file for webcam streaming #1170
Issue #, if available:
Not an issue but this is a newer version of a previous pull request (#1168) that I deleted (made a new fork because I had forked only the master branch by accident) so I can create a branch off the "develop" branch and merge into it.
Description of changes:
Added "kvs_gstreamer_webcam.cpp" source code file inside the "samples" directory. It provides a straightforward way to create a video stream from your built-in webcam to kinesis video streams that is tagged with event metadata for automatic image generation and suitable for use in an image generation configuration.
The code builds the following pipeline: "gst-launch-1.0 autovideosrc ! videoconvert ! video/x-raw, format=I420,width=640,height=480,framerate=30/1 ! vtenc_h264_hw allow-frame-reordering=FALSE realtime=TRUE max-keyframe-interval=45 bitrate=500 ! h264parse ! video/x-h264,stream format=avc,alignment=au,profile=baseline ! appsink".
The stream is also tagged with the appropriate metadata (as already mentioned).
I also modified the "CMakeLists.txt" to compile the file into executables in the "build" folder with the rest of the sample ".cpp" files. It works great and is a straight-forward out-of-the-box solution to spin up a stream from your webcam to KVS and have it tagged with the appropriate metadata as well.
Recently I was creating a prototype for recognizing periodical screenshots from video stream data in KVS with Amazon Rekognition. I really needed to test the accuracy of the model and the only way I could test it into the dev stage was to use the web camera of my Mac. However, starting a stream through the command did not allow me to tag the frame with metadata for image generation. I could not find a trivial solution so I spent a few days on creating the "kvs_gstreamer_webcam.cpp" source code to solve my needs. While developing it I made sure to follow the structure of the rest of the "sample" files. It works great and is a straight-forward solution for anyone struggling with the same problems as I did for a long time.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Issue #, if available: Not an issue but this is a newer version of a previous pull request (#1168) that I deleted (made a new fork because I had forked only the master branch by accident) so I can create a branch off the "develop" branch and merge into it. Description of changes: Added "kvs_gstreamer_webcam.cpp" source code file inside the "samples" directory. It provides a straightforward way to create a video stream from your built-in webcam to kinesis video streams that is tagged with event metadata for automatic image generation and suitable for use in an image generation configuration. The code builds the following pipeline: "gst-launch-1.0 autovideosrc ! videoconvert ! video/x-raw, format=I420,width=640,height=480,framerate=30/1 ! vtenc_h264_hw allow-frame-reordering=FALSE realtime=TRUE max-keyframe-interval=45 bitrate=500 ! h264parse ! video/x-h264,stream format=avc,alignment=au,profile=baseline ! appsink". The stream is also tagged with the appropriate metadata (as already mentioned). I also modified the "CMakeLists.txt" to compile the file into executables in the "build" folder with the rest of the sample ".cpp" files. It works great and is a straight-forward out-of-the-box solution to spin up a stream from your webcam to KVS and have it tagged with the appropriate metadata as well.
Recently I was creating a prototype for recognizing periodical screenshots from video stream data in KVS with Amazon Rekognition. I really needed to test the accuracy of the model and the only way I could test it into the dev stage was to use the web camera of my Mac. However, starting a stream through the command did not allow me to tag the frame with metadata for image generation. I could not find a trivial solution so I spent a few days on creating the "kvs_gstreamer_webcam.cpp" source code to solve my needs. While developing it I made sure to follow the structure of the rest of the "sample" files. It works great and is a straight-forward solution for anyone struggling with the same problems as I did for a long time.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.