Skip to content

Commit 25acfc9

Browse files
committed
Added documentation for ESP port
- esp_port/README.md: Added complete description and setup guide for ESP chipsets - esp_port/README.md: Describe two solutions: webrtc_classic and split mode - Added puml diagrams under esp_port/docs showcasing the workflow in both modes - Added a README under example/app_common/spiffs/certs/
1 parent e53b739 commit 25acfc9

File tree

8 files changed

+598
-306
lines changed

8 files changed

+598
-306
lines changed

README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ Please refer to the release notes in [Releases](https://github.com/awslabs/amazo
5353
- Sub 200k library size
5454
- OpenSSL, libsrtp, libjsmn, libusrsctp and libwebsockets dependencies.
5555

56+
**For Espressif ESP32/ESP-IDF users:**
57+
If you are building for ESP32 or using ESP-IDF, please see the [ESP-IDF/ESP32 Port README](./esp_port/README.md) for hardware-specific setup, configuration, and usage instructions.
58+
5659
## Build
5760
### Download
5861
To download run the following command:
@@ -76,7 +79,7 @@ GStreamer is installed on your system.
7679

7780
On Ubuntu and Raspberry Pi OS you can get the libraries by running
7881
```shell
79-
sudo apt-get install cmake m4 pkg-config libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools
82+
sudo apt-get install cmake m4 pkg-config libssl-dev libcurl4-openssl-dev liblog4cplus-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools
8083
```
8184

8285
By default we download all the libraries from GitHub and build them locally, so should require nothing to be installed ahead of time. If you do wish to link to existing libraries you can use the following flags to customize your build.
@@ -184,7 +187,7 @@ To build the library and the provided samples run make in the build directory yo
184187

185188
### Building with dependencies off
186189

187-
In addition to the dependencies already installed, install the dependencies using the appropriate package manager.
190+
In addition to the dependencies already installed, install the dependencies using the appropriate package manager.
188191

189192
On Ubuntu:
190193
`sudo apt-get install libsrtp2-dev libusrsctp-dev libwebsockets-dev`
@@ -244,7 +247,7 @@ export AWS_KVS_LOG_LEVEL=<LOG_LEVEL>
244247

245248
For example, the following command switches on `DEBUG` level logs while runnning the samples.
246249
```shell
247-
export AWS_KVS_LOG_LEVEL=2
250+
export AWS_KVS_LOG_LEVEL=2
248251
```
249252

250253
Note: The default log level is `LOG_LEVEL_WARN`.
@@ -262,7 +265,7 @@ Note: This log level is extremely VERBOSE and could flood the files if using fil
262265

263266
<details>
264267
<summary>Time-to-first-frame breakdown metrics</summary>
265-
268+
266269
There is a flag in the sample application which (pSampleConfiguration->enableSendingMetricsToViewerViaDc) can be set to TRUE to send metrics from the master to the [JS viewer](https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-js/examples/index.html). This helps get a detailed breakdown of time-to-first-frame and all the processes and API calls on master and the viewer both. This is intended to be used with the KVS WebRTC C SDK running as the master and the JS SDK as the viewer. The master sends peer, ice-agent, signaling and data-channel metrics to the viewer which are plotted ~ 20 seconds after the viewer is started. Since the timeline plot is intended to understand the time-to-first-frame, the sample web page needs to be refreshed and the master needs to be restarted if a new / updated plot is needed. While using the SDK in this mode, it is expected that all datachannel messages are JSON messages. This feature is only meant to be used for a single viewer at a time.
267270
</details>
268271

@@ -291,7 +294,7 @@ This application sends sample H264/Opus frames (path: `/samples/h264SampleFrames
291294
./samples/kvsWebrtcClientMaster <channelName> <storage-option> <audio-codec> <video-codec>
292295
```
293296

294-
To use the **Storage for WebRTC** feature, run the same command as above but with an additional command line arg to enable the feature.
297+
To use the **Storage for WebRTC** feature, run the same command as above but with an additional command line arg to enable the feature.
295298

296299
```shell
297300
./samples/kvsWebrtcClientMaster <channelName> 1 <audio-codec> <video-codec>
@@ -381,7 +384,7 @@ If using the WebRTC SDK Test Page, set the following values using the same AWS c
381384
* Secret access key
382385
* Signaling channel name
383386
* Client ID (optional)
384-
387+
385388
Then choose Start Viewer to start live video streaming of the sample H264/Opus frames.
386389

387390
## Memory optimization switches
@@ -477,7 +480,7 @@ Set the environment variables for IoT Core credentials:
477480

478481
```shell
479482
export AWS_IOT_CORE_CREDENTIAL_ENDPOINT=xxxxx.credentials.iot.xxxxx.amazonaws.com
480-
export AWS_IOT_CORE_PRIVATE_KEY=xxxxxxxx-private.pem.key
483+
export AWS_IOT_CORE_PRIVATE_KEY=xxxxxxxx-private.pem.key
481484
export AWS_IOT_CORE_ROLE_ALIAS=xxxxxx
482485
export AWS_IOT_CORE_THING_NAME=xxxxxx
483486
export AWS_IOT_CORE_CERT=xxxxx-certificate.pem.crt
@@ -575,7 +578,7 @@ More information about what environment variables you can configure can be found
575578

576579
### Filtering network interfaces
577580

578-
This is useful to reduce candidate gathering time when it is known for certain network interfaces to not work well. A sample callback is available in `Common.c`. The `iceSetInterfaceFilterFunc` in `KvsRtcConfiguration` must be set to the required callback. In the sample, it can be done this way in `initializePeerConnection()`:
581+
This is useful to reduce candidate gathering time when it is known for certain network interfaces to not work well. A sample callback is available in `Common.c`. The `iceSetInterfaceFilterFunc` in `KvsRtcConfiguration` must be set to the required callback. In the sample, it can be done this way in `initializePeerConnection()`:
579582
`configuration.kvsRtcConfiguration.iceSetInterfaceFilterFunc = sampleFilterNetworkInterfaces`
580583

581584
### Building on MacOS M1
@@ -602,7 +605,7 @@ The default thread stack size in the KVS WebRTC SDK is determined by the system'
602605

603606
### Setting ICE related timeouts
604607

605-
There are some default timeout values set for different steps in ICE in the [KvsRtcConfiguration](https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-c/structKvsRtcConfiguration.html). These are configurable in the application. While the defaults are generous, there could be applications that might need more flexibility to improve chances of connection establishment because of poor network.
608+
There are some default timeout values set for different steps in ICE in the [KvsRtcConfiguration](https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-c/structKvsRtcConfiguration.html). These are configurable in the application. While the defaults are generous, there could be applications that might need more flexibility to improve chances of connection establishment because of poor network.
606609

607610
You can find the default setting in the logs:
608611
```
@@ -615,15 +618,15 @@ You can find the default setting in the logs:
615618
Let us look into when each of these could be changed:
616619
1. `iceCandidateNominationTimeout`: Say the connection with host/srflx could not be established and TURN seems to be the only resort. Let us assume it takes about 15 seconds to gather the first local relay candidate, the application could set the timeout to a value more than 15 seconds to ensure candidate pairs with the local relay candidate are tried for success. If the value is set to less than 15 seconds in this case, the SDK would lose out on trying a potential candidate pair leading to connection establishment failure
617620
2. `iceLocalCandidateGatheringTimeout`: Say the host candidates would not work and srflx/relay candidates need to be tried. Due to poor network, it is anticipated the candidates are gathered slowly and the application does not want to spend more than 20 seconds on this step. The goal is to try all possible candidate pairs. Increasing the timeout helps in giving some more time to gather more potential candidates to try for connection. Also note, this parameter increase would not make a difference in the situation unless `iceCandidateNominationTimeout` > `iceLocalCandidateGatheringTimeout` since nomination step should also be given time to work with the new candidates
618-
3. `iceConnectionCheckTimeout`: It is useful to increase this timeout in unstable/slow network where the packet exchange takes time and hence the binding request/response. Essentially, increasing it will allow atleast one candidate pair to be tried for nomination by the other peer.
621+
3. `iceConnectionCheckTimeout`: It is useful to increase this timeout in unstable/slow network where the packet exchange takes time and hence the binding request/response. Essentially, increasing it will allow atleast one candidate pair to be tried for nomination by the other peer.
619622
4. `iceConnectionCheckPollingInterval`: This value is set to a default of 50 ms per [spec](https://datatracker.ietf.org/doc/html/rfc8445#section-14.2). Changing this would change the frequency of connectivity checks and essentially, the ICE state machine transitions. Decreasing the value could help in faster connection establishment in a reliable high performant network setting with good system resources. Increasing the value could help in reducing the network load, however, the connection establishment could slow down. Unless there is a strong reasoning, it is **NOT** recommended to deviate from spec/default.
620623

621624
### Enable ICE agent stats
622625

623626
The SDK calculates 4 different stats:
624627
1. ICE server stats - stats for ICE servers the SDK is using
625628
2. [Local candidate stats](https://www.w3.org/TR/webrtc-stats/#dom-rtcstatstype-local-candidate) - stats for the selected local candidate
626-
3. [Remote candidate stats](https://www.w3.org/TR/webrtc-stats/#dom-rtcstatstype-remote-candidate) - stats for the selected remote candidate
629+
3. [Remote candidate stats](https://www.w3.org/TR/webrtc-stats/#dom-rtcstatstype-remote-candidate) - stats for the selected remote candidate
627630
4. [Candidate pair stats](https://www.w3.org/TR/webrtc-stats/#dom-rtcstatstype-candidate-pair) - stats for the selected candidate pair
628631

629632
For more information on these stats, refer to [AWS Docs](https://docs.aws.amazon.com/kinesisvideostreams-webrtc-dg/latest/devguide/kvswebrtc-reference.html)

README_ESP.md

Lines changed: 0 additions & 278 deletions
This file was deleted.

0 commit comments

Comments
 (0)