Skip to content

Releases: stackia/rtp2httpd

v2.0.1

01 Oct 09:23

Choose a tag to compare

  • 修复 FCC 服务器报错后不能正常回退组播问题

Full Changelog: v2.0.0...v2.0.1


  • Fixed failure to fall back to multicast after FCC server error

Full Changelog: v2.0.0...v2.0.1

v2.0.0

30 Sep 18:54

Choose a tag to compare

v2.0.0 是一个里程碑版本,带来了全面的架构重构和重大功能更新。本版本相比 v1.1.1 实现了质的飞跃,新增 RTSP 协议支持、引入现代化的测试框架、大幅优化性能,并显著增强了代码质量和可维护性。

AI 在本项目编写中起了至关重要的作用。

🎯 重大新功能

🌟 RTSP 流支持(核心特性)

v2.0.0 的最大亮点是完整实现了 RTSP/RTP 协议栈,使 rtp2httpd 成为一个真正的多协议流媒体网关:

  • 完整的 RTSP 客户端实现:支持 DESCRIBE、SETUP、PLAY、TEARDOWN 等标准 RTSP 方法
  • 双传输模式支持
    • RTP over UDP(标准模式)
    • RTP over TCP(适用于受限网络环境)
  • 智能会话管理:自动处理 RTSP 会话生命周期,包括超时重连和资源清理
  • 时区兼容性:新增完整的时区处理模块,支持 IPTV 时移回看功能
  • 应用场景
    • 将 IPTV RTSP 时移源转换为 HTTP 流进行回看
    • 将家庭网络摄像机的 RTSP 流转换为 HTTP 流,方便在 IPTV 播放器中观看
    • 统一各类流媒体源到 HTTP 协议

⚡ 性能优化与现代化

  • 优化编译标志:新增 -O3 优化选项支持,显著提升运行效率
  • 缓冲区管理:引入 buffer_config.h 统一管理各类缓冲区配置
  • 内存优化:重构数据结构,减少内存占用和碎片
  • 网络优化
    • 启用 TCP_NODELAY,降低延迟
    • 优化组播绑定逻辑,提升稳定性

🧪 测试与质量保障

建立了完整的自动化测试体系,大幅提升代码质量。

📦 架构重构

模块化设计

将原有的单体代码重构为清晰的模块化架构:

模块 文件 功能描述
HTTP 处理 http.c/h HTTP 协议处理、请求解析、响应生成(1150+ 行全新代码)
RTSP 客户端 rtsp.c/h RTSP 协议实现、会话管理(1057+ 行全新代码)
流管理 stream.c/h 统一的流抽象层、多协议支持(377+ 行全新代码)
FCC 快速换台 fcc.c/h FCC 协议实现、NAT 穿透(637+ 行全新代码)
组播支持 multicast.c/h 组播订阅、接口绑定(110+ 行全新代码)
RTP 处理 rtp.c/h RTP 包解析、验证(99+ 行全新代码)
时区处理 timezone.c/h 时区转换、时移支持(448+ 行全新代码)
配置管理 configuration.c/h 配置解析、参数验证(重构 286 行)

代码质量提升

  • 代码规范:严格遵循 C99 标准,启用全面的编译警告
  • 错误处理:完善的错误处理和资源清理机制
  • 调试支持:增强的日志系统,支持多级别详细输出
  • 文档完善
    • 更新 README 文档(+389 行)
    • 新增 TESTING.md 测试文档
    • 完善命令行参数文档

🚀 OpenWrt 支持增强

LuCI 界面改进

  • 配置选项扩展:支持所有新增配置参数
  • 国际化支持:完善中英文语言包
  • ACL 权限优化:细化权限控制
  • 启动脚本增强:支持配置文件加载

打包优化

  • 依赖更新:优化依赖关系
  • 多架构支持:完善各架构编译配置
  • CI/CD 自动化:自动构建 IPK 包

🔄 兼容性说明

向后兼容

  • ✅ 完全兼容原有 RTP/UDP 转发功能
  • ✅ 保持 UDPxy URL 格式兼容
  • ✅ 命令行参数向下兼容

新增特性

  • ✨ RTSP 流支持(全新功能)
  • ✨ 配置文件支持(可选)

升级建议

  1. 直接升级:v1.1.1 用户可直接升级,无需修改配置
  2. 功能探索:尝试新的 RTSP 流转发功能

🐛 问题修复

  • 修复 RTP 包验证逻辑,增强稳定性
  • 改进组播接口绑定,解决多网卡环境下的问题
  • 优化内存管理,修复潜在内存泄漏
  • 完善错误处理,提升异常情况下的鲁棒性

v2.0.0 is a milestone release with a comprehensive architecture refactoring and major feature updates. Compared to v1.1.1, this version represents a quantum leap — adding RTSP protocol support, introducing a modern testing framework, significantly optimizing performance, and enhancing code quality and maintainability.

AI played a crucial role in the development of this project.

🎯 Major New Features

🌟 RTSP Stream Support (Core Feature)

The highlight of v2.0.0 is the complete implementation of the RTSP/RTP protocol stack, making rtp2httpd a true multi-protocol streaming media gateway:

  • Complete RTSP client implementation: supports standard RTSP methods including DESCRIBE, SETUP, PLAY, TEARDOWN
  • Dual transport mode support:
    • RTP over UDP (standard mode)
    • RTP over TCP (for restricted network environments)
  • Intelligent session management: automatic RTSP session lifecycle handling, including timeout reconnection and resource cleanup
  • Timezone compatibility: new timezone processing module supporting IPTV time-shifted playback
  • Use cases:
    • Convert IPTV RTSP time-shifted sources to HTTP streams for catchup playback
    • Convert home IP camera RTSP streams to HTTP streams for viewing in IPTV players
    • Unify various streaming sources to HTTP protocol

⚡ Performance Optimization & Modernization

  • Optimized compiler flags: added -O3 optimization support for significantly improved runtime efficiency
  • Buffer management: introduced buffer_config.h for unified buffer configuration
  • Memory optimization: refactored data structures to reduce memory usage and fragmentation
  • Network optimization:
    • Enabled TCP_NODELAY for lower latency
    • Optimized multicast binding logic for improved stability

🧪 Testing & Quality Assurance

Established a comprehensive automated testing system, significantly improving code quality.

📦 Architecture Refactoring

Modular Design

Refactored the monolithic codebase into a clean modular architecture:

Module Files Description
HTTP Handler http.c/h HTTP protocol processing, request parsing, response generation (1150+ new lines)
RTSP Client rtsp.c/h RTSP protocol implementation, session management (1057+ new lines)
Stream Manager stream.c/h Unified stream abstraction layer, multi-protocol support (377+ new lines)
FCC Fast Channel Change fcc.c/h FCC protocol implementation, NAT traversal (637+ new lines)
Multicast Support multicast.c/h Multicast subscription, interface binding (110+ new lines)
RTP Handler rtp.c/h RTP packet parsing, validation (99+ new lines)
Timezone Handler timezone.c/h Timezone conversion, time-shift support (448+ new lines)
Configuration configuration.c/h Configuration parsing, parameter validation (286 lines refactored)

Code Quality Improvements

  • Code standards: strict C99 compliance with comprehensive compiler warnings enabled
  • Error handling: thorough error handling and resource cleanup mechanisms
  • Debug support: enhanced logging system with multi-level verbose output
  • Documentation:
    • Updated README documentation (+389 lines)
    • Added TESTING.md test documentation
    • Improved CLI parameter documentation

🚀 Enhanced OpenWrt Support

LuCI Interface Improvements

  • Extended configuration options: supports all new configuration parameters
  • Internationalization: improved Chinese and English language packs
  • ACL permission optimization: fine-grained access control
  • Init script enhancement: configuration file loading support

Packaging Optimization

  • Dependency updates: optimized dependency relationships
  • Multi-architecture support: improved build configurations for all architectures
  • CI/CD automation: automated IPK package builds

🔄 Compatibility Notes

Backward Compatible

  • ✅ Fully compatible with existing RTP/UDP forwarding functionality
  • ✅ UDPxy URL format compatibility maintained
  • ✅ CLI parameters are backward compatible

New Features

  • ✨ RTSP stream support (brand new)
  • ✨ Configuration file support (optional)

Upgrade Recommendations

  1. Direct upgrade: v1.1.1 users can upgrade directly without configuration changes
  2. Feature exploration: try the new RTSP stream forwarding functionality

🐛 Bug Fixes

  • Fixed RTP packet validation logic for improved stability
  • Improved multicast interface binding, resolving issues in multi-NIC environments
  • Optimized memory management, fixing potential memory leaks
  • Improved error handling for better robustness in exceptional situations

v1.1.1

18 Jan 13:56

Choose a tag to compare

  • 修复上游接口无法通过 LuCI 保存的问题

  • Fix upstream interface cannot be saved using LuCI

Full Changelog: v1.1.0...v1.1.1

v1.1.0

18 Jan 10:22

Choose a tag to compare

  • 新增上游接口设置功能

  • Add support for setting upstream interface

Full Changelog: v1.0.0...v1.1.0

v1.0.0

18 Jan 08:03

Choose a tag to compare

  • 新增 OpenWrt 开箱即用支持

  • Add out-of-box support for OpenWrt

Full Changelog: https://github.com/stackia/rtp2httpd/commits/v1.0.0