https://github.com/awslabs/amazon-kinesis-video-streams-rtp

https://github.com/awslabs/amazon-kinesis-video-streams-rtp

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (4.9%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: awslabs
  • License: apache-2.0
  • Language: C
  • Default Branch: main
  • Size: 81.1 KB
Statistics
  • Stars: 2
  • Watchers: 11
  • Forks: 5
  • Open Issues: 1
  • Releases: 0
Created about 2 years ago · Last pushed 10 months ago
Metadata Files
Readme Contributing License Code of conduct

README.md

amazon-kinesis-video-streams-rtp

The goal of the Real-time Transport Protocol (RTP) library is to provide RTP Serializer and Deserializer functionalities. Along with this, RTP library also provide codec packetization and depacketization functionality for G.711, VP8, Opus and H.264 codecs.

What is RTP?

Real-Time Transport Protocol (RTP), as defined in RFC 3550, is a data transport protocol used to deliver real-time data such as audio or video over IP networks. An RTP packet comprises of a header followed by the payload.

A RTP packet consist of following fields followed by an optional RTP Header extension.

``` 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |V=2|P|X| CC |M| PT | Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Timestamp | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Synchronization Source (SSRC) identifier | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Contributing Source (CSRC[0..15]) identifiers | | .... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

    RTP Header extension:

     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |            Profile            |           Length              |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                        Header Extension                       |
    |                             ....                              |

```

Using the library

Serializer

1. Call `Rtp_Init()` to initialize the RTP Context.
2. Initialize an RtpPacket_t with the desired values.
3. Call `Rtp_Serialize()` to serialize the RtpPacket_t passed.

Deserializer

1. Call `Rtp_Init()` to initialize the RTP Context.
2. Pass the serialized packet along with its length to `Rtp_DeSerialize()` to
   deserialize the packet.

Packetization

1. Call `<Codec>Packetization_Init()` to intitializae the particular codec context.
2. In case of H.264 Codec packetization -
    - Call `H264Packetizer_AddFrame()` to add  a frame OR
    - Call `H264Packetizer_AddNalu()` repeatedly to add NALUs of a frame.
3. For all codes other than H.264, call `<Codec>Packetizer_AddFrame()` to add a frame.
4. Call `<Codec>Packetizer_GetPacket()` repeatedly to retrieve the packets
   until `<Codec>_RESULT_NO_MORE_PACKETS` is returned.

Depacketization

1. Call `<Codec>Depacketization_Init()` to initialize the codec context.
2. Call `<Codec>Depacketizer_AddPacket()` repeatedly to add all packets received
   corresponding to one frame.
3. In case of H.264 Codec depacketization -
   - Call `H264Depacketizer_GetFrame()` to get a frame OR
   - Call `H264Depacketizer_GetNalu()` iteratively to get NALUs one by one until
     H264_RESULT_NO_MORE_NALUS is returned.
4. For all codes other than H.264, Call `<Codec>Depacketizer_GetFrame()` to get the
   complete frame once all packets are added.

Building Unit Tests

Platform Prerequisites

  • For running unit tests:
    • C99 compiler like gcc.
    • CMake 3.13.0 or later.
    • Ruby 2.0.0 or later (It is required for the CMock test framework that we use).
  • For running the coverage target, gcov and lcov are required.

Checkout CMock Submodule

By default, the submodules in this repository are configured with update=none in .gitmodules to avoid increasing clone time and disk space usage of other repositories.

To build unit tests, the submodule dependency of CMock is required. Use the following command to clone the submodule:

sh git submodule update --checkout --init --recursive test/CMock

Steps to build Unit Tests

  1. Go to the root directory of this repository. (Make sure that the CMock submodule is cloned as described in Checkout CMock Submodule).
  2. Run the following command to generate Makefiles:

    sh cmake -S test/unit-test -B build/ -G "Unix Makefiles" \ -DCMAKE_BUILD_TYPE=Debug \ -DBUILD_CLONE_SUBMODULES=ON \ -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG'

  3. Run the following command to build the library and unit tests:

    sh make -C build all

  4. Run the following command to execute all tests and view results:

    sh cd build && ctest -E system --output-on-failure

Steps to generate code coverage report of Unit Test

  1. Run Unit Tests in Steps to build Unit Tests.
  2. Generate coverage report in 'build/coverage' folder:

    make coverage

Script to run Unit Test and generate code coverage report

sh git submodule update --init --recursive --checkout test/CMock cmake -S test/unit-test -B build/ -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DBUILD_CLONE_SUBMODULES=ON -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG -DLIBRARY_LOG_LEVEL=LOG_DEBUG' make -C build all cd build ctest -E system --output-on-failure make coverage

License

This project is licensed under the Apache-2.0 License.

Owner

  • Name: Amazon Web Services - Labs
  • Login: awslabs
  • Kind: organization
  • Location: Seattle, WA

AWS Labs

GitHub Events

Total
  • Delete event: 4
  • Issue comment event: 4
  • Push event: 8
  • Pull request review comment event: 112
  • Pull request event: 8
  • Pull request review event: 130
  • Fork event: 1
  • Create event: 2
Last Year
  • Delete event: 4
  • Issue comment event: 4
  • Push event: 8
  • Pull request review comment event: 112
  • Pull request event: 8
  • Pull request review event: 130
  • Fork event: 1
  • Create event: 2

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 0
  • Total pull requests: 6
  • Average time to close issues: N/A
  • Average time to close pull requests: about 11 hours
  • Total issue authors: 0
  • Total pull request authors: 4
  • Average comments per issue: 0
  • Average comments per pull request: 0.17
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 6
  • Average time to close issues: N/A
  • Average time to close pull requests: about 11 hours
  • Issue authors: 0
  • Pull request authors: 4
  • Average comments per issue: 0
  • Average comments per pull request: 0.17
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • t2-g (1)
Pull Request Authors
  • t2-g (10)
  • moninom1 (6)
  • aggarg (3)
  • Simrann197 (2)
  • ActoryOu (1)
Top Labels
Issue Labels
Pull Request Labels