A pure Rust live transcapsulator that converts DASH or HLS inputs into plain HLS-TS output without external dependencies like ffmpeg.

Stars

79

7-day growth

No data

Forks

28

Open issues

0

License

No data

Last updated

2026-07-07

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It is a lightweight, dependency-free tool that supports multiple encryption schemes (CENC, AES-128, cbcs) and advanced codecs (HEVC, Dolby Vision, HDR10), while optimizing output for CDN caching by disguising TS segments as JPEG.

Who it is for

  • Streaming engineers who need to remux encrypted DASH/HLS to clear HLS-TS
  • DevOps/SRE teams managing CDN caching rules for live streams
  • Developers integrating dynamic key retrieval with live transcapsulation
  • System integrators building custom video pipelines without heavy multimedia tools

Use cases

  • Converting DRM-protected DASH or HLS live streams to unencrypted HLS-TS for redistribution
  • Serving adaptive bitrate HLS outputs that are CDN-friendly (segments disguised as .jpeg)
  • Real-time subtitle passthrough from MPD/M3U8 to WebVTT in an HLS master playlist
  • On-demand transcapsulation tasks that automatically pause when idle, saving resources

Strengths

  • Zero external runtime dependencies (no ffmpeg, mp4decrypt) – single binary deployment
  • Comprehensive encryption support: DASH CENC AES-CTR, HLS AES-128, HLS fMP4 SAMPLE-AES/cbcs
  • Preserves advanced video features: HEVC, Dolby Vision RPU, HDR metadata, AAC/AC-3/EC-3 audio
  • Built-in Web UI and REST API for task management, and configurable dynamic key API with retry mechanism

Considerations

  • All segments are stored in memory; a service restart invalidates all tasks and buffered content
  • Output is limited to HLS-TS (no DASH output), and browser support for HEVC/Dolby Vision is limited
  • Dynamic key mode requires a stable key endpoint – failed retrievals block task publication

README quick start

DV-HLS Gateway

DV-HLS Gateway 是一个纯净的手动推流器,用于把 DASH(MPD) 或 HLS(M3U8) 输入实时转封装为明文 HLS-TS 输出。

它不依赖 ffmpeg / mp4decrypt,运行时只做解密、MP4 解析、TS 封装和直播窗口发布;HEVC、Dolby Vision RPU、HDR 元数据、AAC / AC-3 / EC-3 音频都会尽量原样透传。

功能

  • 支持 MPD 和 M3U8 输入,统一输出 HLS-TS。
  • 支持 VOD 和 Live,Live 会贴近 live edge、滚动发布并做内存 GC。
  • 支持 HEVC、H.264、Dolby Vision Profile 5/8、HDR10、HLG、SDR。
  • 支持 AAC-LC、AC-3、EC-3,前端可显示语言、codec 和码率。
  • 支持 DASH CENC AES-CTR、HLS AES-128、HLS fMP4 SAMPLE-AES / cbcs。
  • 支持固定 key 和动态取 key。
  • 支持字幕推流,开启字幕时输出 master playlist + media playlist + subtitle playlist。
  • 支持持续转化和按需启停,按需任务默认 5 分钟无播放请求后暂停。
  • 分片只缓存在内存中,不写磁盘。
  • 输出 TS 分片伪装为 .jpeg 且响应 Content-Type: image/jpeg,便于 CDN 缓存。

目录

  • src/:主程序源码。
  • src/frontend/index.html:内置 Web UI。
  • examples/:辅助示例。
  • examples/key_api.php:动态取 key 接口 PHP 示例。
  • dv-hls-gateway.example.json:运行配置示例。
  • .github/workflows/ci.yml:CI,运行格式检查和测试。
  • .github/workflows/release.yml:多平台二进制构建。

构建

本地构建

cargo build --release

运行:

./target/release/dv-hls-gateway

默认读取二进制同目录的 dv-hls-gateway.json。如果文件不存在,程序首次启动会自动生成一个模板。

也可以显式指定配置文件和端口:

./target/release/dv-hls-gateway --config ./dv-hls-gateway.json --host 0.0.0.0 --port 37201

GitHub Actions 构建

仓库内置 Build Release Binaries workflow,可手动运行,也可推送 v* tag 自动构建并发布附件。

手动运行:

  1. 打开 GitHub Actions。
  2. 选择 Build Release Binaries
  3. 点击 Run workflow
  4. 填入 release_tag,例如 v0.1.0

手动运行会创建或更新对应 tag 的 Release。推送 tag 也会自动发布:

固定产物名:

产物运行平台Rust target
dv-hls-gateway-linux-amd64-muslLinux x86_64x86_64-unknown-linux-musl
dv-hls-gateway-linux-armv7-muslLinux ARMv7 hard-floatarmv7-unknown-linux-musleabihf
dv-hls-gateway-linux-arm64-muslLinux ARM64aarch64-unknown-linux-musl
dv-hls-gateway-windows-amd64-musl.exeWindows x86_64x86_64-pc-windows-msvc
dv-hls-gateway-macos-amd64-muslmacOS Intelx86_64-apple-darwin
dv-hls-gateway-macos-arm64-muslmacOS Apple Siliconaarch64-apple-darwin

说明:musl 是 Linux 目标使用的 libc;Windows/macOS 没有 musl ABI,项目仍按固定产物名输出,实际 target 以表格为准。

命令行打 tag 触发构建:

git tag v0.1.0
git push origin v0.1.0

下载后运行:

chmod +x ./dv-hls-gateway-linux-amd64-musl
./dv-hls-gateway-linux-amd64-musl --config ./dv-hls-gateway.json --host 0.0.0.0 --port 37201

Windows:

.\dv-hls-gateway-windows-amd64-musl.exe --confi

Description

Live stream gateway

Related repositories

Similar projects matched by category, topics, and programming language.

l0ng-ai
Featured
l0ng-ai GitHub avatar

tty7

tty7 is a fast, GPU-accelerated terminal workbench with persistent sessions, built-in input tools, SSH support, and coding agent awareness.

Developer ToolsCLI & Terminal
359
steelbrain
Featured
steelbrain GitHub avatar

reims-vgpu

reims-vgpu is an experimental virtual GPU for macOS guests that uses QEMU to decode the guest's GPU command stream and execute it through Metal or Vulkan, leveraging the built-in AppleParavirtGPU driver without requiring custom kexts.

Desktop Apps
143
m-novotny
Featured
m-novotny GitHub avatar

memguard-rs

A Rust library that provides secure memory handling primitives including zeroization on drop, memory locking, constant-time comparison, and compile-time guarded regions, with zero dependencies and no_std support.

Embedded & IoTSecurity
131