GithubHelp home page GithubHelp logo

awslabs / amazon-kinesis-video-streams-producer-sdk-cpp Goto Github PK

View Code? Open in Web Editor NEW
370.0 53.0 329.0 15.26 MB

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.

License: Apache License 2.0

C++ 95.10% CMake 2.76% C 2.14%

amazon-kinesis-video-streams-producer-sdk-cpp's Introduction

Amazon Kinesis Video Streams CPP Producer, GStreamer Plugin and JNI

Amazon Kinesis Video Streams | Secure Video Ingestion for Analysis & Storage

Coverage Status

Key FeaturesBuildRunDocumentationRelatedLicense

Key Features

  • C++ SDK
  • GStreamer Plugin (kvssink)
  • JNI

Amazon Kinesis Video Streams Producer SDK for C/C++ makes it easy to build an on-device application that securely connects to a video stream, and reliably publishes video and other media data to Kinesis Video Streams. It takes care of all the underlying tasks required to package the frames and fragments generated by the device's media pipeline. The SDK also handles stream creation, token rotation for secure and uninterrupted streaming, processing acknowledgements returned by Kinesis Video Streams, and other tasks.

Build

Download

To download run the following command:

git clone https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp.git

Note: You will also need to install pkg-config, CMake, m4 and a build enviroment. If you are building the GStreamer plugin you will also need GStreamer and GStreamer (Development Libraries).

Refer to the FAQ for platform specific instructions.

Configure

Prepare a build directory in the newly checked out repository:

mkdir -p amazon-kinesis-video-streams-producer-sdk-cpp/build
cd amazon-kinesis-video-streams-producer-sdk-cpp/build

If you are building on Windows you need to generate NMake Makefiles, you should run cmake .. -G "NMake Makefiles"

GStreamer and JNI is NOT built by default, if you wish to build both you MUST execute cmake .. -DBUILD_GSTREAMER_PLUGIN=ON -DBUILD_JNI=TRUE

By default we download all the libraries from GitHub and build them locally, so should require nothing to be installed ahead of time.

If you do wish to link to existing libraries you can do cmake .. -DBUILD_DEPENDENCIES=OFF Libraries needed to build producer are: Curl, Openssl and Log4cplus. If you want to build the gstreamer plugin you will need to have gstreamer in your system. On Mac OS you can get the libraries using homebrew

$ brew install pkg-config openssl cmake gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly log4cplus gst-libav

On Ubuntu and Raspberry Pi OS you can get the libraries by running

$ sudo apt-get install libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools

Setup desired log level:

Set up the desired log level. The log levels currently available with log4cplus are:

  1. TRACE
  2. DEBUG
  3. INFO
  4. WARN
  5. ERROR
  6. FATAL

To set a log level, update the log level value here

Note: The default log level is DEBUG

Cross-Compilation

If you wish to cross-compile CC and CXX are respected when building the library and all its dependencies. See our ci.yml for an example of this. Every commit is cross compiled to ensure that it continues to work. Please note that GStreamer is not cross-compiled as a part of the cross-compilation of the KVS-SDK, customers will have to cross-compile it separately.

CMake Arguments

You can pass the following options to cmake ...

  • -DBUILD_GSTREAMER_PLUGIN -- Build kvssink GStreamer plugin
  • -DBUILD_JNI -- Build C++ wrapper for JNI to expose the functionality to Java/Android
  • -DBUILD_DEPENDENCIES -- Build depending libraries from source
  • -DBUILD_TEST=TRUE -- Build unit/integration tests, may be useful for confirm support for your device. ./tst/producerTest
  • -DCODE_COVERAGE -- Enable coverage reporting
  • -DCOMPILER_WARNINGS -- Enable all compiler warnings
  • -DADDRESS_SANITIZER -- Build with AddressSanitizer
  • -DMEMORY_SANITIZER -- Build with MemorySanitizer
  • -DTHREAD_SANITIZER -- Build with ThreadSanitizer
  • -DUNDEFINED_BEHAVIOR_SANITIZER Build with UndefinedBehaviorSanitizer
  • -DALIGNED_MEMORY_MODEL Build for aligned memory model only devices. Default is OFF.
  • -DBUILD_LOG4CPLUS_HOST Specify host-name for log4cplus for cross-compilation. Default is OFF.

To Include JNI

JNI examples are NOT built by default. If you wish to build JNI you MUST add -DBUILD_JNI=TRUE when running cmake:

cmake -DBUILD_JNI=TRUE

To Include Building GStreamer Sample Programs

The GStreamer plugin and samples are NOT built by default. If you wish to build them you MUST add -DBUILD_GSTREAMER_PLUGIN=TRUE when running cmake:

cmake -DBUILD_GSTREAMER_PLUGIN=TRUE ..

Compiling

After running cmake, in the same build directory run make:

make

On Windows you should run nmake instead of make

In your build directory you will now have shared objects for all the targets you have selected.

Installing the library

If the library needs to be installed, run make install. This will install in default directory based on system. To install in another directory, run cmake with the -DCMAKE_INSTALL_PREFIX option with the desired directory before running make install

Run

GStreamer Plugin (kvssink)

Loading Element

The GStreamer plugin is located in your build directory.

To load this plugin set the following environment variables. This should be run from the root of the repo, NOT the build directory.

export GST_PLUGIN_PATH=`pwd`/build
export LD_LIBRARY_PATH=`pwd`/open-source/local/lib

The equivalent for Windows is

set GST_PLUGIN_PATH=%CD%\build
set PATH=%PATH%;%CD%\open-source\local\bin;%CD%\open-source\local\lib

Now if you execute gst-inspect-1.0 kvssink you should get information on the plugin like

Factory Details:
  Rank                     primary + 10 (266)
  Long-name                KVS Sink
  Klass                    Sink/Video/Network
  Description              GStreamer AWS KVS plugin
  Author                   AWS KVS <[email protected]>

Plugin Details:
  Name                     kvssink
  Description              GStreamer AWS KVS plugin
  Filename                 /Users/seaduboi/workspaces/amazon-kinesis-video-streams-producer-sdk-cpp/build/libgstkvssink.so
  Version                  1.0
  License                  Proprietary
  Source module            kvssinkpackage
  Binary package           GStreamer
  Origin URL               http://gstreamer.net

If the build failed, or GST_PLUGIN_PATH is not properly set you will get output like

No such element or plugin 'kvssink'

Using Element

The kvssink element has the following required parameters:

  • stream-name -- The name of the destination Kinesis video stream.
  • storage-size -- The storage size of the device in megabytes. For information about configuring device storage, see StorageInfo.
  • access-key -- The AWS access key that is used to access Kinesis Video Streams. You must provide either this parameter or credential-path.
  • secret-key -- The AWS secret key that is used to access Kinesis Video Streams. You must provide either this parameter or credential-path.
  • credential-path -- A path to a file containing your credentials for accessing Kinesis Video Streams. For example credential files, see Sample Static Credential and Sample Rotating Credential. For more information on rotating credentials, see Managing Access Keys for IAM Users. You must provide either this parameter or access-key and secret-key.

For examples of common use cases you can look at Example: Kinesis Video Streams Producer SDK GStreamer Plugin

To Include Images/Events feature

The images feature is available in the sample kvs_gstreamer_audio_video_sample.cpp . To enable it include the argument "-e <event_option>" event option is a string that can be:

notification -- for a notification event image -- for an image event both -- for both

The events will start on the 2nd key frame, and will reoccur every 200 key frames. If you would to change this frequence you can edit the sample.

To run from a file

in the kvs_gstreamer_audio_video_sample.cpp if you would like to upload from a file, include the option flag -f <file_path>

Running in offline mode

By default, the samples run in near realtime mode. To set offline mode, set streamInfo.streamCaps.streamingType to STREAMING_TYPE_OFFLINE, where, streamInfo is of type StreamInfo, streamCaps is of type StreamCaps and streamingType is of type STREAMING_TYPE.

Dockerscripts

DEBUG

  • When building the JNI, if you run into a cmake error Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH), make sure your environment variables are set correctly:
    export JAVA_INCLUDE_PATH2=/Library/Java/JavaVirtualMachines/<YOUR_JDK_VERSION>/Contents/Home/include or export JAVA_INCLUDE_PATH2=$JAVA_HOME/include for Mac OS.
    export JAVA_INCLUDE_PATH2='/usr/java/<JDK_VERSION>/include' for Linux.
  • If you are successfully streaming but run into issue with playback. You can do export KVS_DEBUG_DUMP_DATA_FILE_DIR=/path/to/directory before streaming. Producer will then dump MKV files into that path. The file is exactly what KVS will receive. You can use MKVToolNIX to check that everything looks correct. You can also try to play the MKV file in compatible players.
  • If you would like to visualize the GStreamer pipeline being constructed in a GStreamer application, include the following after the elements have been linked: GST_DEBUG_BIN_TO_DOT_FILE(<gst-bin-object>, GST_DEBUG_GRAPH_SHOW_ALL, <file-name>); For example, if the application created a pipeline object GstPipeline* pipeline = gst_pipeline_new("test-pipeline"), and you would like to see the visualized pipeline with filename pipeline, add: GST_DEBUG_BIN_TO_DOT_FILE((GstBin*) pipeline, GST_DEBUG_GRAPH_SHOW_ALL, "pipeline");. Also ensure to set the path to where you would like the file to be stored. export GST_DEBUG_DUMP_DOT_DIR=.. The file generated would be a .dot format. Convert to PDF to check the visualized pipeline. Also, this requires graphviz to be installed. So make sure to install that.

FAQ

  • Is CPP-SDK and GStreamer supported on Mac/Windows/Linux (Supported Platforms)?
    Yes! We have FAQs and platform specific instructions for Windows, MacOS and Linux

Development

The repository is using develop branch as the aggregation and all of the feature development is done in appropriate feature branches. The PRs (Pull Requests) are cut on a feature branch and once approved with all the checks passed they can be merged by a click of a button on the PR tool. The master branch should always be build-able and all the tests should be passing. We are welcoming any contribution to the code base. The master branch contains our most recent release cycle from develop.

Release

The repository is under active development and even with incremental unit test coverage where some of the tests are actually full integration tests, we require more rigorous internal testing in order to 'cut' release versions. The release is cut against a particular commit that gets approved. The general philosophy is to cut a release when a set of commits contribute to a self-containing feature or when we add major internal functionality improvements.

Versioning

We deploy 3 digit version strings in a form of 'Major.Minor.Revision' scheme.

  • Major version update - Major functionality changes. Might not have direct backward compatibility. For example, multiple public API parameter changes.
  • Minor version update - Additional features. Major bug fixes. Might have some minor backward compatibility issues. For example, an extra parameter on a callback function.
  • Revision version update - Minor features. Bug fixes. Full backward compatibility. For example, an extra fields added to the public structures with version bump.

Related

License

This library is licensed under the Apache 2.0 License.

amazon-kinesis-video-streams-producer-sdk-cpp's People

Contributors

bdhandap avatar boomshadow avatar chehefen avatar ct83 avatar disa6302 avatar gherlein avatar hassanctech avatar hyandell avatar iann0036 avatar jdelapla avatar ketul93 avatar kumpelj avatar lherman-cs avatar llejoly avatar luiscosio avatar lummish avatar mm318 avatar mushmal avatar neino3 avatar niyatim23 avatar rejeangroleau avatar sean-der avatar sirknightj avatar stefankiesz avatar toshitanian avatar unicornss avatar vattay avatar waikup83 avatar yuma-m avatar zhiyua-git avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amazon-kinesis-video-streams-producer-sdk-cpp's Issues

Cannot turn off (redirect) the logs properly

Hi team,

First of all, I'd like to thank you for offering this awesome tool.

Currently, I'm working on integrating kinesis logs into our logging scheme. I've managed to deal with those generated from log4cplus but I found it tricky when dealing with those generated from DLOGX (those macros in PlatformUtils.h). To start with, I'd like to turn the log off (the next step would be to redirect them to a file), is there a way to achieve that without modifying source file?

Below are some of the logs that I hope to get rid of,
getKinesisVideoStreamMetrics(): Get stream metrics for Stream 0000000003ee1586.
getKinesisVideoMetrics(): Get the memory metrics size.

Thank you!

Regards
Edward

Curl SSL certificate problem on OS X

I built amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build on OS X.

However now when I run “./kinesis_video_gstreamer_sample_app VidTransDemo” I get this:

ERROR - curl perform failed for url https://kinesisvideo.us-west-2.amazonaws.com/describeStream with result Peer certificate cannot be authenticated with given CA certificates: SSL certificate problem: unable to get local issuer certificate

I realize that Kinesis Video Streams Produicer SDK for C++ needs to establish trust with the backend service through TLS and that there is a .pem file for this (SFSRootCAG2.pem), but although there are online instructions for installing the .pem file in Linux, I can’t find any info on how to install this properly on OS X.

Or maybe the curl could be configured to optionally use --insecure ?

Thanks!

Unable to stream

Hi,
I am unable to stream from RaspberryPi+Camera to Kinesis Video using the demo app. I am getting the following error (after fixing the region related error - Issue#9).

DEBUG - Stream is ready
Unable to set the pipeline to the playing state.

Any inputs on how to troubleshoot this error?

Thanks,
Babu Srinivasan

Install Script Issue - Ubuntu 17.10

The below error occurs up during the install script execution

Makefile:1696: recipe for target 'stage1scan.c' failed
make[2]: *** [stage1scan.c] Segmentation fault (core dumped)
make[2]: Leaving directory '/home/francois/downloads/flex-2.6.4/src'
Makefile:546: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/francois/downloads/flex-2.6.4/src'
Makefile:533: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
francois@francois-VirtualBox:~$

liblog4cplus-1.2.so.5 does not exist error

Hello.
I have builded producer SDK on Ubuntu 17.10 successfully but I am receiving following error appears when starting kinesis-video-native-build/start.

$ ./kinesis-video-native-build/start
./kinesis-video-native-build/start: error while loading shared libraries: liblog4cplus-1.2.so.5: cannot open shared object file: No such file or directory

I have not liblog4cplus 1.2.so.5 and I can not install it by apt-get, so I am in trouble.

liblog4cplus exists if it is 1.1-9.

$ apt-cache search liblog4cplus
liblog4cplus-1.1-9 - C++ logging API modeled after the Java log4j API - shared library
liblog4cplus-dbg - C++ logging API modeled after the Java log4j API - debug library
liblog4cplus-dev - C++ logging API modeled after the Java log4j API - development library

Storage used behind kinesis video streams

Hello

What's the storage system used as part of kinesis video stream services (whether S3 buckets or it has its own) and is it possible to stream the videos that are already created and stored in local device.

Regards
Arun.

Missing Mac Dependancy

lib-pkg is required to be installed on the mac (at least for High Sierra), but isn't mentioned in the readme. You may want to update it.

Failed to allocate heap

After compiling on a pi 2 B+ i was able to run all unit tests.
When i run the streamer (I exported variables for AWS Access / Secret keys and region) it gives the following error:
INFO - Initializing curl.

createKinesisVideoClient(): Creating Kinesis Video Client
heapInitialize(): Initializing native heap with limit size 536870912, spill ratio 0% and flags 0x00000001
heapInitialize(): Creating AIV heap.
aivHeapInit(): Failed to allocate heap with limit size 536870912
heapInitialize(): Failed to initialize native heap.
heapRelease(): Freeing native heap.
Segmentation fault

Can sample program send a 1920x1080 video by Camera V2?

Hello,

I want to send a 1920x1080 video using Raspberry Pi 3 and Raspberry Pi Camera V2.

I have been able to successfully run kinesis_video_gstreamer_sample_app using Rasp Pi 3 and Camera V2.
However, In the preview of Kinesis video stream it is displayed 1280x720.

Is it possible to send 1920x1080 video by Camera V2?

Missing codec private data error

Hello,

I am trying to execute the demo application and for that I build the application as instructed and executed ./start .

The error I am getting is attached:
1

As mentioned that this may be intermittent issue and can be resolved by refresh. However, does not seem to work for me yet.

Low FPS Latency

I have an issue when settings my camera FPS to 1fps. The delay from the camera to output on my app is about 1 minute. When i am streaming 24fps the delay is between 4 and 6 seconds - which is fine. But having a minute delay is just too long.

I assume this has something to do with buffer size? I set the buffer size in my AmazonKinesisVideoConfig to 1 but i still have the delay.

What can I do to reduce the delay (latency) when streaming at low fps?

I need it to be low as I want to stream from a security camera 24/7 - so need to keep my data usage low and I don't need more than 1fps.

Thanks!

Unable to set the source to ready state

Hi Guys,
I followed the AWS Kinesis and Pi tutorial and after comleting all the steps I am running into following error log:

getStreamingTokenResultEvent(): Get streaming token result event.DEBUG - Kinesis Video stream Kinesis_user is Ready.
DEBUG - Stream is ready
Unable to set the source to ready state.

freeKinesisVideoClient(): Freeing Kinesis Video ClientDEBUG - streamClosedHandler invoked

commonHeapDebugCheckAllocator(): Heap is initialized
commonHeapDebugCheckAllocator(): Heap limit: 536870912
commonHeapDebugCheckAllocator(): Heap size: 0
commonHeapDebugCheckAllocator(): Number of allocations: 0
aivHeapDebugCheckAllocator(): Allocated blocks pointer: (nil)
aivHeapDebugCheckAllocator(): *******************************************
aivHeapDebugCheckAllocator(): *******************************************
aivHeapDebugCheckAllocator(): Free blocks pointer: 0x5614b008
aivHeapDebugCheckAllocator(): *******************************************
aivHeapDebugCheckAllocator(): Block: 0x5614b008 size: 536870887
aivHeapDebugCheckAllocator(): *******************************************
heapRelease(): Freeing native heap.INFO - Freeing Kinesis Video Stream Kinesis_user

freeKinesisVideoStream(): Freeing Kinesis Video stream.INFO - Curl shutdown.

Any ideas please?

Frequent ERROR - Failed to submit frame to Kinesis Video client. status: 0x32000002 on Raspberry Pi Zero

Hello, I've been encountering the 0x32000002 status error when using the sample application on a Raspberry Pi Zero. The error occurs once in a while. At the moment, I am streaming the feed to AWS for safekeeping, and I am not particularly trying to consume the stream. I'm the repository at the commit 4b47f63. I've tweaked the application to use 128MB. GPU's shared memory is set to 128MB. (The Raspberry Pi Zero is limited to 512MB.)

This is what I know so far:

  • Once the error happens the application stops streaming and keeps showing the following message just after displaying getKinesisVideoMetrics:
ERROR - Failed to submit frame to Kinesis Video client. status: 0x32000002 decoding timestamp: 652886581679 presentation timestamp: 652885914643
Dropped frame!

Followed by multiple occurrences of this line:

viewItemRemoved(): Reporting a dropped frame/fragment.WARN - Reporting dropped frame. Frame timecode 651685460000
  • I used to believe that the error happened once a day, near some particular time of the day, but this is not always the case. Is it possible that some periodic network reset may have some incidence on the application?

  • Since the log grows fast and I don't want to write all of it to the SD card to prevent wear, I haven't kept the full log and I can't tell you yet what exactly is logged when the application breaks. What kind of filter should I use to in order to keep important error messages only? Is it possible improve debug logs and make the application stop altogether once the error happens?

  • After filtering the log stream (only keeping lines containing "error") and running the application again, I've seen this error happen:

ERROR - Failed to submit frame to Kinesis Video client. status: 0x32000002 decoding timestamp: 633887857006 presentation timestamp: 633887189960
INFO - Curl post body write function for stream: raspberrypi and upload handle: 42 returned: {"EventType":"ERROR","ErrorCode":"INVALID_MKV_DATA","ErrorId":4006}
ERROR - curl perform failed for url https://XXX.kinesisvideo.eu-west-1.amazonaws.com/putMedia with result Failed sending data to the peer: SSL_write() returned
 SYSCALL, errno = 104

Since that time, the error hasn't occurred, so I do not have any more information about this error.

  • These are the system specs:
cat /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

uname -r
4.9.59+
dpkg --get-selections | grep -i gst
gstreamer1.0-plugins-bad:armhf                  install
gstreamer1.0-plugins-base:armhf                 install
gstreamer1.0-plugins-good:armhf                 install
gstreamer1.0-plugins-ugly:armhf                 install
gstreamer1.0-tools                              install
gstreamer1.0-x:armhf                            install
libgstreamer-plugins-bad1.0-0:armhf             install
libgstreamer-plugins-base1.0-0:armhf            install
libgstreamer1.0-0:armhf                         install
dpkg --get-selections | grep -i x264
libx264-148:armhf                               install

How to send producer timestamp

When I run kinesis_video_gstreamer_sample_app, I can see video preview in server time stamps mode on AWS Web console. But in producer time stamps mode, I can't see video preview. I also checked producer time stamp with amazon-kinesis-video-streams-parser-library/src/main/java/com/amazonaws/kinesisvideo/parser/utilities/FragmentMetadata.java:FragmentMetadata.getProducerSideTimetampAsDate(). It returned Thu Feb 12 01:00:24 JST 1970 which seems to be incorrect. I thought it is caused by steady_clock and change it to system_clock but the result was still incorrect.

diff --git a/kinesis-video-pic/src/client/src/StreamState.cpp b/kinesis-video-pic/src/client/src/StreamState.cpp
index cbc684b..3537767 100644
--- a/kinesis-video-pic/src/client/src/StreamState.cpp
+++ b/kinesis-video-pic/src/client/src/StreamState.cpp
@@ -2,6 +2,7 @@
 * Implementation of a stream states callbacks
 */

+#include <chrono>
#define LOG_CLASS "StreamState"
#include "Include_i.h"

@@ -604,7 +605,7 @@ STATUS executePutStreamState(UINT64 customData, UINT64 time)
            pKinesisVideoClient->clientCallbacks.customData,
            pKinesisVideoStream->streamInfo.name,
            (PCHAR) MKV_CONTAINER_TYPE_STRING,
-            pKinesisVideoClient->clientCallbacks.getCurrentTimeFn(pKinesisVideoClient->clientCallbacks.customData),
+            std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::system_clock::now().time_since_epoch()).count() / DEFAULT_TIME_UNIT_IN_NANOS,
            pKinesisVideoStream->streamInfo.streamCaps.absoluteFragmentTimes,
            pKinesisVideoStream->streamInfo.streamCaps.fragmentAcks,
            pKinesisVideoStream->streamingEndpoint,

So how can I send producer timestamp to kinesis video stream?

How to Build Kinesis Producer cpp on windows

Hi,

In the document at the prerequisite section there is a paragraph saying:

Your NativeLibraryPath must contain your KinesisVideoProducerJNI file, available at https://
github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp. The file extension for this file
will depend on your operating system:
• KinesisVideoProducerJNI.so for Linux
• KinesisVideoProducerJNI.dylib for macOS
• KinesisVideoProducerJNI.dll for Windows (not currently available)
Note
Pre-built libraries are not currently available. You must build the libraries yourself for your
platform.

as stated that there is no ready scripts to build on windows, but how to do that?

Thanks

security token included in the request is invalid

Hello , i'm working in ubuntu 16.04 , trying to execute ./start but i have the following error

36d65efdd50075e09
    content-type: application/json
    host: kinesisvideo.us-east-1.amazonaws.com
    X-Amz-Date: 20180111T235218Z
2018-01-11 18:52:23 [139842008155904] DEBUG - describeStream response: 
2018-01-11 18:52:23 [139842008155904] INFO - Describe stream did not find the stream ebenezer in Kinesis Video (stream will be created)
2018-01-11 18:52:23 [139842008155904] 
describeStreamResultEvent(): Describe stream result event.DEBUG - describeStreamHandler invoked
2018-01-11 18:52:23 [139842008155904] INFO - Refreshing credentials. Force refreshing: 0 Now time is: 25192 Expiration: 0
2018-01-11 18:52:24 [139842016548608] WARN - HTTP Error 403: Response: {"message":"The security token included in the request is invalid."}
Request URL: https://kinesisvideo.us-east-1.amazonaws.com/describeStream
Request Headers:
    Authorization: AWS4-HMAC-SHA256 Credential=AccessKey/20180111/us-east-1/kinesisvideo/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=2cd756ea587308cb47c3a18aaadbe064fd6dbfd50b2c97a4fef411a6ebdd5ca0
    content-type: application/json
    host: kinesisvideo.us-east-1.amazonaws.com
    X-Amz-Date: 20180111T235224Z
2018-01-11 18:52:24 [139842016548608] DEBUG - describeStream response: {"message":"The security token included in the request is invalid."}
2018-01-11 18:52:24 [139842016548608] INFO - Describe stream did not find the stream ebenezer in Kinesis Video (stream will be created)
2018-01-11 18:52:24 [139842016548608] 
describeStreamResultEvent(): Describe stream result event.ERROR - Submitting event result for stream: 17557258 failed with: 1375731728
2018-01-11 18:52:24 [139842016548608] ERROR - Reporting stream error. Errored timecode 0 with status code 1375731728
2018-01-11 18:52:24 [139842016548608] ERROR - Failed to create Kinesis Video Stream - timed out.
2018-01-11 18:52:48 [139842209044288] INFO - Freeing Kinesis Video Stream ebenezer
2018-01-11 18:52:48 [139842209044288] 
freeKinesisVideoStream(): Freeing Kinesis Video stream.DEBUG - streamDataAvailableHandler invoked
2018-01-11 18:52:48 [139842209044288] DEBUG - streamClosedHandler invoked
2018-01-11 18:52:48 [139842209044288] unknown file: Failure
C++ exception with description "Failed to create Kinesis Video Stream - timed out." thrown in the test body.
INFO - Tearing down test: ProducerApiTest
2018-01-11 18:52:48 [139842209044288] 
freeKinesisVideoClient(): Freeing Kinesis Video Client
commonHeapDebugCheckAllocator(): Heap is initialized
commonHeapDebugCheckAllocator(): Heap limit: 				134217728
commonHeapDebugCheckAllocator(): Heap size: 				0
commonHeapDebugCheckAllocator(): Number of allocations: 				0
aivHeapDebugCheckAllocator(): Allocated blocks pointer: 				(nil)
aivHeapDebugCheckAllocator(): *******************************************
aivHeapDebugCheckAllocator(): *******************************************
aivHeapDebugCheckAllocator(): Free blocks pointer: 				0x7f2f82b9b014
aivHeapDebugCheckAllocator(): *******************************************
aivHeapDebugCheckAllocator(): Block:	0x7f2f82b9b014		size:	134217695
aivHeapDebugCheckAllocator(): *******************************************
heapRelease(): Freeing native heap.[  FAILED  ] ProducerApiTest.create_produce_stream (30003 ms)
[----------] 1 test from ProducerApiTest (30003 ms total)

[----------] Global test environment tear-down
[==========] 308 tests from 30 test cases ran. (32829 ms total)
[  PASSED  ] 307 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] ProducerApiTest.create_produce_stream

 1 FAILED TEST

cmake error :

hi everyone,

im building the environment using ./install-script-mac.
this is giving error like makefile recipe for target all failed.
hardware used : raspberry pi3
sdk used : c++

please help me.

Thanks

Not able to compile on Ubuntu

Greetings,

I am not able to compile. Please let me know if I have done something silly.

Thanks,

Ryan

Host: Linux ip-172-31-67-232 4.4.0-1043-aws #52-Ubuntu SMP Tue Dec 5 10:49:06 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

configure.ac:2457: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd
m4macros/gtk-doc.m4:7: GTK_DOC_CHECK is expanded from...
configure.ac:2457: the top level
configure.ac:2457: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd
m4macros/gtk-doc.m4:7: GTK_DOC_CHECK is expanded from...
configure.ac:2457: the top level
configure.ac:2457: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd
m4macros/gtk-doc.m4:7: GTK_DOC_CHECK is expanded from...
configure.ac:2457: the top level
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4macros'.
libtoolize: copying file 'm4macros/libtool.m4'
libtoolize: copying file 'm4macros/ltoptions.m4'
libtoolize: copying file 'm4macros/ltsugar.m4'
libtoolize: copying file 'm4macros/ltversion.m4'
libtoolize: copying file 'm4macros/lt~obsolete.m4'
configure.ac:2457: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd
m4macros/gtk-doc.m4:7: GTK_DOC_CHECK is expanded from...
configure.ac:2457: the top level
configure.ac:2457: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd
m4macros/gtk-doc.m4:7: GTK_DOC_CHECK is expanded from...
configure.ac:2457: the top level
configure.ac:2457: warning: PKG_PROG_PKG_CONFIG is m4_require'd but not m4_defun'd
m4macros/gtk-doc.m4:7: GTK_DOC_CHECK is expanded from...
configure.ac:2457: the top level
configure.ac:88: error: possibly undefined macro: AC_DEFINE
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

Failed to stream on OSX

Hi,

I'm trying to run kinesis_video_gstreamer_sample_app on my MacBook Pro with High Sierra (10.13.1). But I get this error:

getStreamingTokenResultEvent(): Get streaming token result event.DEBUG - Kinesis Video stream my_test_stream is Ready.
DEBUG - Stream is ready
Error received from element source-actual-src-avfvide: Internal data stream error.
Debugging information: gstbasesrc.c(2939): void gst_base_src_loop(GstPad *) (): /GstPipeline:test-pipeline/GstAutoVideoSrc:source/GstAVFVideoSrc:source-actual-src-avfvide:
streaming stopped, reason not-negotiated (-4)

Any ideas where I need to start troubleshooting?

It's trying to configure the video source in kinesis_video_gstreamer_sample_app.cpp with:

/* configure source */
    if (!vtenc) {
        g_object_set(G_OBJECT (data.source), "do-timestamp", TRUE, "device", "/dev/video0", NULL);
    }

But "/dev/video0" doesn't seem to exist..

/Jon

Link Error libssl.so.1.1

Hi ,

When building the demo project - at first I got the error : liblog4cplus-1.2.so.5: cannot open shared object file....after which - as suggested in installation instruction was to remove CMakeCache.txt and the CMake folder and run the install script again - which seem to have worked except now I'm getting the same error but for libssl.so.1.1. I did try repeating the steps but I still get the below error....

ERROR / KinesisVideo: 2018-02-22T20:09Z T1: EXCEPTION: UnsatisfiedLinkError: Unsatisfied link error. Loading native library KinesisVideoProducerJNI failed with java.lang.UnsatisfiedLinkError: /home/francois/Documents/Amazon/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/libKinesisVideoProducerJNI.so: libssl.so.1.1: cannot open shared object file: No such file or directory: /home/francois/Documents/Amazon/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/libKinesisVideoProducerJNI.so: libssl.so.1.1: cannot open shared object file: No such file or directory

How can I resolve this issue?

Thanks!

Doesn't start dummy streaming after unit test passed - OSX High sierra

Hi,

Updated access key, secret key and stream name. (stream created earlier)
Build success
Executed ./start from kinesis-video-stream-native-build directory
Below is last few lines of console output

[----------] 1 test from ProducerApiTest (835 ms total)
[----------] Global test environment tear-down
[==========] 309 tests from 30 test cases ran. (8579 ms total)
[  PASSED  ] 309 tests.
  YOU HAVE 1 DISABLED TEST
INFO - Curl shutdown.

In metrics I can see only Listfragments.latency not putmedia.incomingbytes

Not able to start Streaming

Hello,
I am new in kinesis video streaming service,when i try to run AWS_ACCESS_KEY_ID=################# AWS_SECRET_ACCESS_KEY=################# ./kinesis_video_gstreamer_sample_app my_stream

it gives me following error and not able to start streaming

getStreamingTokenResultEvent(): Get streaming token result event.DEBUG - Kinesis Video stream my_stream is Ready.
DEBUG - Stream is ready
Not all elements could be created.
INFO - Freeing Kinesis Video Stream my_stream

freeKinesisVideoStream(): Freeing Kinesis Video stream.DEBUG - streamDataAvailableHandler invoked
DEBUG - streamClosedHandler invoked

freeKinesisVideoClient(): Freeing Kinesis Video Client
commonHeapDebugCheckAllocator(): Heap is initialized
commonHeapDebugCheckAllocator(): Heap limit: 536870912
commonHeapDebugCheckAllocator(): Heap size: 0
commonHeapDebugCheckAllocator(): Number of allocations: 0
aivHeapDebugCheckAllocator(): Allocated blocks pointer: (nil)
aivHeapDebugCheckAllocator(): *******************************************
aivHeapDebugCheckAllocator(): *******************************************
aivHeapDebugCheckAllocator(): Free blocks pointer: 0x7f106928d010
aivHeapDebugCheckAllocator(): *******************************************
aivHeapDebugCheckAllocator(): Block: 0x7f106928d010 size: 536870879
aivHeapDebugCheckAllocator(): *******************************************
heapRelease(): Freeing native heap.INFO - Curl shutdown.

Execution environment

Hi,

I'm getting the following build error in Eclipse on Ubuntu 17.10

"Build path specifies execution environment JavaSE-1.7. There are no JREs installed in the workspace that are strictly compatible with this environment." kinesisvideo-java-demo

As per Install Steps for Ubuntu 17.x I installed openjdk-8-jdk

How can I resolve this issue?

Thanks!

Internal data stream error

Hello,

I am using Ubuntu system at the moment to execute the sample application. Another issue I am facing now is while executing the command AWS_ACCESS_KEY_ID=<my-access-key-id> AWS_SECRET_ACCESS_KEY=<my-secret-access-key> ./kinesis_video_gstreamer_sample_app my-test-stream
As i execute it, I get the error message as the following:

`INFO - Initializing curl.

createKinesisVideoClient(): Creating Kinesis Video Client
heapInitialize(): Initializing native heap with limit size 536870912, spill ratio 0% and flags 0x00000001
heapInitialize(): Creating AIV heap.
heapInitialize(): Heap is initialized OKINFO - Refreshing credentials. Force refreshing: 0 Now time is: 123156 Expiration: 0
INFO - New credentials expiration is 125556
DEBUG - createDeviceHandler invoked

createDeviceResultEvent(): Create device result event.DEBUG - Awaiting for the producer to become ready...
DEBUG - Kinesis Video producer is Ready.
DEBUG - Client is ready

createKinesisVideoStream(): Creating Kinesis Video Stream.DEBUG - describeStreamHandler invoked
DEBUG - Awaiting for the stream to become ready...
INFO - Refreshing credentials. Force refreshing: 0 Now time is: 123156 Expiration: 0
DEBUG - describeStream response: {"StreamInfo":{"CreationTime":1.513368609391E9,"DataRetentionInHours":2,"DeviceName":"Kinesis_Video_Device","KmsKeyId":"arn:aws:kms:us-west-2:123123123:alias/aws/kinesisvideo","MediaType":"video/h264","Status":"ACTIVE","StreamARN":"arn:aws:kinesisvideo:us-west-2:123123123:stream/my-test-stream/1231231231213","StreamName":"my-test-stream","Version":"BLBpBtdpsQ3NC44AMyEh"}}
INFO - Discovered existing Kinesis Video stream: arn:aws:kinesisvideo:us-west-2:123123123:stream/my-test-stream/12312312312312314456
INFO - stream arn in stream_info struct: arn:aws:kinesisvideo:us-west-2:123123123:stream/my-test-stream/12312312312312314456

describeStreamResultEvent(): Describe stream result event.DEBUG - streamingEndpointHandler invoked
INFO - Refreshing credentials. Force refreshing: 0 Now time is: 123157 Expiration: 0
DEBUG - getStreamingEndpoint response: {"DataEndpoint":"https://s-123123134.kinesisvideo.us-west-2.amazonaws.com"}
INFO - streaming to endpoint: https://s-123123134.kinesisvideo.us-west-2.amazonaws.com

getStreamingEndpointResultEvent(): Get streaming endpoint result event.DEBUG - streamingTokenHandler invoked
INFO - Refreshing credentials. Force refreshing: 1 Now time is: 123158 Expiration: 125556
INFO - New credentials expiration is 125558

getStreamingTokenResultEvent(): Get streaming token result event.DEBUG - Kinesis Video stream my-test-stream is Ready.
DEBUG - Stream is ready
**Error received from element source: Internal data stream error.**
**Debugging information: gstbasesrc.c(2939): gst_base_src_loop (): /GstPipeline:test-pipeline/GstV4l2Src:source:
streaming stopped, reason not-negotiated (-4)**

freeKinesisVideoClient(): Freeing Kinesis Video ClientDEBUG - streamDataAvailableHandler invoked
DEBUG - streamClosedHandler invoked`

I understood from the previously closed issue that it might has to be because of the activation of driver of my source. However, after the execution of sudo modprobe gspca_zc3xx; it does not seem to have worked and still throwing the same error.

Any hints / guidance what is the issue here and how to resolve ?

Note: All the ARN values and IDs mentioned here are mocked up and not for real use. The whole trace is pasted here only to provide a picture to guide through easily.

Issue with AWS region

Hi,
I pulled the latest update and tested the AWS region related fix (Issue #7).
DEBUG - Awaiting for the stream to become ready...
WARN - HTTP Error 403: Response: {"message":"The security token included in the request is invalid."}
Request URL: https://kinesisvideo.us-west-2.amazonaws.com/describeStream_

The API URI still contains us-west-2. I think the following code in DefaultCallbackProvider.cpp is the root cause.
951 if (control_plane_uri_.empty()) {
952 // Create a fully qualified URI
953 control_plane_uri_ = CONTROL_PLANE_URI_PREFIX
954 + KINESIS_VIDEO_SERVICE_NAME
955 + "."
956 + DEFAULT_AWS_REGION
957 + CONTROL_PLANE_URI_POSTFIX;

I replaced the variable DEFAULT_AWS_REGION with the variable region and tested it locally. The app is now picking up the correct API URI.

This may not be the right fix. The relationship between the variables "region" and "control_plane_uri" must be analyzed in detail to identify the appropriate fix.

Thanks
Babu Srinivasan

Publish Raspberry Pi Getting Started Example

@gauravgh, In issue #1 you make reference to a raspberry pi getting started guide. Do you have a link to the code referenced in this document. I am particularly interested in getting install_kinesis_video_demo.sh script and associated files.

Illegal Instruction

Hi-
I compiled everything from source on my pi. Per your ubuntu instructions i had to remove the cmake cache / files so it didn't use built-in libraries. When I run both the unit tests and the sample application I am getting the following output / error:
INFO - Initializing curl.
Illegal instruction

Tried to hunt down where this would get thrown to no avail. Any ideas?

Cannot manage logs properly

Hi team,

First of all, I'd like to thank you for offering this awesome tool.

Currently, I'm working on integrating kinesis logs into our logging scheme. I've managed to deal with those generated from log4cplus but I found it tricky when dealing with those generated from DLOGX (those macros in PlatformUtils.h). To start with, I'd like to turn the log off (the next step would be to redirect them to a file), is there a way to achieve that without modifying source file?

Below are some of the logs that I hope to get rid of,
getKinesisVideoStreamMetrics(): Get stream metrics for Stream 0000000003ee1586.
getKinesisVideoMetrics(): Get the memory metrics size.

Thank you!

Regards
Edward

GStreamer-CRITICAL **: gst_value_set_fraction_range_full: assertion

Hi.

Getting the following when on a Raspberry Pi with the compiled kinesis_video_gstreamer_sample_app compiled with min-install-script.

(kinesis_video_gstreamer_sample_app:570): GStreamer-CRITICAL **: gst_value_set_fraction_range_full: assertion 'gst_util_fraction_compare (numerator_start, denominator_start, numerator_end, denominator_end) < 0' failed

Thanks

Illegal Instruction during install-script

OS: OSX High Sierra - 10.13.3
Whilst running the install-script, I encountered the following error:

21171 Illegal instruction: 4 src/bison --version > doc/bison.help.tmp as well as several messages saying XXXX has no symbols

It looks as though this might be a known issue with bison on OSX 10.13. I've tried searching for workarounds but haven't been able to find any so far.

Are there any suggestions for a way round this? I've not got a C++ background so I'm a little bit in the dark on this. I'm only trying to build this as it's required for the Java demo app. Perhaps a Docker container with all the deps pre-installed would be useful here?

Detailed output:

...similar statements
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: lib/libbison.a(unistd.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: lib/libbison.a(wctype-h.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: lib/libbison.a(xsize.o) has no symbols
  CCLD     src/bison
  GEN      doc/bison.help
/bin/sh: line 1: 21171 Illegal instruction: 4  src/bison --version > doc/bison.help.tmp
make[2]: *** [doc/bison.help] Error 132
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

KinesisVideoClientWrapper.h:14:54: fatal error: jni.h: No such file or directory

I've pulled the latest changes from the repo. Running ./install_script on Ubuntu 16.04.4 LTS. $JAVA_HOME has been set to "/usr/lib/jvm/java-8-openjdk-amd64".

Build fails with this error message:
[ 38%] Building CXX object CMakeFiles/KinesisVideoProducerJNI.dir/home/mike/git/akvspsc/kinesis-video-producer-jni/src/source/com/amazonaws/kinesis/video/producer/jni/KinesisVideoClientWrapper.cpp.o
In file included from /home/mike/git/akvspsc/kinesis-video-producer-jni/src/source/com/amazonaws/kinesis/video/producer/jni/KinesisVideoClientWrapper.cpp:5:0:
/home/mike/git/akvspsc/kinesis-video-native-build/../kinesis-video-producer-jni/src/include/com/amazonaws/kinesis/video/producer/jni/KinesisVideoClientWrapper.h:14:54: fatal error: jni.h: No such file or directory
compilation terminated.

Kinesis Video Streams data store

Hi ,

I have some questions ,

  1. Amazon Kinesis Video Streams uses Amazon S3 as the underlying data store , but i did not find any info in S3, so. how can i find the underlying data store in S3 and the data format is ?

  2. What is the kinesis video stream output ? I using parsing library to parses the merged output to print out the elements, only their offsets and size of the element in bytes but i can't find any actual video frames data .

The output format as follows:

Element Tags elementNumber 84 offset 916 element header size 8 element data size 235
Element Tag elementNumber 85 offset 924 element header size 6 element data size 229
Element SimpleTag elementNumber 86 offset 930 element header size 6 element data size 91
Element TagName elementNumber 87 offset 936 element header size 6 element data size 32
Tag Name :AWS_KINESISVIDEO_FRAGMENT_NUMBER
Element TagString elementNumber 88 offset 974 element header size 6 element data size 47
Element SimpleTag elementNumber 89 offset 1027 element header size 6 element data size 59
Element TagName elementNumber 90 offset 1033 element header size 6 element data size 33
Tag Name :AWS_KINESISVIDEO_SERVER_TIMESTAMP
Element TagString elementNumber 91 offset 1072 element header size 6 element data size 14
Element SimpleTag elementNumber 92 offset 1092 element header size 6 element data size 61
Element TagName elementNumber 93 offset 1098 element header size 6 element data size 35
Tag Name :AWS_KINESISVIDEO_PRODUCER_TIMESTAMP
Element TagString elementNumber 94 offset 1139 element header size 6 element data size 14
Element Cluster elementNumber 95 offset 1159 element header size 12 element data size 546583
Element CRC-32 elementNumber 96 offset 1171 element header size 2 element data size 4
Element Timecode elementNumber 97 offset 1177 element header size 2 element data size 1
Element SimpleBlock elementNumber 98 offset 1180 element header size 4 element data size 111839
Frame data (size): 111835 Frame(trackNumber=1, timeCode=0, keyFrame=true, invisible=false, discardable=false, lacing=NO)
Element SimpleBlock elementNumber 99 offset 113023 element header size 3 element data size 5911
Frame data (size): 5907 Frame(trackNumber=1, timeCode=33, keyFrame=false, invisible=false, discardable=false, lacing=NO)
Element SimpleBlock elementNumber 100 offset 118937 element header size 3 element data size 5215
Frame data (size): 5211 Frame(trackNumber=1, timeCode=67, keyFrame=false, invisible=false, discardable=false, lacing=NO)
Element SimpleBlock elementNumber 101 offset 124155 element header size 3 element data size 4953
Frame data (size): 4949 Frame(trackNumber=1, timeCode=100, keyFrame=false, invisible=false, discardable=false, lacing=NO)
Element SimpleBlock elementNumber 102 offset 129111 element header size 3 element data size 10084
Frame data (size): 10080 Frame(trackNumber=1, timeCode=133, keyFrame=false, invisible=false, discardable=false, lacing=NO)
Element SimpleBlock elementNumber 103 offset 139198 element header size 3 element data size 14899
Frame data (size): 14895 Frame(trackNumber=1, timeCode=167, keyFrame=false, invisible=false, discardable=false, lacing=NO)
Element SimpleBlock elementNumber 104 offset 154100 element header size 3 element data size 8184
Frame data (size): 8180 Frame(trackNumber=1, timeCode=200, keyFrame=false, invisible=false, discardable=false, lacing=NO)
Element SimpleBlock elementNumber 105 offset 162287 element header size 3 element data size 4531
Frame data (size): 4527 Frame(trackNumber=1, timeCode=233, keyFrame=false, invisible=false, discardable=false, lacing=NO)
Element SimpleBlock elementNumber 106 offset 166821 element header size 3 element data size 6178
Frame data (size): 6174 Frame(trackNumber=1, timeCode=267, keyFrame=false, invisible=false, discardable=false, lacing=NO)
Element SimpleBlock elementNumber 107 offset 173002 element header size 3 element data size 11434
Frame data (size): 11430 Frame(trackNumber=1, timeCode=300, keyFrame=false, invisible=false, discardable=false, lacing=NO)
Element SimpleBlock elementNumber 108 offset 184439 element header size 3 element data size 12073
Frame data (size): 12069 Frame(trackNumber=1, timeCode=333, keyFrame=false, invisible=false, discardable=false, lacing=NO)
Element SimpleBlock elementNumber 109 offset 196515 element header size 3 element data size 7512
Frame data (size): 7508 Frame(trackNumber=1, timeCode=367, keyFrame=false, invisible=false, discardable=false, lacing=NO)
Element SimpleBlock elementNumber 110 offset 204030 element header size 3 element data size 9619
Frame data (size): 9615 Frame(trackNumber=1, timeCode=400, keyFrame=false, invisible=false, discardable=false, lacing=NO)
Element SimpleBlock elementNumber 111 offset 213652 element header size 3 element data size 14909
Frame data (size): 14905 Frame(trackNumber=1, timeCode=433, keyFrame=false, invisible=false, discardable=false, lacing=NO)
Element SimpleBlock elementNumber 112 offset 228564 element header size 3 element data size 7516
Frame data (size): 7512 Frame(trackNumber=1, timeCode=467, keyFrame=false, invisible=false, discardable=false, lacing=NO)
................................................................................................................................................................
................................................................................................................................................................

  1. Can i use parsing libraries to merge multiple streams (ex: Three sections of 10 seconds video) into a single stream(30 seconds video)?

Consistent error "Failed to submit frame to Kinesis Video client. status: 0x32000002" on Raspberry Pi

Hello and thank you for this awesome tool, it's helping my project come to life!

When running the GST video demo, I receive an error continuously on my Raspberry Pi. "Failed to submit frame to Kinesis Video client. status: 0x32000002". I wasn't sure if I would file a ticket for this but I am stumped and I know the code was just published in the last few months so maybe I am not alone. Any recommendations would be appreciated!

Edit: I should mention I am using this with Rekognition and hopefully the web preview tool in the web console. It looks like the RPi is still using h264 but I'm not familiar with the specific encoder selected by the code for RPi.

I have gone through some steps to fix heap allocation size and to make sure /dev/video0 is available. I have also built with debug logs but not since this issue. I can rerun with debug info soon (need to recompile on the RPi, takes awhile). I have this demo working fine on two Mac's but recently got it compiling on the RPi.

I am running with this command: AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_DEFAULT_REGION= ./kinesis_video_gstreamer_sample_app from the kinesis-video-native-build directory.

I believe this error message matches from this page: https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/producer-sdk-errors.html

That page says this is an MKVGen error "STATUS_MKV_INVALID_FRAME_TIMESTAMP"

  • Raspberry Pi B+
  • <512MB RAM, tweaked kinesis_video_gstreamer_sample_app.cpp to use 256MB

PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Linux raspberrypi 4.14.18+ #1093 Fri Feb 9 15:07:36 GMT 2018 armv6l GNU/Linux

dpkg --get-selections | grep -i x264
libx264-148:armhf install
libx264-dev:armhf install
x264 install

dpkg --get-selections | grep -i gstream
gir1.2-gstreamer-1.0 install
gstreamer1.0-alsa:armhf install
gstreamer1.0-libav:armhf install
gstreamer1.0-omx install
gstreamer1.0-omx-rpi install
gstreamer1.0-omx-rpi-config install
gstreamer1.0-plugins-bad:armhf install
gstreamer1.0-plugins-base:armhf install
gstreamer1.0-plugins-base-apps install
gstreamer1.0-plugins-good:armhf install
gstreamer1.0-plugins-ugly:armhf install
gstreamer1.0-rtsp:armhf install
gstreamer1.0-tools install
gstreamer1.0-x:armhf install
libgstreamer-plugins-bad1.0-0:armhf install
libgstreamer-plugins-bad1.0-dev install
libgstreamer-plugins-base1.0-0:armhf install
libgstreamer-plugins-base1.0-dev install
libgstreamer1.0-0:armhf install
libgstreamer1.0-dev install

Thanks again!

RTSP Quality VS YouTube RTMP

Hi,

I am wondering why the quality of my RTSP stream is so poor compared to an RTMP stream sent to youtube live ( see attached video )

I have a screen recording of a simple app - The top video is getting its stream from Kinesis ( pushed up using the gstreamer_sample_rtsp_app ) and the bottom video is locally encoded to RTMP using ffmpeg and then pushed to youtube live and embedded in my page.

The quality is the same in the AWS console.....

Anything I can do to improve this?

Thanks!

Home Page - AngularCoreAWS - Google Chrome 2018_03_19 19_07_10.zip

Describe stream result event.ERROR

describeStreamResultEvent(): Describe stream result event.ERROR - Submitting event result for stream: 94040122179894 failed with: 1375731729
ERROR - Reporting stream error. Errored timecode: 0 Status: 1375731729
ERROR - Failed to create Kinesis Video Stream - timed out.
terminate called after throwing an instance of 'std::runtime_error'
what(): Failed to create Kinesis Video Stream - timed out.

What is this Error?
Thanks

CMake Error "does not appear to contain CMakeLists.txt"

FYI:

Whilst executing ./kinesis-video-native-build/install-script I got the following error CMake Error: The source directory "/Users/Gavin/repos/thirdparty/amazon-kinesis-video-streams-producer-sdk-cpp" does not appear to contain CMakeLists.txt.. To resolve I moved CMakeLists.txt from kinesis-video-native-build to root of repo. Updated the src paths in CMakeLists.txt to match new locations and reran the command to resolve the issue.

Error std::make_unique

Hi everyone,

I'm building the environment using ./install-script

And get this error:
[ 76%] Building CXX object CMakeFiles/producer.dir/home/evi/works/Cloud_AI/AWS/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-vid eo-pic/src/view/tst/ViewTestFixture.cpp.o
[ 77%] Building CXX object CMakeFiles/producer.dir/home/evi/works/Cloud_AI/AWS/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-vid eo-producer/src/KinesisVideoProducer.cpp.o
In file included from /home/evi/works/Cloud_AI/AWS/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-producer/src/KinesisVideo Producer.h:9:0,
from /home/evi/works/Cloud_AI/AWS/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-producer/src/KinesisVideo Producer.cpp:1:
/home/evi/works/Cloud_AI/AWS/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-producer/src/DefaultCallbackProvider.h:43:17: e rror: ‘make_unique’ is not a member of ‘std’
std::make_unique(),
^
/home/evi/works/Cloud_AI/AWS/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-producer/src/DefaultCallbackProvider.h:43:57: e rror: expected primary-expression before ‘>’ token
std::make_unique(),
^
/home/evi/works/Cloud_AI/AWS/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-producer/src/DefaultCallbackProvider.h:43:59: e rror: expected primary-expression before ‘)’ token
std::make_unique(),

Please help me.

Thanks

'jni.h' file not found - osx High sierra

Hi,

I get jni.h file not found while trying to build the native JNI lib for osx.

sudo ./install-script
...
-- Build files have been written to: /Users/home/Desktop/amazon-kinesis-video-streams-producer-sdk-cpp-master/kinesis-video-native-build [ 0%] Building CXX object CMakeFiles/KinesisVideoProducerJNI.dir/Users/home/Desktop/amazon-kinesis-video-streams-producer-sdk-cpp-master/kinesis-video-producer-jni/src/source/com/amazonaws/kinesis/video/producer/jni/KinesisVideoClientWrapper.cpp.o In file included from /Users/home/Desktop/amazon-kinesis-video-streams-producer-sdk-cpp-master/kinesis-video-producer-jni/src/source/com/amazonaws/kinesis/video/producer/jni/KinesisVideoClientWrapper.cpp:5: /Users/home/Desktop/amazon-kinesis-video-streams-producer-sdk-cpp-master/kinesis-video-native-build/../kinesis-video-producer-jni/src/include/com/amazonaws/kinesis/video/producer/jni/KinesisVideoClientWrapper.h:14:10: fatal error: 'jni.h' file not found #include <jni.h> // Basic native API ^ 1 error generated. make[3]: *** [CMakeFiles/KinesisVideoProducerJNI.dir/Users/home/Desktop/amazon-kinesis-video-streams-producer-sdk-cpp-master/kinesis-video-producer-jni/src/source/com/amazonaws/kinesis/video/producer/jni/KinesisVideoClientWrapper.cpp.o] Error 1 make[2]: *** [CMakeFiles/KinesisVideoProducerJNI.dir/all] Error 2 make[1]: *** [CMakeFiles/KinesisVideoProducerJNI.dir/rule] Error 2 make: *** [KinesisVideoProducerJNI] Error 2 Homes-Mac-mini:kinesis-video-native-build home$

Java version
Homes-Mac-mini:kinesis-video-native-build home$ java -version
java version "1.8.0_162"
Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)
Homes-Mac-mini:kinesis-video-native-build home$

It looks like headers file are mapped in ./install-script.
How do it manually specify the location of jni.h header file ? Or should I look for some other work around ?
I have been into this for weeks, unable to map the headers to install_script. any help is greatly appreciated.

Raspberry Pi

Hey, tried multiple times to install this on a clean raspbian os downloaded und updated right before the installation and following the official installation guide for raspberry pi. Every time I get errors like

flex not found. Installing
...
curl: (77) error setting certificate verify locations:
CAfile: /etc/ssl/cert.pem
CApath: none

So far I didn't find a solution. Any suggestions? Or can somebody upload a working raspbian image with the video stream producer installed?

Streaming from PI gives error

Hello,
I have installed producer SDK on pi successfully but I am receiving following error while running sample app.

AWS_ACCESS_KEY_ID=############
AWS_SECRET_ACCESS_KEY=################################### ./kinesis_video_gstreamer_sample_app test_stream

Error:

getStreamingTokenResultEvent(): Get streaming token result event.DEBUG - Kinesis Video stream test_stream is Ready.
DEBUG - Stream is ready
Error received from element source: Internal data stream error.
Debugging information: gstbasesrc.c(2939): gst_base_src_loop (): /GstPipeline:test-pipeline/GstV4l2Src:source:
streaming stopped, reason not-negotiated (-4)

freeKinesisVideoClient(): Freeing Kinesis Video ClientDEBUG - streamDataAvailableHandler invoked
DEBUG - streamClosedHandler invoked

commonHeapDebugCheckAllocator(): Heap is initialized
commonHeapDebugCheckAllocator(): Heap limit: 				536870912
commonHeapDebugCheckAllocator(): Heap size: 				0
commonHeapDebugCheckAllocator(): Number of allocations: 				0
aivHeapDebugCheckAllocator(): Allocated blocks pointer: 				(nil)
aivHeapDebugCheckAllocator(): *******************************************
aivHeapDebugCheckAllocator(): *******************************************
aivHeapDebugCheckAllocator(): Free blocks pointer: 				0x55eab008
aivHeapDebugCheckAllocator(): *******************************************
aivHeapDebugCheckAllocator(): Block:	0x55eab008		size:	536870887
aivHeapDebugCheckAllocator(): *******************************************
heapRelease(): Freeing native heap.INFO - Curl shutdown.

How to reduce latency?

How would we add less data per Kinesis fragment but speed up the frequency in which they were sent to provide lower latency?

I see these stream variables but unsure which ones to adjust?

auto stream_definition = make_unique<StreamDefinition>(stream_name,
                                                           hours(0),
                                                           &tags,
                                                           "",
                                                           STREAMING_TYPE_REALTIME,
                                                           "video/h264",
                                                           milliseconds::zero(),
                                                           seconds(2),
                                                           milliseconds(1),
                                                           true,
                                                           true,
                                                           false,
                                                           true,
                                                           true,
                                                           true,
                                                           0,
                                                           10,
                                                           4 * 1024 * 1024,
                                                           seconds(120),
                                                           seconds(40),
                                                           seconds(30),
                                                           "V_MPEG4/ISO/AVC",
                                                           "kinesis_video",
                                                           cpd,
                                                           sizeof(cpd));

Thanks

can sample program send streaming from named pipe?

I use kinesis_video_gstreamer_sample_app and I succeed to send video stream from raspberyyPi3 + camera v2.
I want to send video stream from named pipe forexample,

mkfifo /tmp/input
myprogram  > /tmp/input
kinesis_video_gstreamer_sample_app streamName /tmp/input

Can I do this by modifiying kinesis_video_gstreamer_sample_app.cpp?

black screen on kinesis video stream

Hi all,
i'm using a Sricam SP012 ipcam (720px, rtsp, h.264) to view its live stream on a kinesis video stream, but even if the application provided in the sdk seems to run correctly i don't see the video in the kinesis video stream preview, only a "live black screen".
I run this:
./kinesis_video_gstreamer_sample_rtsp_app rtsp://:>password>@:554/onvif1 <stream_name>

Any ideas about this issue? Maybe i must change some parameter in the code inside kinesis_video_gstreamer_sample_rtsp_app.cpp file? For example in this stream definition:
auto stream_definition = make_unique(stream_name,
hours(2),
&tags,
"",
STREAMING_TYPE_REALTIME,
"video/h264",
milliseconds::zero(),
seconds(2),
milliseconds(1),
true,
true,
false,
true,
true,
true,
0,
30,
4 * 1024 * 1024,
seconds(120),
seconds(40),
seconds(30),
"V_MPEG4/ISO/AVC",
"kinesis_video",
nullptr,
0);
Thanks.

Cannot stream with kinesis sample app

When running the c++ kinesis sample app with AWS_DEFAULT_REGION="us-east-1a"
it gives me the error
'Could not resolve host: kinesisvideo.us-east-1a.amazonaws.com'

When AWS_DEFAULT_REGION="us-east-1"
it gives me the error
'The request signature we calculated does not match the signature you provided. Check your AWS secret access key and signing method'

What is the correct way to set up the kinesis sample app so that I can stream a sample video?

Incorrect AWS REGION

Hi,
The GStreamer sample C++ application creates the Kinesis Video stream in US-West-2, even if I set the AWS_DEFAULT_REGION to us-east-1. The region parameter in credentials file is also set to us-east-1.
$echo $AWS_DEFAULT_REGION
us-east-1
$ ./kinesis_video_gstreamer_sample_app home-driveway
creates the stream in us-west-2.
How do I override this. I would like to create the stream in us-east-1

Thanks
Babu Srinivasan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.