Git Product home page Git Product logo

jackdusir / amazon-kinesis-video-streams-webrtc-sdk-c Goto Github PK

View Code? Open in Web Editor NEW

This project forked from awslabs/amazon-kinesis-video-streams-webrtc-sdk-c

0.0 1.0 0.0 8.38 MB

Amazon Kinesis Video Streams Webrtc SDK is for developers to install and customize realtime communication between devices and enable secure streaming of video, audio to Kinesis Video Streams.

License: Apache License 2.0

CMake 1.75% C 73.63% C++ 24.61%

amazon-kinesis-video-streams-webrtc-sdk-c's Introduction

Amazon Kinesis Video Streams C WebRTC SDK

Pure C WebRTC Client for Amazon Kinesis Video Streams

Build Status Coverage Status

Key FeaturesBuildRundocumentationRelatedLicense

Key Features

  • Audio/Video Support
    • VP8
    • H264
    • Opus
  • Developer Controlled Media Pipeline
  • DataChannels
  • NACKs
  • STUN/TURN Support
  • IPv4/IPv6 TODO
  • Signaling Client Included
    • KVS Provides STUN/TURN and Signaling Backend
    • Connect with Android/iOS/Web using pre-made samples
  • Portable
    • Tested on Linux/MacOS
    • Tested on x64, ARMv5
    • Build system designed for pleasant cross-compilation
  • Small Install Size
    • Sub 200k library size
    • OpenSSL, libsrtp, libjsmn, libusrsctp and libwebsockets dependencies.

Build

Download

To download run the following command:

git clone --recursive https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c.git

You will also need to install pkg-config and CMake and a build enviroment

Configure

Create a build directory in the newly checked out repository, and execute CMake from it.

mkdir -p amazon-kinesis-video-streams-webrtc-sdk-c/build; cd amazon-kinesis-video-streams-webrtc-sdk-c/build; cmake ..

We have provided an example of using GStreamer to capture/encode video, and then send via this library. This is only build if pkg-config finds GStreamer is installed on your system.

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.

Cross-Compilation

If you wish to cross-compile CC and CXX are respected when building the library and all its dependencies. You will also need to set BUILD_OPENSSL_PLATFORM, BUILD_LIBSRTP_HOST_PLATFORM and BUILD_LIBSRTP_DESTINATION_PLATFORM. See our .travis.yml for an example of this. Every commit is cross compiled to ensure that it continues to work.

CMake Arguments

You can pass the following options to cmake ...

  • -DADD_MUCLIBC -- Add -muclibc c flag
  • -DBUILD_DEPENDENCIES -- Whether or not to build depending libraries from source
  • -DBUILD_OPENSSL -- If building dependencies, whether or not building openssl from source
  • -DBUILD_OPENSSL_PLATFORM -- If buildng OpenSSL what is the target platform
  • -DBUILD_LIBSRTP_HOST_PLATFORM -- If buildng LibSRTP what is the current platform
  • -DBUILD_LIBSRTP_DESTINATION_PLATFORM -- If buildng LibSRTP what is the destination platform
  • -DBUILD_TEST=TRUE -- Build unit/integration tests, may be useful for confirm support for your device. ./tst/webrtc_client_test
  • -DCODE_COVERAGE -- Enable coverage reporting
  • -DCOMPILER_WARNINGS -- Enable all compiler warnings
  • -DADDRESS_SANITIZER -- Build with AddressSanitizer
  • -DMEMORY_SANITIZER -- Build with MemorySanitizer
  • -DTHREAD_SANITIZER -- Build with ThreadSanitizer
  • -DUNDEFINED_BEHAVIOR_SANITIZER Build with UndefinedBehaviorSanitizer`

Build

To build the library and the provided samples run make in the build directory you executed CMake.

make

Run

Setup your environment with your AWS account credentials:

First set the appropriate environment variables so you can connect to KVS

export AWS_ACCESS_KEY_ID= <AWS account access key>
export AWS_SECRET_ACCESS_KEY= <AWS account secret key>

Running the Samples

After executing make you will have the following sample applications in your build directory:

  • kvsWebrtcClientMaster - This application sends sample H264/Opus frames (path: /samples/h264SampleFrames and /samples/opusSampleFrames) via WebRTC. It also accepts incoming audio, if enabled in the browser. When checked in the browser, it prints the metadata of the received audio packets in your terminal.
  • kvsWebrtcClientViewer - This application accepts sample H264/Opus frames and prints them out.
  • kvsWebrtcClientMasterGstSample - This application sends sample H264/Opus frames from a GStreamer pipeline. It also will playback incoming audio via an autoaudiosink.

Run any of the sample applications by passing to it the name that you want to give to your signaling channel. The application creates the signaling channel using the name you provide. For example, to create a signaling channel called myChannel and to start sending sample H264/Opus frames via this channel, run the following command:

./kvsWebrtcClientMaster myChannel

When the command line application prints "Signaling client connection to socket established", you can proceed to the next step.

Now that your signaling channel is created and the connected master is streaming media to it, you can view this stream. To do so, open the WebRTC SDK Test Page using the steps in Using the Kinesis Video Streams with WebRTC Test Page and set the following values using the same AWS credentials and the same signaling channel that you specified for the master above:

  • Access key ID
  • Secret access key
  • Signaling channel name
  • Client ID (optional)

Choose Start viewer to start live video streaming of the sample H264/Opus frames.

Documentation

All Public APIs are documented in our Include.h refer to related for more about WebRTC and KVS.

Related

License

This library is licensed under the Apache 2.0 License.

amazon-kinesis-video-streams-webrtc-sdk-c's People

Contributors

chehefen avatar disa6302 avatar ek9852 avatar jamesiri avatar mushmal avatar sean-der avatar unicornss avatar yuma-m avatar zhiyua-git avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.