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

Rework the ReadMe to be more quick-start friendly #1173

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from

Conversation

stefankiesz
Copy link
Contributor

@stefankiesz stefankiesz commented May 6, 2024

What was changed?
The ReadMe was re-worked to be more quick-start friendly. Missing information was added and made into tables. Typos and grammar issues were addressed.
(More details in the Overview section below.)

Why was it changed?
To improve the ReadMe and correct outstanding issues.

How was it changed?
By modifying the ReadMe document to address the above issues.

What testing was done for the changes?
The document was pasted into a spelling and grammar checker.


Overview

  • Add a collapsible vertical table of contents
  • Add a Quick Start section
  • Extend samples instructions
  • Add missing Windows instructions
  • Fix incorrect dependency installation commands
  • Add more links to resources and references
    • New links include: AWS KVS getting started page, AWS KVS FAQs page, GStreamer element docs, Java Producer SDK
    • Also added a link to Producer C in the Key Features section incase user does not need JNI nor GStreamer features
  • Make the CMake Arguments section into a table and fix typos in the descriptions
  • Make the kvssink parameters into a table, fix missing links, add in aws-region parameter
  • Mention and show how to stream from file with the kvssink sample
  • To the Quick Start section, add instructions for how/where to view the footage from the samples and link troubleshoot guides
  • ...more misc. changes

Future Improvements

  • Consider splitting the QuickStart instructions for building the SDK into build-with-dependencies a build-using-system-dependencies and demonstrate how to install the system dependencies and the correct versions.
  • Improve upon and add to the Debugging/Troubleshooting section - likely should add more links to AWS docs. Specify Java version for JNI. Also should probably add a link to Java SDK and instructions if any are missing on that repo's ReadMe.
  • Add installation commands to all the prerequisite packages such as git and cmake. This will likely only fit well if the QuickStart section gets restructured into 3 separate sections for each OS.
  • Add a "Running Tests" section to show how to build and run the tests. Include details such as AWS authentication and how resources are managed when tests are running and failing.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

* `pkg-config` for _Mac_/_Linux_, `pkgconfiglite` for _Windows_
* `m4`
* _Windows_ only: `nasm` and `strawberryperl`

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest adding the installation commands for these.

sudo apt-get update
sudo apt-get install git cmake ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it would be unnecessarily verbose since these are very common packages which are likely already present on users' machines, but I'll add it and see how we feel about it.

Copy link
Contributor Author

@stefankiesz stefankiesz Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thought, it definitely would be too verbose to have all these commands for all 3 OSs, but it should fit well if we restructure the QuickStart section in a future PR to be 3 separate sections for each OS. Will leave as is for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it would be unnecessarily verbose since these are very common packages which are likely already present on users' machines, but I'll add it and see how we feel about it.

In the case that it's not or if I want to verify for myself that it is installed? This information seems quite important to have.


If you are building on Windows you need to generate `NMake Makefiles`, you should run `cmake .. -G "NMake Makefiles"`
_Mac and Linux_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would suggest splitting this into 2 subsections:

  1. Build from scratch (build with dependencies=ON)
  2. Build using system libraries (build with dependencies=OFF). For this, you would also need to install the necessary dependencies using system package manager

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to add this to the PR description as a future addition to consider, but I'm not set on doing this quite yet since for the smoothest onboarding experience we would recommend to do build dependencies to ensure a supported version of a dependency library is being used.

Copy link
Contributor Author

@stefankiesz stefankiesz Jul 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To add to that, it's not as simple as just including the install instructions with the correct versions: users might already have some of the dependency libraries installed with unsupported versions and there would be potential for CMake or pkgconfig to link the incorrect ones.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 105 lines in your changes missing coverage. Please review.

Project coverage is 16.30%. Comparing base (eeb392f) to head (03d8f84).
Report is 10 commits behind head on develop.

Current head 03d8f84 differs from pull request most recent head 3bb045b

Please upload reports for the commit 3bb045b to get more accurate results.

Files Patch % Lines
samples/kvssink_gstreamer_sample.cpp 0.00% 50 Missing ⚠️
...mazonaws/kinesis/video/producer/jni/Parameters.cpp 0.00% 46 Missing ⚠️
src/gstreamer/gstkvssink.cpp 0.00% 8 Missing ⚠️
...s/video/producer/jni/KinesisVideoClientWrapper.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1173      +/-   ##
===========================================
- Coverage    16.48%   16.30%   -0.18%     
===========================================
  Files           50       50              
  Lines         7019     7095      +76     
===========================================
  Hits          1157     1157              
- Misses        5862     5938      +76     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

README.md Outdated Show resolved Hide resolved
@stefankiesz stefankiesz marked this pull request as ready for review July 3, 2024 19:21
GStreamer and JNI is NOT built by default, if you wish to build both you MUST execute `cmake .. -DBUILD_GSTREAMER_PLUGIN=ON -DBUILD_JNI=TRUE`
### Download
```bash
git clone https://github.com/awslabs/amazon-kinesis-video-streams-producer-sdk-cpp.git
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For faster download, let's clone only the master branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the difference cloning this on my home network. Cloning the full repo, it takes between 1 and 2 seconds to clone and takes up 14 Mb. With --single-branch in the command, it still takes between 1 and 2 seconds to clone and takes up 13 Mb.

I don't think these gains are worth the loss of readily being able to checkout remote branches.

README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
export LD_LIBRARY_PATH=`pwd`/open-source/local/lib
./kvssink_intermittent_sample <stream-name> <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 KVS stream with the provided or default name does not exist, the stream will automatically be created.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should add the stream parameters (2 hours retention)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the relevance of that information here? I don't want to crowd all the details here as it is a "quick start" guide and it would be prone to being out of date if we don't update it here if the default parameters ever change. I'd prefer these details live in the AWS docs and not here in the GitHub ReadMe.

<br>

#### Running Samples in offline mode
By default, the samples run in near-real-time 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`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is confusing, you can explain this a bit better

Copy link
Contributor Author

@stefankiesz stefankiesz Jul 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This I just copied over from the existing ReadMe, but looking at it now, this is not correct instructions as we don't expose a StreamInfo object in the samples. Instead, the streaming_type variable should be modified to change the streaming type. However, I don't see why this would ever need to be done if the sample already changes it to offline mode when streaming from file. I'll remove this section entirely if you agree.

| BUILD_GSTREAMER_PLUGIN | OFF | Build the kvssink GStreamer plugin
| BUILD_JNI | OFF | Build C++ wrapper for JNI to expose the functionality to Java/Android
| BUILD_DEPENDENCIES | ON | Build depending libraries from source
| BUILD_TEST | OFF | Build unit/integration tests, may be useful to confirm support for your device, to run tests: `./tst/producerTest`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should mention if credentials & region are required to run the tests & whether the resources get cleaned up or not in case of failing tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel this would be too verbose for this table. I will add including a "Running Tests" section to the PR description as a potential future addition where these details would fit in well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's a good idea. Having a section dedicated to how to run the tests and the sanitizers and view the results.

| BUILD_DEPENDENCIES | ON | Build depending libraries from source
| BUILD_TEST | OFF | Build unit/integration tests, may be useful to confirm support for your device, to run tests: `./tst/producerTest`
| CODE_COVERAGE | OFF | Enable coverage reporting
| COMPILER_WARNINGS | OFF | Enable all compiler warnings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this off by default?

Copy link
Contributor Author

@stefankiesz stefankiesz Jul 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't know as this was likely a decision made long ago, but I'd imagine it was to reduce build log verbosity.

Also, the COMPILER_WARNINGS flag does nothing in PIC, Producer C, and Producer CPP, yet we have it as an option in all 3 SDKs. It's not a built-in option as far as what I can see from a quick search.

Let's just remove this from the table? ...and from the CMakeLists in a separate PR.

README.md Outdated Show resolved Hide resolved
### Debugging

#### Build Issues
* If you are running into issues building libcurl on M1 Mac, you can try `brew unlink openssl`.
* When building the JNI, if you run into a cmake error `Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)`, make sure Java is installed and your environment variables are set correctly:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe also need java 8 or 11..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improving upon the Debugging section is already in the PR description as an action item, this will fall in that scope as it will need testing and verification.

_Windows_
```bat
choco install gstreamer --version=1.22.8
choco install gstreamer-devel --version=1.22.8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come the gstreamer version is only specified in the windows? Does mac and linux requires certain gstreamer versions? Is this the only supported gstreamer version for windows?


### Build
#### Prepare a build directory in the newly checked out repository:
```bash
mkdir -p amazon-kinesis-video-streams-producer-sdk-cpp/build
cd amazon-kinesis-video-streams-producer-sdk-cpp/build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to clone it in the C:/ for windows due to file path length restrictions?

Also can we adjust this to clone only the master branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants