zoukankan      html  css  js  c++  java
  • ffmpeg无法接收组播流问题处理

      问题: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
  • 相关阅读:
    查找1
    动态规划
    分治
    [LeetCode] 1339. Maximum Product of Splitted Binary Tree
    [LeetCode] 1509. Minimum Difference Between Largest and Smallest Value in Three Moves
    [LeetCode] 233. Number of Digit One
    [LeetCode] 1963. Minimum Number of Swaps to Make the String Balanced
    [LeetCode] 1053. Previous Permutation With One Swap
    [LeetCode] 1962. Remove Stones to Minimize the Total
    [LeetCode] 1961. Check If String Is a Prefix of Array
  • 原文地址:https://www.cnblogs.com/zhenyuyaodidiao/p/4876501.html
Copyright © 2011-2022 走看看