码迷,mamicode.com
首页 > 其他好文 > 详细

ffmpeg无法接收组播流问题处理

时间:2015-10-14 10:30:23      阅读:411      评论:0      收藏:0      [点我收藏+]

标签:

  问题:ffmpeg无法对IP组播进行处理,表现如下

[root@os01 /]# ffprobe udp://225.0.0.2:9000
ffprobe version 2.7.1 Copyright (c) 2007-2015 the FFmpeg developers
  built with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9)
  configuration: --enable-gpl --enable-nonfree --enable-static --enable-pthreads
  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
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
  libpostproc    53.  3.100 / 53.  3.100
(一直卡在这里)

  

  而通过tcpdump抓包,是可以抓到组播流的

[root@os01 /]# tcpdump -ieno1 host 225.0.0.2 and port 9000
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eno1, link-type EN10MB (Ethernet), capture size 65535 bytes
09:03:35.745690 IP bogon.37266 > 225.0.0.2.cslistener: UDP, length 1316
09:03:35.759688 IP bogon.37266 > 225.0.0.2.cslistener: UDP, length 1316
09:03:35.763224 IP bogon.37266 > 225.0.0.2.cslistener: UDP, length 1316
09:03:35.766720 IP bogon.37266 > 225.0.0.2.cslistener: UDP, length 1316
09:03:35.770256 IP bogon.37266 > 225.0.0.2.cslistener: UDP, length 1316
09:03:35.773768 IP bogon.37266 > 225.0.0.2.cslistener: UDP, length 1316

 

  查看route表如下

[root@os01 logs]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         bogon           0.0.0.0         UG    100    0        0 eno4
link-local      0.0.0.0         255.255.0.0     U     1003   0        0 eno2
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
172.28.1.0      0.0.0.0         255.255.255.0   U     100    0        0 eno3
172.28.33.0     0.0.0.0         255.255.255.0   U     100    0        0 eno1
172.28.34.0     0.0.0.0         255.255.255.0   U     0      0        0 eno2
192.168.0.0     0.0.0.0         255.255.255.0   U     100    0        0 eno4
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0

 

  故,分析得出,上述问题是由route表中未配置组播地址导致,解决办法如下

[root@os01 logs]# route add -net 225.0.0.0 netmask 255.0.0.0 dev eno1
[root@os01 logs]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         bogon           0.0.0.0         UG    100    0        0 eno4
link-local      0.0.0.0         255.255.0.0     U     1003   0        0 eno2
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
172.28.1.0      0.0.0.0         255.255.255.0   U     100    0        0 eno3
172.28.33.0     0.0.0.0         255.255.255.0   U     100    0        0 eno1
172.28.34.0     0.0.0.0         255.255.255.0   U     0      0        0 eno2
192.168.0.0     0.0.0.0         255.255.255.0   U     100    0        0 eno4
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
225.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 eno1

 

  再次验证ffmpeg:

[root@os01 logs]# ffprobe udp://225.0.0.2:9000
ffprobe version 2.7.1 Copyright (c) 2007-2015 the FFmpeg developers
  built with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9)
  configuration: --enable-gpl --enable-nonfree --enable-static --enable-pthreads
  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
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
  libpostproc    53.  3.100 / 53.  3.100
[h264 @ 0x2ed1160] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x2ed1160] decode_slice_header error
[h264 @ 0x2ed1160] no frame!
[h264 @ 0x2ed1160] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x2ed1160] decode_slice_header error
[h264 @ 0x2ed1160] no frame!
[h264 @ 0x2ed1160] non-existing PPS 0 referenced
    Last message repeated 1 times

 

ffmpeg无法接收组播流问题处理

标签:

原文地址:http://www.cnblogs.com/zhenyuyaodidiao/p/4876501.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!