/rtp2httpd

Multicast RTP to Unicast HTTP stream convertor

Primary LanguageCGNU General Public License v2.0GPL-2.0

IPTV 组播转单播,支持 FCC 快速换台

本 fork 在原版 run2httpd 基础上增加了 FCC 协议支持,可以实现像原生 IPTV 盒子一样的快速换台。

快速换台效果

RPReplay_Final1694331839.MOV
IMG_9297.MOV

注:rtp2httpd 搭配 FCC server 后,仅保证可以快速提供可立即解码的视频流给客户端。具体换台速度能有多快,还取决于视频客户端的实现,客户端的 buffer 越小,换台速度越快。

使用方法

暂时没有开箱即用,需要自己编译构建这个项目。

git clone https://github.com/stackia/rtp2httpd.git
cd rtp2httpd
autoreconf -i
./configure
make && make install

启动 rtp2httpd 后,即可使用类似 http://10.0.0.2:5140/rtp/239.253.64.120:5140?fcc=10.255.14.152:15970 这样的地址将组播源转换为单播源。这里的 FCC 服务器地址需要在自己所在地的 IPTV 盒子上抓包获得(关键词 ChannelFCCIP / ChannelFCCPort,通常和直播源 ChannelURL 一起出现),并在路由器上添加静态路由走 IPTV 网络出站。

并非所有地区都有 FCC 服务器,如果抓不到,那么很可能当地运营商没有部署 IPTV FCC 服务器。

如果不是直接运行在路由器上,需要开启 fcc-nat-traversal 选项。如果路由器支持 NAT-PMP 功能(通常在 UPnP 相关设置下面),建议设置为 fcc-nat-traversal=2,播放最稳定。如果不支持 NAT-PMP,则设置为 fcc-nat-traversal=1,此时某些情况下播放会不稳定,如果发现不能播放,需要重试1-2次。

如果直接运行在路由器上,则无需开启 fcc-nat-traversal(或者设置为 0)。路由器 CPU 如果不够强大,不建议直接运行在路由器上,以免影响整个局域网。

Multicast RTP to Unicast HTTP stream convertor with FCC support!

Copyright (c) 2008-2020 Ondřej Caletka

What is it

This program converts multicast RTP/UDP media into http stream. It acts as a tiny HTTP server. When client connect, pre-configured multicast RTP service is choosen by URL. Program then join pre-configured multicast address and translate incoming RTP data to HTTP stream.

As an alternative to pre-configured address, there is also a UDPxy compatibility mode. If URL looks like /<rtp|udp>/<multicast address>:<port> and UDPxy mode is enabled (which is default), the program joins address contained in the URL.

It's main purpose is to remotely watch multicast video and audio broadcast, when your internet connection in the first-mile (e.g. broadband router) does not support multicast routing.

Main advantage over translating streams in vlc (http://www.videolan.org) is that multicast group is joined after the HTTP client connects, and is leaved immediately after HTTP client disconnects. So, server can be run all the time and consume almost no bandwidth nor CPU power, until HTTP client connects.

Installation

The package uses GNU autotools. See the file INSTALL for details.

Configuration

See provided configfile for example, run program with --help for a list of command line switches.

Do not run rtp2httpd as root. Choose some unprivileged port number and run it under unprivileged user account.