smolrtsp

OpenIPCMIT活跃维护

面向 IP 摄像头的轻量级实时流媒体 C 库,实现 RTSP/RTP 协议,可在嵌入式设备上做低开销的音视频推拉流。

A lightweight real-time streaming library for IP cameras

v0.2.0发布于 2026-05-24 19:05 UTC512star119fork同步于 2026-11-07 07:34 UTC

怎么上手

由 README 提炼,执行前请确认
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)
硬件要求按 README 说明

README 未说明具体硬件要求,仅说明面向 IP 摄像头等嵌入式设备设计。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

面向 IP 摄像头等嵌入式设备的轻量 RTSP 1.0 服务端库,帮你快速搭起视频流服务

面向 IP 摄像头的轻量级实时流媒体 C 库,实现 RTSP/RTP 协议,可在嵌入式设备上做低开销的音视频推拉流。

核心能力

  • 实现 RTSP 1.0 与 RTP/RTCP 协议栈
  • 支持 RTP over TCP 交织与 RTP over UDP 两种传输
  • 解析过程零拷贝,不额外分配或复制数据
  • 支持 H.264/H.265/H.266/JPEG XS/AV1 载荷格式
  • 不绑定网络框架,可搭配裸 POSIX socket 或 libevent

容易踩的坑

默认构建静态库,需要动态库要显式打开 SMOLRTSP_SHARED;示例服务器默认只推 H.264 与 G.711,JPEG XS/AV1/VVC 需分别加 -DENABLE_JPEGXS=ON 等编译开关;库本身不含网络后端,需自行接入 POSIX socket 或额外引入 smolrtsp-libevent 等集成。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v0.2.0
  1. v0.2.0最新正式版2026-05-24 · 2026-05-24 19:05 UTC
  2. v0.1.32023-03-11 · 2023-03-11 21:47 UTC
    查看更新说明
  3. v0.1.22022-07-27 · 2022-07-27 15:27 UTC
    查看更新说明
  4. v0.1.12022-03-30 · 2022-03-30 21:31 UTC
    查看更新说明
  5. v0.1.02022-03-29 · 2022-03-29 19:06 UTC
    查看更新说明

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    OpenIPC Logo

    SmolRTSP

    CI Docs

    SmolRTSP is a simple RTSP 1.0 server library tailored for embedded devices, such as IP cameras. It supports both TCP and UDP, allows any payload format, and provides a convenient and flexible API.

    Highlights

    • Small. SmolRTSP is designed for use in embedded systems (e.g., IP cameras).
    • Unopinionated. You can use SmolRTSP with bare POSIX sockets, libevent, or any other network framework.
    • Zero-copy. SmolRTSP does not allocate or copy data while parsing.
    • Battle-tested. SmolRTSP is used by Majestic, an IP camera streamer developed by OpenIPC.

    Features

    • Supported protocols:
      • RTSP 1.0 (RFC 2326)
      • RTP (RFC 3550)
      • RTP over TCP (interleaved binary data)
      • RTP over UDP
      • SDP (RFC 4566)
      • RTCP (RFC 3550):
        • Sender Report (SR), Receiver Report (RR), SDES (single CNAME), and BYE serialization
    • Supported RTP payload formats:

    Installation

    If you use CMake, the recommended way is FetchContent:

    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)
    

    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

    Usage

    A simple example server that streams H.264 video and G.711 Mu-Law audio can be found at examples/server.c. The same server can also advertise additional streams: pass -DENABLE_JPEGXS=ON for JPEG XS on the /jpegxs path, -DENABLE_AV1=ON for AV1 on the /av1 path, or -DENABLE_VVC=ON for H.266 / VVC on the /vvc path.

    server demo

    Run it as follows:

    $ mkdir examples/build
    $ cd examples/build
    $ cmake .. && cmake --build .
    $ sudo ./server
    

    Then open a new terminal window to start playing:

    $ ffplay rtsp://localhost
    

    Integration

    SmolRTSP is agnostic to a network backend: you can run it atop of any network/event loop framework. Currently, we support the following integrations:

    Feel free to extend this list with your own integration code.

    Release procedure

    1. Update the PROJECT_NUMBER field in Doxyfile.
    2. Update CHANGELOG.md.
    3. Release the project in GitHub Releases.