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

adds readme, shot at ci #1

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: gh.build-and-test
on: [push]
jobs:
ubuntu_latest_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: prepare-vars
run: |
echo "SHORT_SHA=$(echo $GITHUB_SHA | head -c 7)">>$GITHUB_OUTPUT
echo "RS_KVS_STREAMER_VERSION=$(echo $GITHUB_SHA | head -c 7)">>$GITHUB_ENV
- name: prepare dependencies
run: sudo apt install libclang-dev clang libopencv-dev cmake ninja-build -y
- name: install-stable
run: rustup toolchain install stable
- name: use-stable
run: rustup default stable
- name: add-clippy
run: rustup component add clippy
- name: clippy
run: cargo clippy
- name: build
run: |
echo "building $RS_KVS_STREAMER_VERSION"
cargo build
- name: test
run: cargo test
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# `rs-kvs-streamer`

This is a pure-rust implementation/demonstration of how one might build an application
that streams video data to amazon web service's [kinesis video streams (kvs)][kvs].

The majority of the implementation here is combining the apis of several multimedia
crates, which are truly performing the heavy lifting:

1. [opencv] - this crate is used to interact with the camera hardware.
2. [openh264] - once we have video data, kvs prefers it to be encoded in the [h264] format.
2. [webm_iterable] - once we have encoded data, we need to put it in the [MKV] media container.

### Running

Currently, this crate exposes a single binary (`src/main.rs`), which uses [clap] to provide
a command line interface.

Credentials are loaded from the environment, and [dotenv] is being used to source an optional
`.env` file from the current working directory. A typical `.env` file would look like:

```
AWS_STREAM_ACCESS_KEY=...
AWS_STREAM_SECRET_KEY=...
AWS_STREAM_NAME=...
AWS_STREAM_ARN=...
AWS_STREAM_REGION=...
```

With a `.env` file prepared, the command line help can be viewed by running:

```
cargo run -- --help
```


[kvs]: https://aws.amazon.com/kinesis/video-streams/
[h264]: https://en.wikipedia.org/wiki/Advanced_Video_Coding
[opencv]: https://crates.io/crates/opencv
[openh264]: https://crates.io/crates/openh264
[webm_iterable]: https://crates.io/crates/webm-iterable
[clap]: https://crates.io/crates/clap
[dotenv]: https://crates.io/crates/dotenv
[MKV]: https://www.matroska.org/technical/notes.html
Loading