Skip to content

Commit 5888464

Browse files
committed
Updated CMakeLists.txt and install scripts to be able to link against libraries in default system path.
Optimization and bug fixes.
1 parent 747bbd8 commit 5888464

39 files changed

+1961
-1009
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
### Amazon Kinesis Video Streams Producer SDK C/C++
2+
----
3+
### Attention
4+
----
5+
If you are updating from any release before 1.7.0, you need to specify a track id for each Frame as shown in [sample](https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp/blob/master/kinesis-video-gst-demo/kinesis_video_gstreamer_sample_app.cpp#L312), otherwise you will get a 0x32000026 which means track not found.
6+
27
----
38
### Introduction
49
----
@@ -45,6 +50,10 @@ This library is licensed under the Amazon Software License.
4550
----
4651
### Release notes
4752

53+
#### Release 1.7.8 (6th Mar 2019)
54+
* Updated CMakeLists.txt and install scripts to be able to link against libraries in default system path.
55+
* Optimization and bug fixes.
56+
4857
#### Release 1.7.7 (22th Feb 2019)
4958
* Stability and bug fixes.
5059

@@ -68,6 +77,7 @@ This library is licensed under the Amazon Software License.
6877
* stability fixes.
6978

7079
#### Release 1.7.0 (14th Dec 2018)
80+
* Applications need to specify a trackId for every Frame as shown in create_kinesis_video_frame function in the samples
7181
* Added support for uploading files(offline mode) to Kinesis Video Stream
7282
* Additional fixes
7383

install-instructions-linux.md

+27-76
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Many platforms come with a cert file with a lot of the well-known public certs i
3434
----
3535
### Build the Kinesis Video Producer SDK and sample applications:
3636

37+
##### Build the SDK and sample applications using open source library dependencies built from source
38+
3739
The **install-script** will download and build the dependent open source components (from the source) into the **downloads** directory within `kinesis-video-native-build` directory (e.g. `/home/<myuser>/downloads/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads`) and link against it.
3840

3941
**After you've downloaded the code from GitHub, you can build it on Linux by running `./install-script` (which is inside the `kinesis-video-native-build` directory)**.
@@ -44,73 +46,32 @@ The **install-script** will download and build the dependent open source compone
4446

4547
Note that the install-script also builds the Kinesis Video Streams producer SDK as a **GStreamer plugin** (**kvssink**).
4648

47-
----
4849
##### Alternate option to build the SDK and sample applications using system versions of open source library dependencies
4950

50-
The bulk of the **install-script** is building the open source dependencies. The project is based on **CMake**. So the open source components building can be skipped if the system versions of the open source dependencies are already installed that can be used for linking. See the section **Install Steps for Ubuntu 17.x using apt-get** for detailed instructions on how to install using `apt-get install` on **Ubuntu** .
51+
The bulk of the **install-script** is building the open source dependencies. The project is based on **CMake**. So the open source components building can be skipped if the system versions of the open source dependencies are already installed that can be used for linking. See the section **Install Steps for Ubuntu 17.x and Raspbian Stretch using apt-get** for detailed instructions on how to install using `apt-get install` on **Ubuntu** .
5152

52-
Running
53-
54-
```
55-
$ cmake .
56-
$ make
57-
```
58-
from the `kinesis-video-native-build` directory will build and link the SDK.
59-
60-
The `./min-install-script` inside the `kinesis-video-native-build` captures these steps for installing the Kinesis Video Streams Producer SDK with the system versions for linking.
53+
The `./min-install-script` inside the `kinesis-video-native-build` captures these steps for building the Kinesis Video Streams Producer SDK with the system versions for linking.
6154

6255
##### Optionally build the native library (KinesisVideoProducerJNI) to run Java demo streaming application
6356

6457
The `./java-install-script` inside `kinesis-video-native-build` will build the KinesisVideoProducerJNI native library to be used by [Java Producer SDK](https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-java/blob/master/README.md).
6558

6659
----
6760

68-
### Install Steps for Ubuntu 17.x using apt-get
69-
70-
The following section provides guidance for installing the build tools and open source dependencies using `apt-get` in **Ubuntu Linux**.
61+
### Install Steps for Ubuntu 17.x and Raspbian Stretch using apt-get
7162

72-
The following are the steps to install the build-time prerequisites for Ubuntu 17.x
63+
The following section provides guidance for installing the build tools and open source dependencies using `apt-get` and has been tested in **Ubuntu Linux** and **Raspbian Stretch**.
7364

7465
Install **git**:
7566

7667
```
68+
$ sudo apt-get update
7769
$ sudo apt-get install git
78-
$ git --version
79-
git version 2.14.1
8070
```
8171
Install **cmake**:
8272
```
73+
sudo apt-get update
8374
$ sudo apt-get install cmake
84-
$ cmake --version
85-
cmake version 3.9.1
86-
```
87-
88-
CMake suite maintained and supported by Kitware (kitware.com/cmake).
89-
90-
Install **libtool**: (some images come preinstalled) amd **libtool-bin**
91-
```
92-
$ sudo apt-get install libtool
93-
$ sudo apt-get install libtool-bin
94-
$ libtool --version
95-
libtool (GNU libtool) 2.4.6
96-
Written by Gordon Matzigkeit, 1996
97-
98-
Copyright (C) 2014 Free Software Foundation, Inc.
99-
This is free software; see the source for copying conditions. There is NO
100-
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
101-
```
102-
Install **automake**:
103-
```
104-
$ sudo apt-get install automake
105-
$ automake --version
106-
automake (GNU automake) 1.15
107-
Copyright (C) 2014 Free Software Foundation, Inc.
108-
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>
109-
This is free software: you are free to change and redistribute it.
110-
There is NO WARRANTY, to the extent permitted by law.
111-
112-
Written by Tom Tromey <[email protected]>
113-
and Alexandre Duret-Lutz <[email protected]>.
11475
```
11576
Install **g++**:
11677
```
@@ -121,39 +82,28 @@ Copyright (C) 2017 Free Software Foundation, Inc.
12182
This is free software; see the source for copying conditions. There is NO
12283
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12384
```
124-
Install **curl**:
85+
Install **Producer Library Dependencies**:
86+
12587
```
126-
$ sudo apt-get install curl
127-
$ curl --version
128-
curl 7.55.1 (x86_64-pc-linux-gnu) libcurl/7.55.1 OpenSSL/1.0.2g zlib/1.2.11 libidn2/2.0.2 libpsl/0.18.0 (+libidn2/2.0.2) librtmp/2.3
129-
Release-Date: 2017-08-14
130-
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
131-
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy PSL
88+
$ sudo apt-get update
89+
$ sudo apt-get install libssl-dev libcurl4-openssl-dev liblog4cplus-1.1-9 liblog4cplus-dev
13290
```
133-
Install **pkg-config**:
91+
Install **Gstreamer Artifact Dependencies**:
13492
```
135-
$ sudo apt-get install pkg-config
136-
$ pkg-config --version
137-
0.29.1
93+
$ sudo apt-get update
94+
$ sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps
95+
$ sudo apt-get install gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools
13896
```
139-
Install **flex**:
97+
If you are using Raspberry pi, you can also install the `gstreamer1.0-omx` package to get the omxh264enc hardware encoder
14098
```
141-
$ sudo apt-get install flex
142-
$ flex --version
143-
flex 2.6.1
99+
sudo apt-get install gstreamer1.0-omx
144100
```
145-
Install **bison**:
101+
Run the build script: (within `kinesis-video-native-build` folder)
146102
```
147-
$ sudo apt-get install bison
148-
$ bison -V
149-
bison (GNU Bison) 3.0.4
150-
Written by Robert Corbett and Richard Stallman.
151-
152-
Copyright (C) 2015 Free Software Foundation, Inc.
153-
This is free software; see the source for copying conditions. There is NO
154-
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
103+
./min-install-script
155104
```
156-
Install **Open JDK**:
105+
106+
Install **Open JDK** (if you are building the JNI library):
157107
```
158108
$ sudo apt-get install openjdk-8-jdk
159109
$ java -showversion
@@ -165,9 +115,10 @@ Set **JAVA_HOME** environment variable:
165115
```
166116
$ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
167117
```
118+
168119
Run the build script: (within `kinesis-video-native-build` folder)
169120
```
170-
./install-script
121+
$ ./java-install-script
171122
```
172123

173124
----
@@ -190,7 +141,7 @@ the LD_LIBRARY_PATH as below:
190141
```
191142
export LD_LIBRARY_PATH=/opt/awssdk/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib:$LD_LIBRARY_PATH
192143
```
193-
* The `gst-launch-1.0` and `gst-inspect-1.0` binaries are built inside the folder `<YourSdkFolderPath>/kinesis-video-native-build/downloads/local/bin`. You can either run the following commands from that folder using `./gst-launch-1.0` or you can include that in your **PATH** environment variable using the following export command and run `gst-launch-1.0`
144+
* (Skip this if you installed gstreamer using apt-get) The `gst-launch-1.0` and `gst-inspect-1.0` binaries are built inside the folder `<YourSdkFolderPath>/kinesis-video-native-build/downloads/local/bin`. You can either run the following commands from that folder using `./gst-launch-1.0` or you can include that in your **PATH** environment variable using the following export command and run `gst-launch-1.0`
194145
```
195146
$ export PATH=<YourSdkFolderPath>/kinesis-video-native-build/downloads/local/bin:$PATH
196147
```
@@ -337,13 +288,13 @@ AWS_ACCESS_KEY_ID=YourAccessKeyId AWS_SECRET_ACCESS_KEY=YourSecretAccessKey ./ki
337288
gst-launch-1.0 -v filesrc location="YourAudioVideo.mkv" ! matroskademux name=demux ! queue ! h264parse ! kvssink name=sink stream-name="my_stream_name" access-key="YourAccessKeyId" secret-key="YourSecretAccessKey" streaming-type=offline demux. ! queue ! aacparse ! sink.
338289
```
339290

340-
###### Running the `gst-launch-1.0` command to upload MPEG2TS file that contains both *audio and video* in **Raspberry-PI**.
291+
###### Running the `gst-launch-1.0` command to upload MP4 file that contains both *audio and video* in **Raspberry-PI**.
341292

342293
```
343294
gst-launch-1.0 -v filesrc location="YourAudioVideo.mp4" ! qtdemux name=demux ! queue ! h264parse ! video/x-h264,stream-format=avc,alignment=au ! kvssink name=sink stream-name="audio-video-file" access-key="YourAccessKeyId" secret-key="YourSecretAccessKey" streaming-type=offline demux. ! queue ! aacparse ! sink.
344295
```
345296

346-
###### Running the `gst-launch-1.0` command to upload MP4 file that contains both *audio and video* in **Raspberry-PI**.
297+
###### Running the `gst-launch-1.0` command to upload MPEG2TS file that contains both *audio and video* in **Raspberry-PI**.
347298

348299
```
349300
gst-launch-1.0 -v filesrc location="YourAudioVideo.ts" ! tsdemux name=demux ! queue ! h264parse ! video/x-h264,stream-format=avc,alignment=au ! kvssink name=sink stream-name="audio-video-file" access-key="YourAccessKeyId" secret-key="YourSecretAccessKey" streaming-type=offline demux. ! queue ! aacparse ! sink.

install-instructions-macos.md

+10-14
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ In order to build the Producer SDK and download open source dependencies the fol
2929
_**Note:**_ If you have installed these build tools using `brew` you need to set the PATH environment variable to include the installed location.
3030
e.g. To incldue the latest `bison` you can run `export PATH=/usr/local/Cellar/bison/3.0.4_1/bin/:$PATH`
3131

32-
##### Install the certificate in the operating system certificate store
33-
Kinesis Video Streams Producer SDK for C++ needs to establish trust with the backend service through TLS. This is done through validating the CAs in the public certificate store. On Linux-based models, this store is located in `/etc/ssl/` directory by default.
34-
35-
Please download the PEM file from [SFSRootCAG2.pem](https://www.amazontrust.com/repository/SFSRootCAG2.pem)
36-
to `/etc/ssl/cert.pem`. If the file already exists `/etc/ssl/cert.pem` then you can append it by running `sudo cat SFSRootCAG2.pem >> /etc/ssl/cert.pem`.
37-
38-
Many platforms come with a cert file with a lot of the well-known public certs in them.
39-
4032
----
4133
### Build the Kinesis Video Producer SDK and sample applications:
4234
The **install-script** will download and build the dependent open source components (from the source) into the **downloads** directory within `kinesis-video-native-build` directory (e.g. `/Users/<myuser>/downloads/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads`) and link against it.
@@ -50,15 +42,19 @@ The **install-script** will download and build the dependent open source compone
5042
Note that the install-script also builds the Kinesis Video Streams producer SDK as a **GStreamer plugin** (**kvssink**).
5143

5244
----
53-
##### Alternate option to build the SDK and sample applications using system versions of open source library dependencies
45+
### Alternate option to build the SDK and sample applications using libraries installed by Homebrew
5446

5547
The bulk of the **install script** is building the open source dependencies. The project is based on **CMake**. So the open source components building can be skipped if the system versions of the open source dependencies are already installed that can be used for linking.
5648

57-
Running
49+
First make sure that the following libraries have been installed using Homebrew
50+
```
51+
brew install pkg-config openssl cmake gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly log4cplus
52+
```
53+
54+
After all required libraries have been installed, run
5855

5956
```
60-
$ cmake .
61-
$ make
57+
$ ./min-install-script
6258
```
6359
from the `kinesis-video-native-build` directory will build and link the SDK.
6460

@@ -182,13 +178,13 @@ AWS_ACCESS_KEY_ID=YourAccessKeyId AWS_SECRET_ACCESS_KEY=YourSecretAccessKey ./ki
182178
gst-launch-1.0 -v filesrc location="YourAudioVideo.mkv" ! matroskademux name=demux ! queue ! h264parse ! kvssink name=sink stream-name="my_stream_name" access-key="YourAccessKeyId" secret-key="YourSecretAccessKey" streaming-type=offline demux. ! queue ! aacparse ! sink.
183179
```
184180

185-
###### Running the `gst-launch-1.0` command to upload MPEG2TS file that contains both *audio and video* in **Mac-OS**.
181+
###### Running the `gst-launch-1.0` command to upload MP4 file that contains both *audio and video* in **Mac-OS**.
186182

187183
```
188184
gst-launch-1.0 -v filesrc location="YourAudioVideo.mp4" ! qtdemux name=demux ! queue ! h264parse ! video/x-h264,stream-format=avc,alignment=au ! kvssink name=sink stream-name="audio-video-file" access-key="YourAccessKeyId" secret-key="YourSecretAccessKey" streaming-type=offline demux. ! queue ! aacparse ! sink.
189185
```
190186

191-
###### Running the `gst-launch-1.0` command to upload MP4 file that contains both *audio and video* in **Mac-OS**.
187+
###### Running the `gst-launch-1.0` command to upload MPEG2TS file that contains both *audio and video* in **Mac-OS**.
192188

193189
```
194190
gst-launch-1.0 -v filesrc location="YourAudioVideo.ts" ! tsdemux name=demux ! queue ! h264parse ! video/x-h264,stream-format=avc,alignment=au ! kvssink name=sink stream-name="audio-video-file" access-key="YourAccessKeyId" secret-key="YourSecretAccessKey" streaming-type=offline demux. ! queue ! aacparse ! sink.

install-instructions-windows-msvc.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,13 @@ gst-launch-1.0 -v ksvideosrc ! h264parse ! video/x-h264,stream-format=avc,alignm
163163
gst-launch-1.0 -v filesrc location="YourAudioVideo.mkv" ! matroskademux name=demux ! queue ! h264parse ! kvssink name=sink stream-name="my_stream_name" access-key="YourAccessKeyId" secret-key="YourSecretAccessKey" streaming-type=offline demux. ! queue ! aacparse ! sink.
164164
```
165165

166-
###### Running the `gst-launch-1.0` command to upload MPEG2TS file that contains both *audio and video*.
166+
###### Running the `gst-launch-1.0` command to upload MP4 file that contains both *audio and video*.
167167

168168
```
169169
gst-launch-1.0 -v filesrc location="YourAudioVideo.mp4" ! qtdemux name=demux ! queue ! h264parse ! video/x-h264,stream-format=avc,alignment=au ! kvssink name=sink stream-name="audio-video-file" access-key="YourAccessKeyId" secret-key="YourSecretAccessKey" streaming-type=offline demux. ! queue ! aacparse ! sink.
170170
```
171171

172-
###### Running the `gst-launch-1.0` command to upload MP4 file that contains both *audio and video*.
172+
###### Running the `gst-launch-1.0` command to upload MPEG2TS file that contains both *audio and video*.
173173

174174
```
175175
gst-launch-1.0 -v filesrc location="YourAudioVideo.ts" ! tsdemux name=demux ! queue ! h264parse ! video/x-h264,stream-format=avc,alignment=au ! kvssink name=sink stream-name="audio-video-file" access-key="YourAccessKeyId" secret-key="YourSecretAccessKey" streaming-type=offline demux. ! queue ! aacparse ! sink.

install-instructions-windows-msys2.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ Now the MingW shell prompt will look similar to the one below.
4545
$
4646
```
4747

48-
###### Step 6: Build the Kinesis Video Streams Producer SDK using msys2-install-script.
49-
Build the SDK by running the command `./msys2-install-script -a`
48+
###### Step 6: Build the Kinesis Video Streams Producer SDK using min-install-script.
49+
Build the SDK by running the command `./min-install-script`
5050
Press Enter to all prompts that show up during the install the process. When the install script finishes, the demo executables and libraries will be in the kinesis-video-native-build directory. Please note that this step could take about **25 mins**.
5151

5252
----
@@ -160,13 +160,13 @@ AWS_ACCESS_KEY_ID=YourAccessKeyId AWS_SECRET_ACCESS_KEY=YourSecretAccessKey ./ki
160160
gst-launch-1.0 -v filesrc location="YourAudioVideo.mkv" ! matroskademux name=demux ! queue ! h264parse ! kvssink name=sink stream-name="my_stream_name" access-key="YourAccessKeyId" secret-key="YourSecretAccessKey" streaming-type=offline demux. ! queue ! aacparse ! sink.
161161
```
162162

163-
###### Running the `gst-launch-1.0` command to upload MPEG2TS file that contains both *audio and video* in **Mingw Shell**.
163+
###### Running the `gst-launch-1.0` command to upload MP4 file that contains both *audio and video* in **Mingw Shell**.
164164

165165
```
166166
gst-launch-1.0 -v filesrc location="YourAudioVideo.mp4" ! qtdemux name=demux ! queue ! h264parse ! video/x-h264,stream-format=avc,alignment=au ! kvssink name=sink stream-name="audio-video-file" access-key="YourAccessKeyId" secret-key="YourSecretAccessKey" streaming-type=offline demux. ! queue ! aacparse ! sink.
167167
```
168168

169-
###### Running the `gst-launch-1.0` command to upload MP4 file that contains both *audio and video* in **Mingw Shell**.
169+
###### Running the `gst-launch-1.0` command to upload MPEG2TS file that contains both *audio and video* in **Mingw Shell**.
170170

171171
```
172172
gst-launch-1.0 -v filesrc location="YourAudioVideo.ts" ! tsdemux name=demux ! queue ! h264parse ! video/x-h264,stream-format=avc,alignment=au ! kvssink name=sink stream-name="audio-video-file" access-key="YourAccessKeyId" secret-key="YourSecretAccessKey" streaming-type=offline demux. ! queue ! aacparse ! sink.

kinesis-video-gst-demo/kinesis_video_gstreamer_audio_video_sample_app.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ LOGGER_TAG("com.amazonaws.kinesis.video.gstreamer");
6262
#define APP_SINK_BASE_NAME "appsink"
6363
#define DEFAULT_BUFFER_SIZE (1 * 1024 * 1024)
6464
#define DEFAULT_STORAGE_SIZE (128 * 1024 * 1024)
65-
#define DEFAULT_CREDENTIAL_ROTATION_SECONDS 120
65+
#define DEFAULT_CREDENTIAL_ROTATION_SECONDS 2400
6666
#define DEFAULT_CREDENTIAL_EXPIRATION_SECONDS 180
6767
#define DEFAULT_AUDIO_VIDEO_DRIFT_TIMEOUT_SECOND 5
6868

kinesis-video-gst-demo/kinesis_video_gstreamer_sample_app.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ LOGGER_TAG("com.amazonaws.kinesis.video.gstreamer");
5353
#define DEFAULT_FRAME_DURATION_MS 1
5454
#define DEFAULT_FRAME_DATA_SIZE_BYTE 5000
5555
#define FRAME_DATA_SIZE_MULTIPLIER 1.5
56-
#define DEFAULT_CREDENTIAL_ROTATION_SECONDS 120
56+
#define DEFAULT_CREDENTIAL_ROTATION_SECONDS 2400
5757
#define DEFAULT_CREDENTIAL_EXPIRATION_SECONDS 180
5858

5959
typedef enum _StreamSource {

0 commit comments

Comments
 (0)