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

Docs for ubuntu and kvs #13

Merged
merged 3 commits into from
Nov 28, 2018
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
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ Supported output types:
* Writing of a JPEG file every second
* WebRTC
* For near-realtime previewing of the video (and audio)
* [AWS Kinesis Video Stream](https://aws.amazon.com/kinesis/video-streams/)
* Video only (not audio)
* See the specific [installation instructions](docs/install_kvs.md)
* Local playback
* For video, a window appears to view the video
* Because Brave has been designed to work remotely
Expand Down Expand Up @@ -103,17 +106,12 @@ First, install the dependencies, and then clone this repo.
### Dependencies
* Python 3.6 (or higher)
* GStreamer 1.14.3 or higher (including the good/bad/ugly packages)
* Python libraries from pip:
* To run: `pyyaml gbulb sanic websockets psutil`
* In addition, to test: `pytest`
* The GStreamer Python libraries
* IF you want to send or receive RTMP: librtmp and openh264

### How to install the dependencies
* On MacOS, see [How to install on MacOS](./docs/install_macos.md)
* On CentOS 7, see [How to install on CentOS 7](./docs/install_centos7.md)
* On Ubuntu/Debian, it should be possible to install all depedencies using APT. (Though at the time of writing, you'll need to use _unstable_ to get GStreamer 1.14)
* Multiple Python libraries (installed by pipenv)

### Install guides
* [How to install on MacOS](./docs/install_macos.md)
* [How to install on Ubuntu](./docs/install_ubuntu.md)
* [How to install on CentOS 7](./docs/install_centos7.md)

## How to use
To start:
Expand Down
Binary file modified docs/arch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 73 additions & 0 deletions docs/install_kvs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Installing the 'kvssink' plugin to enable outputting to Kinesis Video Streams
This guide explains how to install [Amazon's Kinesis Video element](https://aws.amazon.com/kinesis/video-streams/) for GStreamer, called 'kvssink'. Doing so allows [Brave](../README.md) to output to a Kinesis video stream.

These instructions are for Ubuntu 18.10. It should be possible to do something similar for MacOS and CentOS. _(Pull requests to add this to the documentation are very welcome!)_

It is assumed that Brave and its dependencies are already installed. [Click here for the guide to installing Brave on Ubuntu.](./install_ubuntu.md)

_NOTE: The current implementation only sends video, not audio, to Kinesis Video._

## STEP 1: Dependencies
We need some additional dependencies in order to compile Kinesis Video:

```
sudo apt-get install libssl-dev libgirepository1.0-dev liblog4cplus-dev libglib2.0-dev libgstreamer-plugins-bad1.0-dev libssl1.1 yasm libltdl7 libfl2 bison cmake libcurl4-openssl-dev libgtest-dev
```

## STEP 2: Build Kinesis Video
These instructions don't use the `install-script` that Amazon provides because it compiles its own GStreamer, whereas we want to use the one already installed.

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

PKG_CONFIG_PATH="/usr/lib/x86_64-linux-gnu/pkgconfig/" cmake CMakeLists.txt
make
```

Test what's been made with:

```
gst-inspect-1.0 ./libgstkvssink.so
```

Check that there are no errors.

Then, manually install the two files into GStreamer's standard location with:

```
sudo cp libgstkvssink.so libproducer.so /usr/lib/x86_64-linux-gnu/gstreamer-1.0/
```

Now, we can test GStreamer's acceptance of the element with:

```
gst-inspect-1.0 kvssink
```

If that works without error, then we are done!

## STEP 3: Use Brave to output to Kinesis Video

First, [create a Kinesis Video Stream](https://us-west-2.console.aws.amazon.com/kinesisvideo/streams).

You can instruct Brave to output the stream either by adding it to Brave's config file, or via the API (or web GUI). You can add any number of streams, subject to the capacity of your server (and the size of your Amazon bill!)

Here is an example config file to set up one stream:

```
default_outputs:
- type: kvs
props:
stream_name: 'name-of-your-stream'
```

Ensure the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables are set. This is the same as [used by the AWS comand-line tool](https://docs.aws.amazon.com/cli/latest/userguide/cli-environment.html).

For example, if the above config file was written to `kvs.yaml`, then it could be invocated with:

```
AWS_ACCESS_KEY_ID="XXX" AWS_SECRET_ACCESS_KEY="YYY" ./brave.py -c kvs.yaml
```

Happy streaming!
4 changes: 2 additions & 2 deletions docs/install_macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ First up, make sure you have Homebrew.

## Installing Dependancies

Brave uses from of the newier features of Python. As such we recomend python 3.6 (or higher).
Brave uses from of the newer features of Python. As such we recomend python 3.6 (or higher).

### Managing Dependencies

Brave uses [Pipeenv](https://packaging.python.org/tutorials/managing-dependencies/#managing-dependencies) to manage an isolate its dependencies
Brave uses [Pipeenv](https://packaging.python.org/tutorials/managing-dependencies/#managing-dependencies) to manage an isolate its dependencies

If not installed please install using:

Expand Down
60 changes: 60 additions & 0 deletions docs/install_ubuntu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Installing on Ubuntu
This is instructions on how to install [Brave](../README.md), and its dependencies, on Ubuntu.

## Ubuntu version
You must use at least version 18.10, to access a recent version of GStreamer (1.14.3 or later) via Apt.

## STEP 1: Dependencies
Use `apt-get` to install the bulk of the dependencies:

```
sudo apt-get update
sudo apt-get install -y \
gcc \
gir1.2-gst-plugins-bad-1.0 \
git \
gobject-introspection \
gstreamer1.0-libav \
gstreamer1.0-nice \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-ugly \
gstreamer1.0-tools \
libcairo2-dev \
libcairo2-dev \
libgirepository1.0-dev \
pkg-config \
python-gst-1.0 \
python3-dev \
python3-pip
```

### STEP 2: Python dependencies
Brave uses [Pipenv](https://packaging.python.org/tutorials/managing-dependencies/#managing-dependencies) to manage an isolate its dependencies.

Install with:

```
pip3 install --user pipenv
export PATH="${HOME}/.local/bin:$PATH"
pipenv install
```

If you're having difficulties, try this reference: https://xkcd.com/1987/. Gotta love Python.


## STEP 3: Installing Brave
Simply clone Brave from GitHub, and try running it:

```
git clone https://github.com/bbc/brave.git
cd brave
pipenv run ./brave.py
```

That's it!

## Optional: Support fort AWS Kinesis Video

If you wish to output to a Kinesis Video Stream, there are [separate instructions](./install_kvs.md) on installing the necessary GStreamer element.