我的网络知识很差!!,我是新手!! ;-)
我在 nginx 上安装了一个带有 2 个网络接口(interface)的小型服务器流式传输 ffmpeg
p2p1 is used for WAN which provides http/ssh....
p4p1 is used to receive multicast data from intranet.
192.168.0.1 is public network gateway.
192.168.1.1 is private network gateway (commented for not have internet exit this network)
239.0.0.*/24 is multicast address.
Linux distribution
3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Distributor ID : Ubuntu
Description: Ubuntu 14.04.2 LTS
Release : 14.04
Codename : trusty
我的网络接口(interface)配置
auto lo
iface lo inet loopback
# NET1
auto p2p1
iface p2p1 inet static
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
# NET2
auto p4p1
iface p4p1 inet static
address 192.168.1.100
netmask 255.255.255.0
### gateway 192.168.1.1
现在我的路由表
root@srv:# route
Tabla de rutas IP del núcleo
Destino Pasarela Genmask Indic Métric Ref Uso Interfaz
default 192.168.0.1 0.0.0.0 UG 0 0 0 p2p1
192.168.0.0 * 255.255.255.0 U 0 0 0 p2p1
192.168.1.0 * 255.255.255.0 U 0 0 0 p4p1
我在端口 4022 上使用 udpxy 将 IPTV 多播转换为单播 HTTP
udpxy -p 4022
我执行这个
/usr/bin/ffmpeg -i "http://127.0.0.1:4022/rtp/239.0.0.76:8208" -map 0:0 -map 0:1 -c:v libx264 -vf scale=-1:720 -r 25 -profile:v high -level:v 4.0 -crf 18 -preset veryfast -maxrate 2000k -bufsize 2200k -c:a aac -ab 128k -strict -2 -ac 2 -f flv rtmp://127.0.0.1:11111/rtmp/channel1;
ffmpeg version 2.7 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvo-aacenc --enable-libvidstab
libavutil 54. 27.100 / 54. 27.100
libavcodec 56. 41.100 / 56. 41.100
libavformat 56. 36.100 / 56. 36.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.100 / 1. 2.100
libpostproc 53. 3.100 / 53. 3.100
http://127.0.0.1:4022/rtp/239.0.0.76:8208: Invalid data found when processing input
因为我可以解决这个问题??
提前致谢
最佳答案
210.0.0.0/24 是 不是 多播地址。
IPv4 多播范围是 224.0.0.0/4。见 https://en.wikipedia.org/?title=Multicast_address
很有可能这就是你遇到问题的原因。
编辑 :
另请注意错误消息:
http://127.0.0.1:4022/rtp/239.0.0.76:8208: Invalid data found when processing input
我想这意味着从 udpxy 获取数据时出现问题,因此请尝试运行该详细信息 (udpxy -v -p 4022) 并查看它的内容。
关于networking - ffmpeg,2个网卡和多播流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30923472/