ffmpeg,2个网卡和组播流

时间:2015-06-18 18:52:12

标签: networking ffmpeg

我对网络的了解很差!!我是新手! ; - )

我在nginx上安装了一个小型服务器流ffmpeg,带有2个网络接口

  

p2p1用于提供http / ssh ....的WAN。

     

p4p1用于从Intranet接收组播数据。

     

192.168.0.1是公共网络网关。

     

192.168.1.1是专用网络网关(注释为没有互联网退出此网络)

     

239.0.0。* / 24是多播地址。

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

我的网络接口配置

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

因为我能解决这个问题吗? 提前致谢

1 个答案:

答案 0 :(得分:0)

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)并查看其内容。