Skip to content

Commit f7bea92

Browse files
committed
c53da26 release notes updated for v1.3.1
ca7263a fix negotiation error caused by camera with fractional fps configure omxh264enc's key frame interval and turn off inline SPS/PPS header ce52eb9 command line args for demo app requires stream_name at the end 897ace1 Docker RTSP demo - Readme instructions 92cc0b8 Running RTSP demo producer within Docker container readme update for command line args to have stream_name at the end bfa020b Adding H265 parsing and adaptation support to the generator cfb6f6a install bison before flex because of dependency issue revealed in amazon linux 12822f7 add cmake path & h264 frames
1 parent 28ce058 commit f7bea92

File tree

24 files changed

+1547
-185
lines changed

24 files changed

+1547
-185
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ AWS_ACCESS_KEY_ID=<ACCESS_KEY> AWS_SECRET_ACCESS_KEY=<SECRET_KEY> ./kinesis_vide
229229
230230
```
231231

232+
##### Run the demo application from Docker
233+
234+
Refer the **README.md** file in the *docker_native_scripts* folder for running the build and RTSP demo app within Docker container.
235+
232236
#### Running C++ Unit tests
233237

234238
The executable for **unit tests** will be built in `./start` inside the `kinesis-video-native-build` directory. Launch it and it will run the unit test and kick off dummy frame streaming.
@@ -264,6 +268,21 @@ Ubuntu bulds link against the system versions of the open source component libra
264268
```
265269
to rebuild and re-link the project only.
266270

271+
##### Library not found error when running the demo application
272+
If any error similar to the following shows that the library path is not properly set:
273+
274+
```
275+
liblog4cplus-1.2.so.5: cannot open shared object file: No such file or directory
276+
277+
```
278+
To resolve this issue, export the LD_LIBRARY_PATH=`<full path to your sdk cpp directory`>/kinesis-video-native-build/downloads/local/lib. If you have downloaded the CPP SDK in `/opt/awssdk` directory then you can set
279+
the LD_LIBRARY_PATH as below:
280+
281+
```
282+
export LD_LIBRARY_PATH=/opt/awssdk/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib:$LD_LIBRARY_PATH
283+
284+
```
285+
267286
##### Raspberry PI failure to load the camera device.
268287

269288
To check this is the case run `ls /dev/video*` - it should be file not found. The remedy is to run the following:
@@ -322,6 +341,10 @@ make install
322341

323342

324343
## Release Notes
344+
345+
#### Release 1.3.1 (5th April 2018)
346+
* Fixed video source negotiation error caused by camera with fractional fps
347+
* Docker suport for RTSP streaming
325348
#### Release 1.3.0 (15th March 2018)
326349
* Fixed producer intermittent termination issue for some edge cases involving re-streaming on error.
327350
#### Release 1.2.3 (1st March 2018)

docker_native_scripts/Dockerfile

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
FROM ubuntu:17.10
2+
3+
RUN apt-get update
4+
RUN apt-get install -y git && \
5+
apt-get install -y vim && \
6+
apt-get install -y curl && \
7+
apt-get install -y xz-utils && \
8+
apt-get install -y byacc && \
9+
apt-get install -y wget && \
10+
apt-get install -y g++ && \
11+
apt-get install -y python2.7 && \
12+
apt-get install -y pkg-config && \
13+
apt-get install -y cmake && \
14+
apt-get install -y maven && \
15+
apt-get install -y openjdk-8-jdk && \
16+
rm -rf /var/lib/apt/lists/*
17+
ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/
18+
WORKDIR /opt/
19+
20+
# ================= HTTPS Certificate =====================================================================
21+
22+
RUN wget https://www.amazontrust.com/repository/SFSRootCAG2.pem
23+
RUN cp SFSRootCAG2.pem /etc/ssl/cert.pem
24+
25+
# ===== Git Checkout latest Kinesis Video Streams Producer SDK (CPP) =======================================
26+
27+
RUN git clone https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp.git
28+
29+
# ================ Build the Producer SDK (CPP) ============================================================
30+
31+
WORKDIR /opt/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/
32+
RUN chmod a+x ./install-script
33+
RUN ./install-script a
34+
COPY start_rtsp_in_docker.sh /opt/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/
35+
RUN chmod a+x ./start_rtsp_in_docker.sh
36+
37+
# comment the following step if you would like to customize the docker image build
38+
ENTRYPOINT ["/opt/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/start_rtsp_in_docker.sh"]
39+
40+
# ==== How to build docker image and run the container once its built =====================================
41+
#
42+
# ==== 1. build the docker image using the Dockerfile ======================================================
43+
# ==== Make sure the Dockerfile and start_rtsp_in_docker.sh is present in the current working directory =====
44+
#
45+
# $ docker build -t rtspdockertest .
46+
#
47+
# === List the docker images built ==================================================================================
48+
#
49+
# $ docker images
50+
# REPOSITORY TAG IMAGE ID CREATED SIZE
51+
# rtspdockertest latest 54f0d65f69b2 Less than a second ago 2.82GB
52+
#
53+
# === Start the container with credentials ===
54+
# $ docker run -it 54f0d65f69b2 <AWS_ACCESS_KEY_ID> <AWS_SECRET_ACCESS_KEY> <RTSP_URL> <STREAM_NAME>
55+
#
56+
#
57+
#
58+
59+
60+

docker_native_scripts/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
### Sample Docker container build and run instructions for Kinesis Video Streams RTSP demo application
2+
#### 1. Install Docker
3+
4+
Follow instructions to download and start Docker
5+
6+
* [ Docker download instructions ]( https://www.docker.com/community-edition#/download )
7+
* [Getting started with Docker](https://docs.docker.com/get-started/)
8+
9+
#### 2. Build Docker image
10+
Download the `Dockerfile` and `start_rtsp_in_docker.sh` into a folder. Once the Docker is installed and running, you can then build the docker image by using the following command.
11+
12+
```
13+
$ docker build -t rtspdockertest .
14+
```
15+
* Get the image id from the previous step (once the build is complete) by running the command `docker images` which will display the Docker images built in your system.
16+
17+
```
18+
$ docker images
19+
```
20+
21+
* Use the **IMAGE_ID** from the output of the previous command (e.g `f97f1a633597` ) :
22+
23+
```
24+
REPOSITORY TAG IMAGE ID CREATED SIZE
25+
rtspdockertest latest 54f0d65f69b2 Less than a second ago 2.82GB
26+
27+
```
28+
#### Start the Docker container
29+
---
30+
31+
* Start the Kinesis Video Streams Docker container using the following command:
32+
```
33+
$ docker run -it <IMAGE_ID> <AWS_ACCESS_KEY_ID> <AWS_SECRET_ACCESS_KEY> <RTSP_URL> <STREAM_NAME>
34+
```
35+
36+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
# Demo GStreamer Sample Application for RTSP Streaming to Kinesis Video Streams
3+
# To be run inside the Docker container
4+
5+
cd /opt/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/
6+
7+
# Start the demo rtsp application to send video streams
8+
export LD_LIBRARY_PATH=/opt/amazon-kinesis-video-streams-producer-sdk-cpp/kinesis-video-native-build/downloads/local/lib:$LD_LIBRARY_PATH
9+
AWS_ACCESS_KEY_ID=$1 AWS_SECRET_ACCESS_KEY=$2 ./kinesis_video_gstreamer_sample_rtsp_app $3 $4

kinesis-video-gst-demo/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

kinesis-video-gst-demo/kinesis_video_gstreamer_sample_app.cpp

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -174,30 +174,38 @@ static GstFlowReturn on_new_sample(GstElement *sink, CustomData *data) {
174174
}
175175

176176
GstBuffer *buffer = gst_sample_get_buffer(sample);
177-
size_t buffer_size = gst_buffer_get_size(buffer);
178-
uint8_t *frame_data = new uint8_t[buffer_size];
179-
gst_buffer_extract(buffer, 0, frame_data, buffer_size);
180-
181-
bool delta = GST_BUFFER_FLAG_IS_SET(buffer, GST_BUFFER_FLAG_DELTA_UNIT);
182-
FRAME_FLAGS kinesis_video_flags;
183-
if(!delta) {
184-
// Safeguard stream and playback in case of h264 keyframes comes with different PTS and DTS
185-
if (data->h264_stream_supported) {
186-
buffer->pts = buffer->dts;
187-
}
188-
kinesis_video_flags = FRAME_FLAG_KEY_FRAME;
189-
} else {
190-
kinesis_video_flags = FRAME_FLAG_NONE;
191-
}
177+
bool isDroppable = GST_BUFFER_FLAG_IS_SET(buffer, GST_BUFFER_FLAG_CORRUPTED) ||
178+
GST_BUFFER_FLAG_IS_SET(buffer, GST_BUFFER_FLAG_DECODE_ONLY);
179+
if (!isDroppable) {
180+
bool isHeader = GST_BUFFER_FLAG_IS_SET(buffer, GST_BUFFER_FLAG_HEADER);
181+
// drop if buffer contains header only and has invalid timestamp
182+
if (!(isHeader && (!GST_BUFFER_PTS_IS_VALID(buffer) || !GST_BUFFER_DTS_IS_VALID(buffer)))) {
183+
size_t buffer_size = gst_buffer_get_size(buffer);
184+
uint8_t *frame_data = new uint8_t[buffer_size];
185+
gst_buffer_extract(buffer, 0, frame_data, buffer_size);
186+
187+
bool delta = GST_BUFFER_FLAG_IS_SET(buffer, GST_BUFFER_FLAG_DELTA_UNIT);
188+
FRAME_FLAGS kinesis_video_flags;
189+
if(!delta) {
190+
// Safeguard stream and playback in case of h264 keyframes comes with different PTS and DTS
191+
if (data->h264_stream_supported) {
192+
buffer->pts = buffer->dts;
193+
}
194+
kinesis_video_flags = FRAME_FLAG_KEY_FRAME;
195+
} else {
196+
kinesis_video_flags = FRAME_FLAG_NONE;
197+
}
192198

193-
if (false == put_frame(data->kinesis_video_stream, frame_data, buffer_size, std::chrono::nanoseconds(buffer->pts),
194-
std::chrono::nanoseconds(buffer->dts), kinesis_video_flags)) {
195-
g_printerr("Dropped frame!\n");
199+
if (false == put_frame(data->kinesis_video_stream, frame_data, buffer_size, std::chrono::nanoseconds(buffer->pts),
200+
std::chrono::nanoseconds(buffer->dts), kinesis_video_flags)) {
201+
g_printerr("Dropped frame!\n");
202+
}
203+
204+
delete[] frame_data;
205+
}
196206
}
197207

198-
delete[] frame_data;
199208
gst_sample_unref(sample);
200-
201209
return GST_FLOW_OK;
202210
}
203211

@@ -206,7 +214,7 @@ static bool format_supported_by_source(GstCaps *src_caps, bool h264_stream, int
206214
query_caps = gst_caps_new_simple(h264_stream ? "video/x-h264" : "video/x-raw",
207215
"width", G_TYPE_INT, width,
208216
"height", G_TYPE_INT, height,
209-
"framerate", GST_TYPE_FRACTION, framerate, 1,
217+
"framerate", GST_TYPE_FRACTION_RANGE, framerate, 1, framerate + 1, 1,
210218
NULL);
211219
return gst_caps_can_intersect(query_caps, src_caps);
212220
}
@@ -323,7 +331,8 @@ int gstreamer_init(int argc, char* argv[]) {
323331

324332
if (argc < 2) {
325333
LOG_ERROR(
326-
"Usage: AWS_ACCESS_KEY_ID=SAMPLEKEY AWS_SECRET_ACCESS_KEY=SAMPLESECRET ./kinesis_video_gstreamer_sample_app my-stream-name -w width -h height -f framerate -b bitrateInKBPS");
334+
"Usage: AWS_ACCESS_KEY_ID=SAMPLEKEY AWS_SECRET_ACCESS_KEY=SAMPLESECRET ./kinesis_video_gstreamer_sample_app -w width -h height -f framerate -b bitrateInKBPS my-stream-name \n \
335+
or AWS_ACCESS_KEY_ID=SAMPLEKEY AWS_SECRET_ACCESS_KEY=SAMPLESECRET ./kinesis_video_gstreamer_sample_app my-stream-name");
327336
return 1;
328337
}
329338

@@ -455,7 +464,7 @@ int gstreamer_init(int argc, char* argv[]) {
455464
}
456465
}
457466
if (!found_resolution) {
458-
g_printerr("Default list of resolutions not supported by video source\n");
467+
g_printerr("Default list of resolutions (1920x1080, 1280x720, 640x480) are not supported by video source\n");
459468
return 1;
460469
}
461470
}
@@ -480,7 +489,7 @@ int gstreamer_init(int argc, char* argv[]) {
480489
"format", G_TYPE_STRING, "I420",
481490
"width", G_TYPE_INT, width,
482491
"height", G_TYPE_INT, height,
483-
"framerate", GST_TYPE_FRACTION, framerate, 1,
492+
"framerate", GST_TYPE_FRACTION_RANGE, framerate, 1, framerate + 1, 1,
484493
NULL);
485494
} else {
486495
source_caps = gst_caps_new_simple("video/x-h264",
@@ -498,7 +507,8 @@ int gstreamer_init(int argc, char* argv[]) {
498507
g_object_set(G_OBJECT (data.encoder), "allow-frame-reordering", FALSE, "realtime", TRUE, "max-keyframe-interval",
499508
45, "bitrate", bitrateInKBPS, NULL);
500509
} else if (isOnRpi) {
501-
g_object_set(G_OBJECT (data.encoder), "control-rate", 1, "target-bitrate", bitrateInKBPS*10000, NULL);
510+
g_object_set(G_OBJECT (data.encoder), "control-rate", 1, "target-bitrate", bitrateInKBPS*10000,
511+
"periodicity-idr", 45, "inline-header", FALSE, NULL);
502512
} else {
503513
g_object_set(G_OBJECT (data.encoder), "bframes", 0, "key-int-max", 45, "bitrate", bitrateInKBPS, NULL);
504514
}
@@ -511,7 +521,7 @@ int gstreamer_init(int argc, char* argv[]) {
511521
"alignment", G_TYPE_STRING, "au",
512522
"width", G_TYPE_INT, width,
513523
"height", G_TYPE_INT, height,
514-
"framerate", GST_TYPE_FRACTION, framerate, 1,
524+
"framerate", GST_TYPE_FRACTION_RANGE, framerate, 1, framerate + 1, 1,
515525
NULL);
516526
if (!data.h264_stream_supported) {
517527
gst_caps_set_simple(h264_caps, "profile", G_TYPE_STRING, "baseline",

kinesis-video-native-build/min-install-script

100755100644
File mode changed.

kinesis-video-pic/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.iml
2+
build
3+
outputs
4+
.idea

kinesis-video-pic/src/heap/src/Common.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -303,29 +303,3 @@ VOID decrementUsage(PHeap pHeap, UINT32 overallSize) {
303303
pHeap->heapSize -= overallSize;
304304
pHeap->numAlloc--;
305305
}
306-
307-
/**
308-
* Prints the content of the memory
309-
*/
310-
VOID printMemory(PVOID pMem, UINT32 size)
311-
{
312-
DLOGE("============================================");
313-
DLOGE("Dumping memory: %p, size: %d", pMem, size);
314-
DLOGE("++++++++++++++++++++++++++++++++++++++++++++");
315-
CHAR buf[256];
316-
PCHAR pCur;
317-
pCur = buf;
318-
PBYTE pByte = (PBYTE) pMem;
319-
for(UINT32 i = 0; i < size; i++) {
320-
sprintf(pCur, "%02x ", *pByte++);
321-
pCur += 3;
322-
if ((i + 1) % 16 == 0) {
323-
DLOGE("%s", buf);
324-
buf[0] = 0;
325-
pCur = buf;
326-
}
327-
}
328-
DLOGE("++++++++++++++++++++++++++++++++++++++++++++");
329-
DLOGE("Dumping memory done!");
330-
DLOGE("============================================");
331-
}

kinesis-video-pic/src/heap/src/Common.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,6 @@ DEFINE_INIT_HEAP(commonHeapInit);
7878
*/
7979
DEFINE_HEAP_CHK(commonHeapDebugCheckAllocator);
8080

81-
/**
82-
* Prints the content of the memory
83-
*/
84-
VOID printMemory(PVOID, UINT32);
85-
8681
/**
8782
* Increment the allocations/count
8883
*/

0 commit comments

Comments
 (0)