无法获取解析fcc单播包。
测试无法解析单播流并且不会回退组播,事实上服务器已经发送了fcc单播包。 同时release下载的x86包无法运行 平台:openwrt x86_64 glibc 测试日志: rtp2httpd -v 5 -l 4399 node: (null), port: 4399 Opening /usr/local/etc/rtp2httpd.conf Warning: No configfile found. Verbosity: 5, Daemonise: 0, Maxclients: 5 Listening on 0.0.0.0 port 4399 Listening on :: port 4399 Connection from 192.168.10.53 port 52024 HTTP: GET /rtp/239.81.0.107:4056?fcc=180.141.207.228:8027 HTTP: User-Agent: Lavf/62.3.100 HTTP: Host header: 192.168.10.1 HTTP: Attempting UDPxy URL parsing Parsed URL: mcast=239.81.0.107:4056 fcc=180.141.207.228:8027 HTTP: Set User-Agent: Lavf/62.3.100 HTTP: Starting media stream for service: (dynamic) FCC session initialized RTSP session initialized for transport negotiation (TCP buffer: 8192 bytes, Response buffer: 4096 bytes) Starting media stream processing for service type 0 (MRTP) FCC: Initializing FCC session and sending request FCC: Socket registered with epoll FCC State: INIT -> REQUESTED (Request sent) FCC: Request sent to server 180.141.207.228:8027 FCC Response: FMT=3, result=0, signal_port=8027, media_port=0 FCC: Server provided new IP: 180.141.207.177 FCC: Server requests redirection to new server FCC State: REQUESTED -> INIT (Server redirect) FCC: Initializing FCC session and sending request FCC State: INIT -> REQUESTED (Request sent) FCC: Request sent to server 180.141.207.177:8027 FCC Response: FMT=3, result=0, signal_port=0, media_port=32180 FCC: Server provided new media port: 32180 FCC State: REQUESTED -> UNICAST_ACTIVE (Server accepted request) FCC: Server accepted request, expecting unicast stream FCC Response: FMT=3, result=0, signal_port=0, media_port=32180 FCC: Server accepted request, expecting unicast stream Stream timeout - no data received within 1 seconds, cleaning up and exiting FCC: Sending termination packet (cleanup) FCC: Termination packet sent (cleanup), seqn=0 FCC: Socket closed Client 192.168.10.53 port 52024 disconnected (6, 0) 实际上tcpdump iptv接口是有单播包的: 23:26:19.962668 IP 180.141.207.177.32180 > 10.224.215.156.57067: UDP, length 1328 23:26:19.963918 IP 180.141.207.177.32180 > 10.224.215.156.57067: UDP, length 1328 23:26:19.963918 IP 180.141.207.177.32180 > 10.224.215.156.57067: UDP, length 1328 23:26:19.965160 IP 180.141.207.177.32180 > 10.224.215.156.57067: UDP, length 1328 23:26:19.966353 IP 180.141.207.177.32180 > 10.224.215.156.57067: UDP, length 1328 23:26:19.967598 IP 180.141.207.177.32180 > 10.224.215.156.57067: UDP, length 1328 23:26:19.967599 IP 180.141.207.177.32180 > 10.224.215.156.57067: UDP, length 1328 23:26:19.969077 IP 180.141.207.177.32180 > 10.224.215.156.57067: UDP, length 1328 23:26:19.970085 IP 180.141.207.177.32180 > 10.224.215.156.57067: UDP, length 1328 23:26:19.971159 IP 180.141.207.177.32180 > 10.224.215.156.57067: UDP, length 1328 23:26:19.972379 IP 180.141.207.177.32180 > 10.224.215.156.57067: UDP, length 1328 23:26:19.973687 IP 180.141.207.177.32180 > 10.224.215.156.57067: UDP, length 1328 23:26:19.973687 IP 180.141.207.177.32180 > 10.224.215.156.57067: UDP, length 1328 23:26:19.974965 IP 180.141.207.177.32180 > 10.224.215.156.57067: UDP, length 1328 23:26:19.974965 IP 180.141.207.177.32180 > 10.224.215.156.57067: UDP, length 1328 23:26:19.976142 IP 180.141.207.177.32180 > 10.224.215.156.57067: UDP, length 1328 23:26:19.977257 IP 180.141.207.177.32180 > 10.224.215.156.57067: UDP, length 1328 23:26:19.983902 IP 10.224.215.156.57067 > 180.141.207.177.8027: UDP, length 16 23:26:19.983961 IP 10.224.215.156.57067 > 180.141.207.177.8027: UDP, length 16 23:26:19.983991 IP 10.224.215.156.57067 > 180.141.207.177.8027: UDP, length 16
同时release下载的x86包无法运行 平台:openwrt x86_64 glibc
原因是 release 的 x86 包是基于 openwrt 默认 musl libc 构建的,所以在 glibc 上跑不起来。
你已经是 glibc 的话,自己编译也比较容易,可以直接在 ubuntu 上编译出来,二进制拷贝过去应该就可以用,不用搞 openwrt 那套工具链。
rtp2httpd 到 iptv 接口之间有经过 nat 吗?比如 rtp2httpd 不是在路由器运行的,而是在局域网其他设备上运行的。
后续我也会优化一下这里组播回退的实现,感谢报告
已经用最新代码编译运行才有上面的日志,直接在路由上运行的,之前的1.0版是可以运行的。
可以尝试一下 --fcc-nat-traversal=1 选项,看看有没有效果
还有显式用 --upstream-interface iptv 指定一下 iptv 接口试试看
还有一种可能,检查一下 openwrt 防火墙设置,看看 iptv 接口所在的 zone,是否把入站数据设置为“接受”
经过测试,是防火墙问题,配置--fcc-nat-traversal=1之后正常。防火墙iptv zone不建议设为接受,有拦截到来自iptv接口的ssh和luci访问尝试。另外发现在单播切换组播的时候出现花屏,看起来是序号没对上。 rtp2httpd[7280]: HTTP: GET /rtp/239.81.0.117:4056?fcc=180.141.207.228:8027 rtp2httpd[7280]: HTTP: User-Agent: libmpv rtp2httpd[7280]: HTTP: Host header: 192.168.10.1 rtp2httpd[7280]: HTTP: Attempting UDPxy URL parsing rtp2httpd[7280]: Parsed URL: mcast=239.81.0.117:4056 rtp2httpd[7280]: fcc=180.141.207.228:8027 rtp2httpd[7280]: HTTP: Set User-Agent: libmpv rtp2httpd[7280]: HTTP: Starting media stream for service: (dynamic) rtp2httpd[7280]: FCC session initialized rtp2httpd[7280]: RTSP session initialized for transport negotiation (TCP buffer: 8192 bytes, Response buffer: 4096 bytes) rtp2httpd[7280]: Starting media stream processing for service type 0 (MRTP) rtp2httpd[7280]: FCC: Initializing FCC session and sending request rtp2httpd[7280]: FCC: Socket registered with epoll rtp2httpd[7280]: FCC State: INIT -> REQUESTED (Request sent) rtp2httpd[7280]: FCC: Request sent to server 180.141.207.228:8027 rtp2httpd[7280]: FCC Response: FMT=3, result=0, signal_port=8027, media_port=0 rtp2httpd[7280]: FCC: Server provided new IP: 180.141.207.176 rtp2httpd[7280]: FCC: Server requests redirection to new server rtp2httpd[7280]: FCC State: REQUESTED -> INIT (Server redirect) rtp2httpd[7280]: FCC: Initializing FCC session and sending request rtp2httpd[7280]: FCC State: INIT -> REQUESTED (Request sent) rtp2httpd[7280]: FCC: Request sent to server 180.141.207.176:8027 rtp2httpd[7280]: FCC Response: FMT=3, result=0, signal_port=0, media_port=32166 rtp2httpd[7280]: FCC: Server provided new media port: 32166 rtp2httpd[7280]: FCC: NAT punch hole sent for media port 32166 rtp2httpd[7280]: FCC State: REQUESTED -> UNICAST_ACTIVE (Server accepted request) rtp2httpd[7280]: FCC: Server accepted request, expecting unicast stream rtp2httpd[7280]: FCC Response: FMT=3, result=0, signal_port=0, media_port=32166 rtp2httpd[7280]: FCC: Server accepted request, expecting unicast stream rtp2httpd[7280]: FCC: Received sync notification (FMT 4) - can join multicast now rtp2httpd[7280]: FCC State: UNICAST_ACTIVE -> MCAST_REQUESTED (Sync notification received) rtp2httpd[7280]: Multicast: Socket registered with epoll rtp2httpd[7280]: FCC: Ignored duplicate sync notification rtp2httpd[7280]: FCC: Termination packet sent (normal flow), seqn=60828 rtp2httpd[7280]: FCC: Normal termination message sent, term_seqn=60826 rtp2httpd[7280]: FCC: Pending buffer initialized, size=48000 bytes rtp2httpd[7280]: FCC: Multicast pending buffer full, video quality may suffer <-----------这里开始,单播切换到组播短暂花屏 rtp2httpd[7280]: FCC: Reached termination sequence, switching to multicast rtp2httpd[7280]: FCC State: MCAST_REQUESTED -> MCAST_ACTIVE (Reached termination sequence) rtp2httpd[7280]: FCC: Flushed 47376 bytes from pending buffer, last_seqn=60931 rtp2httpd[7280]: Congestion - expected 60936, received 60826 rtp2httpd[7280]: Congestion - expected 60827, received 60936 rtp2httpd[7280]: Congestion - expected 60941, received 60827 rtp2httpd[7280]: Congestion - expected 60828, received 60941 rtp2httpd[7280]: Client socket error: Connection reset by peer rtp2httpd[7280]: Stream processing ended, performing cleanup rtp2httpd[7280]: FCC: Socket closed rtp2httpd[7280]: Multicast socket closed
后续我打算把 fcc-nat-traversal=1 作为默认行为启用,因为看起来不会有什么副作用
单播切组播的花屏,确认是有 bug,我修复一下
试试 v2.0.2 版本,看看花屏问题是否解决