Skip to content

Releases: stackia/rtp2httpd

v3.11.0

07 Mar 23:04
89a1ea2

Choose a tag to compare

新功能

  • 支持 macOS
  • 支持 FreeBSD (by @laozhoubuluo)
    • 包括 pfSense / OPNsense 等基于 FreeBSD 的系统
  • 新增 URL 参数 r2h-ifname / r2h-ifname-fcc,可以在单次请求中指定上游接口(组播、RTSP、HTTP 都已支持)

问题修复

  • RTSP SETUP 过程,现在可以正确解析 Content-Base 头并拼接出符合 RFC 2326 规范的 URL(改善对于一些地区 RTSP 服务器的兼容性)
  • 现在 HTTP 代理在请求上游时会过滤掉 Accept-Encoding 头,避免请求到压缩内容而无法 rewrite m3u
  • 网页播放器:节目单现在可以正确按照时间排序(此前节目顺序取决于它在 EPG XML 中出现的顺序) (by @CzBiX)

New Features

  • macOS support
  • FreeBSD support (by @laozhoubuluo)
    • Including FreeBSD-based systems such as pfSense / OPNsense
  • New URL parameters r2h-ifname / r2h-ifname-fcc to specify the upstream network interface per request (supported for multicast, RTSP, and HTTP)

Bug Fixes

  • RTSP SETUP now correctly parses the Content-Base header and constructs RFC 2326 compliant URLs (improves compatibility with RTSP servers in certain regions)
  • HTTP proxy now strips the Accept-Encoding header when requesting upstream, preventing compressed responses that cannot be used for m3u rewriting
  • Web player: program guide is now correctly sorted by time (previously the order depended on the appearance order in the EPG XML) (by @CzBiX)
如果这个项目对你有帮助,不妨请作者喝一杯咖啡 ☕️

v3.10.1

24 Feb 11:37
adb410a

Choose a tag to compare

新功能

1. CORS 跨域访问支持

现在可以通过 cors-allow-origin 选项来启用 CORS 跨域访问支持。

第三方浏览器播放器(非内置网页播放器),如果想访问 rtp2httpd 转换出来的流,会受到浏览器跨域访问限制,导致无法播放。此时可以设置 cors-allow-origin = * 或者 cors-allow-origin = <播放器域名>,来允许接受跨域访问。

这个选项也在 OpenWrt LuCI UI 上提供,名称为 CORS 允许的源

2. HTTP 代理支持时间处理能力 (r2h-seek-offset / 时区修正)

类似之前 RTSP 代理已经支持的时间处理能力,现在 HTTP 代理也加入支持。

完整文档:时间处理与时区转换

3. 网页播放器:支持 MPEG-1 Layer 2 (MP2) 音频软解

国内 IPTV 大多数高清、标清频道使用 MP2 音频编码,一些浏览器(例如 iOS Safari)无法原生支持 MP2 解码,导致节目无法播放,或者只有画面没有音频。

因此网页播放器现在引入了 MP2 音频软解能力,在 iOS Safari 默认启用,在其他浏览器默认关闭。经测试大多数节目已经可以正常在 iOS Safari 上正常播放。在其他浏览器如果想要启用软解,可以点击侧边栏设置按钮,启用 MP2 音频软解 选项。

音频软解依赖于浏览器 Web Worker 和 Web Assembly 能力在后台解码,会占用一些计算资源,在手机上有可能会产生轻微发热,这是正常现象。此外,受限于浏览器,使用软解时在手机上无法保持后台播放。

4. 网页播放器:支持播放 HLS 源

一些运营商 IPTV 使用 HLS 协议处理直播和回看(特征是抓包得到的直播、回看地址是 http:// 开头)。在上个版本 rtp2httpd 已经支持了 HTTP 代理能力,能够把 IPTV 内网 HLS 源代理到局域网或公网,也恰好解决了网页端播放 HLS 的跨域访问限制问题。

从这个版本起,网页播放器也加入 HLS 播放能力,现在应该可以正常播放 HLS 流。

HLS 播放依赖浏览器对 HLS 的原生支持,注意 Chrome 于近期才支持原生播放 HLS,需要使用 Chrome >= 142 版本。Firefox 暂不支持。

所有支持的浏览器列表:https://caniuse.com/http-live-streaming

5. 网页播放器:支持解析 ${...|UTC} 回看时间占位符

例如 starttime=${(b)yyyyMMdd|UTC}T${(b)HHmmss|UTC}

完整文档:内置播放器支持的时间占位符

问题修复

  • 修复 M3U 解析时,文件包含 UTF-8 BOM 导致解析失败问题 by @monsterzzzz
  • 修复 M3U 中经过 HTTP 代理的 URL,当客户端传入 playseek 参数时,未能正确向上游发送问题
  • 修复 HTTP 代理不能正确处理 HEAD 请求问题
  • 修复 HTTP 代理在上游断开连接时,有概率 socket/epoll 未正确清理导致 CPU 空转问题
  • 修复 RTSP 在上游断开连接时,有概率丢弃末尾几个包,导致客户端解码失败问题
  • 网页播放器:有多个线路可选时,仅记住上次成功播放的线路
  • 网页播放器:微交互优化,例如焦点控制、a11y、样式微调
  • 网页播放器:为了支持 HLS 和音频软解,解码链路 @rtp2httpd/mpegts.js 进行了大量重构,性能更优,体积还更小

New Features

1. CORS Support

CORS can now be enabled via the cors-allow-origin option.

Third-party browser-based players (not the built-in web player) accessing streams converted by rtp2httpd may be blocked by the browser's cross-origin policy. Set cors-allow-origin = * or cors-allow-origin = <player-domain> to allow cross-origin access.

This option is also available in the OpenWrt LuCI UI as CORS Allowed Origin.

2. HTTP Proxy Time Processing (r2h-seek-offset / Timezone Correction)

Similar to the time processing already supported by the RTSP proxy, the HTTP proxy now supports it as well.

Full documentation: Time Processing & Timezone Conversion

3. Web Player: MPEG-1 Layer 2 (MP2) Audio Software Decoding

Most HD and SD IPTV channels in China use MP2 audio encoding. Some browsers (e.g., iOS Safari) do not natively support MP2 decoding, causing programs to fail to play or play without audio.

The web player now includes MP2 audio software decoding, enabled by default on iOS Safari and disabled on other browsers. Most programs can now play normally on iOS Safari. To enable software decoding on other browsers, click the settings button in the sidebar and enable the MP2 Audio Software Decoding option.

Software decoding uses Web Workers and WebAssembly for background decoding, which consumes some computing resources and may cause slight warmth on mobile devices. Additionally, due to browser limitations, background playback on mobile is not supported when using software decoding.

4. Web Player: HLS Playback Support

Some ISP IPTV services use HLS for live and catchup streams (identifiable by http:// URLs). The previous version of rtp2httpd already supported HTTP proxying, enabling IPTV intranet HLS sources to be proxied to LAN or the public internet, which also resolves cross-origin restrictions for browser-based HLS playback.

Starting from this version, the web player includes HLS playback support and should now be able to play HLS streams properly.

HLS playback relies on the browser's native HLS support. Note that Chrome only recently added native HLS support — Chrome >= 142 is required. Firefox is not yet supported.

Full browser support list: https://caniuse.com/http-live-streaming

5. Web Player: Support for ${...|UTC} Catchup Time Placeholders

For example: starttime=${(b)yyyyMMdd|UTC}T${(b)HHmmss|UTC}.

Full documentation: Built-in Player Supported Time Placeholders

Bug Fixes

  • Fixed M3U parsing failure when the file contains a UTF-8 BOM by @monsterzzzz
  • Fixed HTTP-proxied URLs in M3U not correctly forwarding the playseek parameter to upstream
  • Fixed HTTP proxy not correctly handling HEAD requests
  • Fixed potential CPU spin caused by improper socket/epoll cleanup when the HTTP proxy upstream disconnects
  • Fixed potential loss of trailing packets when RTSP upstream disconnects, causing client decoding failures
  • Web player: when multiple sources are available, only remember the last successfully played source
  • Web player: micro-interaction improvements including focus control, a11y, and style tweaks
  • Web player: the decoding pipeline @rtp2httpd/mpegts.js has been significantly refactored to support HLS and audio software decoding, resulting in better performance and smaller bundle size

v3.9.1

19 Feb 06:09
d1bb125

Choose a tag to compare

  • 回滚 转换后的 playlist.m3u,其中的 URL 将不再进行 URL encode,这样有更好的可读性,现在还是保持 URL encode,因为发现有些播放器存在兼容问题

  • Reverted "URLs in the converted playlist.m3u will no longer be URL-encoded for better readability" — URL encoding is now preserved, as some players have compatibility issues without it

v3.9.0

18 Feb 22:12
300aa2b

Choose a tag to compare

新功能

1. 网页播放器:支持将相同频道多个源聚合起来,显示为单个频道+多条线路

例如,对于下面这段 m3u,三个不同清晰度的源,将会聚合为一个频道显示在列表中,并可以切换清晰度

#EXTINF:-1 tvg-id="广东卫视" tvg-name="广东卫视" tvg-logo="https://upload.112114.xyz/logo/广东卫视4K.png" group-title="卫视",广东卫视
rtp://239.253.64.96:5140/?fcc=10.255.75.73:15970$超高清
#EXTINF:-1 tvg-id="广东卫视" tvg-name="广东卫视" tvg-logo="https://upload.112114.xyz/logo/广东卫视.png" group-title="卫视",广东卫视
rtp://239.253.64.200:5140/?fcc=10.255.75.73:15970$高清
#EXTINF:-1 tvg-id="广东卫视" tvg-name="广东卫视" tvg-logo="https://upload.112114.xyz/logo/广东卫视.png" group-title="卫视",广东卫视
rtp://239.253.64.44:5140/?fcc=10.255.75.73:15970$标清
image

详细文档见:https://rtp2httpd.com/guide/m3u-integration#线路标签

2. 网页播放器:频道列表显示当前正在播放的节目

频道列表现在会显示每个频道正在播放的节目,一目了然!

image

3. 网页播放器:手机端可添加到桌面,UI 尺寸优化(频道分组、搜索框更紧凑)

例如,在 iOS 使用 Safari 打开网页浏览器,点击右下角三个点 -> 分享 -> 添加到主屏幕,可以把网页播放器变成类似 app 一般的体验。

ScreenRecording_02-19-2026.5-49-16.AM_1.MP4

问题修复

  • 修复"组播周期性重加入"功能在 IGMPv2-only 交换机下无效问题 by @tuzkiyoung
  • 对于一些运营商,即便使用 RTSP TCP 传输模式,服务器也会在一段时间后主动断开连接(例如上海电信)。所以 rtp2httpd 现在也会定期发送 keep alive 请求来避免服务器会话超时断开连接。
    • 之前版本只在 UDP 传输模式下发送 keep alive,现在无论 TCP/UDP 模式都会发送
  • 修复 m3u 转换时,catchup-source 在 append 模式下,在一些情况下不能正确拼接问题(例如用户错误使用了 catchup-source="?playseek=xxx",但实际期望的拼接符号是 &)。现在会智能选择 &? 作为 catchup-source 开头,保证最终 URL 是合法的。
  • 转换后的 playlist.m3u,其中的 URL 将不再进行 URL encode,这样有更好的可读性
  • 经过反代的 HTTP URL 现在也会在 playlist.m3u 中以服务名替代完整 URL(和 RTP/RTSP 保持一致)
  • 网页播放器:修复在回看时,因为解码失败或网络波动导致重连时,播放进度丢失问题

New Features

1. Web Player: Aggregate Multiple Sources of the Same Channel into a Single Channel with Multiple Routes

For example, given the following m3u with three sources at different resolutions, they will be aggregated into a single channel in the list with switchable quality options:

#EXTINF:-1 tvg-id="广东卫视" tvg-name="广东卫视" tvg-logo="https://upload.112114.xyz/logo/广东卫视4K.png" group-title="卫视",广东卫视
rtp://239.253.64.96:5140/?fcc=10.255.75.73:15970$超高清
#EXTINF:-1 tvg-id="广东卫视" tvg-name="广东卫视" tvg-logo="https://upload.112114.xyz/logo/广东卫视.png" group-title="卫视",广东卫视
rtp://239.253.64.200:5140/?fcc=10.255.75.73:15970$高清
#EXTINF:-1 tvg-id="广东卫视" tvg-name="广东卫视" tvg-logo="https://upload.112114.xyz/logo/广东卫视.png" group-title="卫视",广东卫视
rtp://239.253.64.44:5140/?fcc=10.255.75.73:15970$标清

Detailed documentation: https://rtp2httpd.com/en/guide/m3u-integration#source-labels

2. Web Player: Channel List Shows Currently Playing Program

The channel list now displays the currently playing program for each channel at a glance!

3. Web Player: Add to Home Screen on Mobile, Compact UI (Channel Groups, Search Bar)

For example, on iOS, open the web player in Safari, tap the three dots in the bottom right -> Share -> Add to Home Screen, to get an app-like experience.

Bug Fixes

  • Fixed "periodic multicast rejoin" not working on IGMPv2-only switches by @tuzkiyoung
  • For some ISPs, even when using RTSP TCP transport mode, the server actively disconnects after a period of time (e.g., Shanghai Telecom). rtp2httpd now sends periodic keep-alive requests to prevent server session timeouts in all transport modes.
    • Previous versions only sent keep-alive in UDP transport mode; now it is sent in both TCP and UDP modes
  • Fixed catchup-source concatenation issues in append mode during m3u conversion (e.g., when the user incorrectly uses catchup-source="?playseek=xxx" but the expected separator is &). The system now intelligently selects & or ? as the catchup-source prefix to ensure valid URLs.
  • URLs in the converted playlist.m3u are no longer URL-encoded for better readability
  • HTTP URLs going through the reverse proxy now also use service names instead of full URLs in playlist.m3u (consistent with RTP/RTSP behavior)
  • Web player: fixed playback progress loss during catchup when reconnecting due to decoding failures or network fluctuations

v3.8.3

04 Feb 11:11
eef015d

Choose a tag to compare

  • 修复 RTSP UDP 传输模式下,客户端断开连接时进程崩溃问题
  • 修复使用前置反代时,如果只转发了 X-Forwarded-Proto: https 但没有转发 X-Forwarded-Host 时,https 未生效问题
  • 网页播放器:增加 PWA manifest,支持通过浏览器安装到桌面

  • Fixed process crash when a client disconnects in RTSP UDP transport mode
  • Fixed https not taking effect when using a reverse proxy that forwards X-Forwarded-Proto: https but not X-Forwarded-Host
  • Web player: added PWA manifest, allowing installation to desktop via the browser

v3.8.2

03 Feb 11:05
df673de

Choose a tag to compare

  • 修复上个版本中,有概率客户端被错误标记为断开连接并无法正确清理资源问题
  • HTTP 代理现在可以改写 m3u,把其中所有 URL 都改写为经过 rtp2httpd 代理的地址,确保 HLS 能正常播放
  • 修复 OpenWrt LuCI UI 中缺少部分文本中文翻译问题 by @yaoyao5128

  • Fixed an issue from the previous version where clients could be incorrectly marked as disconnected with resources not properly cleaned up
  • HTTP proxy can now rewrite m3u files, converting all URLs to rtp2httpd-proxied addresses to ensure HLS playback works correctly
  • Fixed missing Chinese translations for some text in the OpenWrt LuCI UI by @yaoyao5128

v3.8.1

03 Feb 07:00
1ed6887

Choose a tag to compare

v3.8.1 Pre-release
Pre-release

这个版本还是存在一些严重 bug,将会稍后在后续版本修复,暂不建议更新

  • 修复 v3.8.0 中客户端断开连接时,资源未能清理问题
  • HTTP 代理现在可以正确处理 30x 重定向,自动把 Location 改写为经过代理的地址

This version still has some critical bugs that will be fixed in a later release. Updating is not recommended at this time.

  • Fixed resource cleanup failure when a client disconnects in v3.8.0
  • HTTP proxy now correctly handles 30x redirects, automatically rewriting the Location header to use the proxied address

v3.8.0

02 Feb 21:21
591e29f

Choose a tag to compare

v3.8.0 Pre-release
Pre-release

这个版本存在一些严重 bug,将会稍后在后续版本修复,暂不建议更新

新功能

问题修复

  • 经转换的 playlist.m3u,其中 EPG URL 优先使用压缩版本 /epg.xml.gz(原先写死了 /epg.xml 导致一些客户端加载性能不佳) by @mjl371

文档

  • 新增 性能测试报告,对比了 rtp2httpd / msd_lite / udpxy / tvgate 在常见和极限场景下的性能。

This version has some critical bugs that will be fixed in a later release. Updating is not recommended at this time.

New Features

Bug Fixes

  • The converted playlist.m3u now prefers the compressed EPG URL /epg.xml.gz (previously hardcoded to /epg.xml, causing poor loading performance on some clients) by @mjl371

Documentation

v3.7.0

27 Jan 08:38
2d77067

Choose a tag to compare

新功能

  • 新增配置项 udp-rcvbuf-size 用于手动指定 UDP 接收缓冲区大小(默认 512KB)
    • 频繁遇到丢包花屏可以尝试增大这个选项
    • 需要以 root 权限运行才有效(对于 Docker,需要指定 --cap-add=NET_ADMIN
    • 在 OpenWrt LuCI UI 也新增了这个选项 UDP 接收缓冲区大小
  • 新增 RTP 乱序包重排能力,改善一些网络环境下的乱序包花屏问题
    • 开箱即用,无需任何配置
  • 新增 FEC 前向纠错功能,在 URL 上指定 ?fec=<端口> 来启用
    • 有些运营商支持 FEC 前向纠错,用户观看一个频道时,同时接收两个组播流,一个组播流负责发送 RTP 包,另一个组播流负责发送 FEC 冗余包,当 RTP 流丢包时,可以利用 FEC 流进行恢复。
    • FEC 流和 RTP 流使用相同的组播 IP,不同的端口。抓包出来的 ChannelFECPort 就是 FEC 端口。
    • 由于不同运营商的 FEC 纠错算法有差异,未必能支持所有 FEC 算法,如遇问题请提 issue 反馈(需提供抓包文件)
    • URL 示例:http://<ip>:<port>/rtp/239.253.64.120:5140?fcc=10.255.14.152:8027&fcc-type=huawei&fec=5142
  • 一键安装脚本:使用 OpenWrt 自带的 uclient-fetch 代替 curl 避免一些人没有安装 curl 导致脚本失败

问题修复

  • 修复转换后的 playlist.m3u 未在 EPG URL 带上 r2h-token,导致 EPG 加载失败 by @mjl371
  • Web 状态面板不再对每个客户端 URL 重复显示 r2h-token=xxxx,保持 UI 清爽

New Features

  • New configuration option udp-rcvbuf-size to manually specify the UDP receive buffer size (default 512KB)
    • Try increasing this if you frequently experience packet loss and video artifacts
    • Requires root privileges to take effect (for Docker, use --cap-add=NET_ADMIN)
    • Also available in the OpenWrt LuCI UI as UDP Receive Buffer Size
  • New RTP out-of-order packet reordering, improving video artifacts caused by packet reordering in some network environments
    • Works out of the box, no configuration needed
  • New FEC (Forward Error Correction) support, enabled by specifying ?fec=<port> in the URL
    • Some ISPs support FEC: when watching a channel, two multicast streams are received simultaneously — one for RTP packets and another for FEC redundancy packets. When the RTP stream has packet loss, FEC packets can be used for recovery.
    • FEC and RTP streams share the same multicast IP but use different ports. The ChannelFECPort from packet capture is the FEC port.
    • Due to varying FEC algorithms across ISPs, not all FEC algorithms may be supported. Please open an issue if you encounter problems (packet capture required).
    • URL example: http://<ip>:<port>/rtp/239.253.64.120:5140?fcc=10.255.14.152:8027&fcc-type=huawei&fec=5142
  • Installation script: now uses OpenWrt's built-in uclient-fetch instead of curl to avoid failures when curl is not installed

Bug Fixes

  • Fixed the converted playlist.m3u not including r2h-token in the EPG URL, causing EPG loading failures by @mjl371
  • The web status panel no longer repeatedly displays r2h-token=xxxx for each client URL, keeping the UI clean

v3.6.2

09 Jan 04:15
1a5acaf

Choose a tag to compare

  • 网页播放器:频道 logo 图片加载使用 no-referrer policy,避免一些网站的防盗链设置导致图片加载失败
  • 修复在非常罕见的情况下,RTSP 连接会卡在 RTSP 完成 TEARDOWN 状态且一直不会释放
  • 设置 UDP RCVBUF 时,尝试使用 SO_RCVBUFFORCE 以突破一些固件的默认内核参数 net.core.rmem_max 限制,可以改善 4K 视频流偶尔花屏马赛克问题
  • 修复对于一些特殊的 RTSP 上游,断开连接时出现 RTSP: Socket event handling failed 报错

  • Web player: channel logo images now use no-referrer policy to avoid loading failures caused by hotlink protection on some websites
  • Fixed a very rare case where an RTSP connection could get stuck in RTSP TEARDOWN completed state and never be released
  • When setting UDP RCVBUF, now attempts to use SO_RCVBUFFORCE to bypass the default kernel parameter net.core.rmem_max limit on some firmware, improving occasional 4K video artifacts
  • Fixed RTSP: Socket event handling failed error when disconnecting from some special RTSP upstreams