Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kvssink soft start/stop support #1153

Open
wants to merge 28 commits into
base: develop-pre-3.4.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6062350
Starting
stefankiesz Mar 11, 2024
35747c5
Started clean sample
stefankiesz Mar 12, 2024
235d0d0
more
stefankiesz Mar 12, 2024
ff0c19f
Streaming to KVS working
stefankiesz Mar 12, 2024
8f31a63
Intermittent streaming working.
stefankiesz Mar 12, 2024
bcec5b6
Add comments, cleanup
stefankiesz Mar 12, 2024
9c371da
EOS stream message working
stefankiesz Mar 12, 2024
34a6c71
Improvements
stefankiesz Mar 12, 2024
7e72aa7
Revert changes to original sample
stefankiesz Mar 13, 2024
0a958da
more
stefankiesz Mar 13, 2024
137a8b0
more
stefankiesz Mar 13, 2024
12bbc8d
Cleanup kvssink
stefankiesz Mar 13, 2024
76f6d12
Cleanup intermittent sample and kvssink
stefankiesz Mar 13, 2024
63b619f
more
stefankiesz Mar 13, 2024
91725e1
Remove rtsp related things
stefankiesz Mar 13, 2024
7dafff8
Switch to cv wait for all waits
stefankiesz Mar 13, 2024
c173d9b
Merge remote-tracking branch 'origin/develop' into clean-start/stop
stefankiesz Mar 27, 2024
39817bc
Address some PR comments
stefankiesz Apr 18, 2024
533da5b
Link with kvspicUtils
stefankiesz Apr 18, 2024
1979465
kvssink to send eofr upon eos, fix testsrc not stopping issue
stefankiesz Apr 18, 2024
f993930
Address review comments
stefankiesz Apr 18, 2024
b92ccb7
Don't require stream name arg
stefankiesz Apr 19, 2024
4b09724
Add sample instructions to README.md
stefankiesz Apr 19, 2024
0c32012
Fix typos in ReadMe, add language to code blocks
stefankiesz Apr 19, 2024
0ad5deb
Install pkgconfiglite
stefankiesz Apr 19, 2024
566ad7c
Address comments
stefankiesz Apr 23, 2024
2fcc6bf
Fix double space typo
stefankiesz Apr 24, 2024
0df1386
nit ReadMe change
stefankiesz Apr 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ jobs:
Move-Item -Path "D:\a\amazon-kinesis-video-streams-producer-sdk-cpp\amazon-kinesis-video-streams-producer-sdk-cpp\*" -Destination "C:\amazon-kinesis-video-streams-producer-sdk-cpp"
- name: Install dependencies
run: |
choco install pkgconfiglite
choco install nasm strawberryperl
choco install gstreamer --version=1.22.8
choco install gstreamer-devel --version=1.22.8
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ open-source/
outputs
tags
dependency

.vs
.vscode
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ if(BUILD_GSTREAMER_PLUGIN)
target_link_libraries(gstkvssink PRIVATE ${LOG4CPLUS_LIBRARIES} ${GST_APP_LIBRARIES} KinesisVideoProducer)

add_executable(kvssink_gstreamer_sample samples/kvssink_gstreamer_sample.cpp)
target_link_libraries(kvssink_gstreamer_sample ${LOG4CPLUS_LIBRARIES} ${GST_APP_LIBRARIES} kvspic)
target_link_libraries(kvssink_gstreamer_sample ${LOG4CPLUS_LIBRARIES} ${GST_APP_LIBRARIES} kvspicUtils)

add_executable(kvs_gstreamer_sample samples/kvs_gstreamer_sample.cpp)
target_link_libraries(kvs_gstreamer_sample ${LOG4CPLUS_LIBRARIES} ${GST_APP_LIBRARIES} KinesisVideoProducer kvspic)
target_link_libraries(kvs_gstreamer_sample ${LOG4CPLUS_LIBRARIES} ${GST_APP_LIBRARIES} KinesisVideoProducer kvspicUtils)

add_executable(kvs_gstreamer_multistream_sample samples/kvs_gstreamer_multistream_sample.cpp)
target_link_libraries(kvs_gstreamer_multistream_sample ${LOG4CPLUS_LIBRARIES} ${GST_APP_LIBRARIES} KinesisVideoProducer)
Expand All @@ -257,6 +257,9 @@ if(BUILD_GSTREAMER_PLUGIN)
add_executable(kvs_gstreamer_file_uploader_sample samples/kvs_gstreamer_file_uploader_sample.cpp)
target_link_libraries(kvs_gstreamer_file_uploader_sample ${LOG4CPLUS_LIBRARIES} ${GST_APP_LIBRARIES})

add_executable(kvssink_intermittent_sample samples/kvssink_intermittent_sample.cpp )
target_link_libraries(kvssink_intermittent_sample ${LOG4CPLUS_LIBRARIES} ${GST_APP_LIBRARIES} kvspicUtils)

install(
TARGETS gstkvssink
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
Expand Down
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ If the library needs to be installed, run `make install`. This will install in d
## Run
### GStreamer Plugin (kvssink)

#### Loading Element
#### Loading kvssink 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.
Expand Down Expand Up @@ -180,7 +180,7 @@ No such element or plugin 'kvssink'
```


#### Using Element
#### Using kvssink Element
The kvssink element has the following required parameters:

* `stream-name` -- The name of the destination Kinesis video stream.
Expand All @@ -190,7 +190,25 @@ The kvssink element has the following required parameters:
* `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](https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/examples-gstreamer-plugin.html)
### Running kvssink Samples
The SDK comes with two programmatic GStreamer samples: `kvssink_gstreamer_sample` and `kvssink_intermittent_sample`. For more use cases, see the CLI pipeline examples at [Example: Kinesis Video Streams Producer SDK GStreamer Plugin](https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/examples-gstreamer-plugin.html).

The programmatic samples require the AWS region to be set with the `AWS_DEFAULT_REGION` environment variable. For example:
```bash
export AWS_DEFAULT_REGION=us-west-2
```

After building the SDK, loading kvssink into the GStreamer plugin path, and setting a region, the sample executables, which are located in the `build` directory, can be run.

#### kvssink Intermittent Sample
Usage:
```bash
./kvssink_intermittent_sample <stream-name (optional)> <testsrc or devicesrc (optional)>
```
Setting the source to `testsrc` will use [videotestsrc](https://gstreamer.freedesktop.org/documentation/videotestsrc/?gi-language=c) and to `devicesrc` will use [autovideosrc](https://gstreamer.freedesktop.org/documentation/autodetect/autovideosrc.html?gi-language=c). By default, kvssink uses "DEFAULT_STREAM" as the stream name, and the sample uses videotestsrc as the source. If a stream with the provided or default name does not exist, the stream will automatically be created.

The intermittent kvssink sample will stream video for 20 seconds, then pause for 40 seconds, and repeat until an interrupt signal is received. To manually adjust the streaming and paused intervals, you can change the `KVS_INTERMITTENT_PLAYING_INTERVAL_SECONDS` and `KVS_INTERMITTENT_PAUSED_INTERVAL_SECONDS` values in the *kvssink_intermittent_sample.cpp* file.

stefankiesz marked this conversation as resolved.
Show resolved Hide resolved

## 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`.
Expand Down
Loading
Loading