SmolRTSP

repository·master·Indexed 19 days ago

https://github.com/openipc/smolrtsp

A lightweight, zero-copy RTSP 1.0 server library optimized for embedded devices like IP cameras. It supports RTP payload formats including H.264, H.265, VVC, AV1, and JPEG XS. The library is network-agnostic, allowing integration with any network or event loop framework, such as POSIX sockets or libevent.

Tokens
681
Snippets
2
Records
5
Agent score
17%

What's inside smolrtsp

  1. SmolRTSP Feature Overview

    master

    SmolRTSP is a lightweight RTSP 1.0 server library designed for embedded systems like IP cameras. It features zero-copy parsing and is unopinionated about the network backend.

    Supported Protocols:

    • RTSP 1.0 (RFC 2326)
    • RTP (RFC 3550) via UDP or TCP (interleaved)
    • SDP (RFC 4566)
    • RTCP (Sender/Receiver Reports, SDES, BYE)

    Supported RTP Payload Formats:

    • H.264 (RFC 6184)
    • H.265 (RFC 7798)
    • H.266 / VVC (RFC 9328)
    • JPEG XS (RFC 9134)
    • AV1 (AOMedia AV1 RTP)
  2. Integrate SmolRTSP with network frameworks

    master

    SmolRTSP is network-agnostic and does not include its own event loop. It is designed to be run atop any network or event loop framework (e.g., bare POSIX sockets or libevent).

    A supported integration is available via OpenIPC/smolrtsp-libevent for use with the libevent framework.

  3. Install SmolRTSP via CMake FetchContent

    master

    The recommended way to integrate SmolRTSP into your CMake project is using the FetchContent module. This allows you to pull the library directly from the source during the configuration step.

    Note: Ensure you use the correct tag version in the URL.

    include(FetchContent)
    
    FetchContent_Declare(
        smolrtsp
        URL https://github.com/OpenIPC/smolrtsp/archive/refs/tags/v1.2.3.tar.gz # v1.2.3
    )
    
    FetchContent_MakeAvailable(smolrtsp)
    
    target_link_libraries(MyProject smolrtsp)
  4. Configure SmolRTSP build options

    master

    When building SmolRTSP with CMake, you can control the build type using the following options:

    OptionDescriptionDefault
    SMOLRTSP_SHAREDBuild a shared library instead of static.OFF
    SMOLRTSP_FULL_MACRO_EXPANSIONShow full macro expansion backtraces (DANGEROUS: may impair diagnostics and slow down compilation).OFF
  5. Run the SmolRTSP server example

    master

    To build and run the provided H.264/G.711 Mu-Law server example, follow these steps:

    1. Create a build directory and compile the project.
    2. Run the server with sudo (required for certain network operations).
    3. Use a player like ffplay to stream from rtsp://localhost.

    You can also enable additional stream support by passing CMake definitions during configuration:

    • -DENABLE_JPEGXS=ON for JPEG XS on the /jpegxs path.
    • -DENABLE_AV1=ON for AV1 on the /av1 path.
    • -DENABLE_VVC=ON for H.266 / VVC on the /vvc path.
    $ mkdir examples/build
    $ cd examples/build
    $ cmake .. && cmake --build .
    $ sudo ./server
    
    # In a new terminal:
    $ ffplay rtsp://localhost