IceCast的远程流服务器

时间:2019-01-10 12:24:14

标签: icecast

我正在尝试在IceCast服务器中再现视频流,因此我想在icecast.xml服务器中对其进行配置。我有以下问题:

  1. 在安装部分中,如何配置视频流以读取输入。我想读取以下类型的流:
  

rtsp:// ******************* / Streaming / Channels / 101?transportmode = unicast

实际上,我刚刚配置了以下iceCast.xml文件:

<icecast>
    <limits>
        <clients>1000</clients>
        <sources>42</sources>
        <threadpool>5</threadpool>
        <queue-size>524288</queue-size>
        <client-timeout>30</client-timeout>
        <header-timeout>15</header-timeout>
        <source-timeout>10</source-timeout>
        <burst-on-connect>1</burst-on-connect>
        <burst-size>65535</burst-size>
    </limits>
    <authentication>
        <!-- Sources log in with username 'source' -->
        <source-password>hackme</source-password>
        <!-- Relays log in username 'relay' -->
        <relay-password>hackme</relay-password>
        <!-- Admin logs in with the username given below -->
        <admin-user>admin</admin-user>
        <admin-password>hackme</admin-password>
    </authentication>
    <hostname>localhost</hostname>
    <listen-socket>
        <port>8000</port>
    </listen-socket>
    <relay>
        <server>rtsp://172.31.8.44/Streaming/Channels/101?transportmode=unicast</server>
        <port>8000</port>
        <mount>/test.ogg</mount>
        <on-demand>0</on-demand>
        <relay-shoutcast-metadata>0</relay-shoutcast-metadata>
    </relay>
    <mount type="normal">
        <mount-name>/test.ogg</mount-name>
        <username>othersource</username>
        <password>hackmemore</password>
        <max-listeners>1</max-listeners>
        <dump-file>/test.mp4</dump-file>
        <burst-size>65536</burst-size>
        <fallback-mount>/etc/icecast2/test.mp4</fallback-mount>
        <fallback-override>1</fallback-override>
        <fallback-when-full>1</fallback-when-full>
        <intro>/etc/icecast2/videoDAT.mp4</intro>
        <hidden>1</hidden>
        <no-yp>1</no-yp>
        <stream-url>rtsp://172.31.8.44/Streaming/Channels/101?transportmode=unicast</stream-url>
        <on-connect>sh /home/stream-start.sh</on-connect>
    </mount>
    <fileserve>1</fileserve>

    <paths>
        <basedir>/usr/share/icecast2</basedir>
        <logdir>/var/log/icecast2</logdir>
        <webroot>/usr/share/icecast2/web</webroot>
        <adminroot>/usr/share/icecast2/admin</adminroot>
        <alias source="/" dest="/status.xsl"/>
    </paths>

    <logging>
        <accesslog>access.log</accesslog>
        <errorlog>error.log</errorlog>
        <loglevel>3</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
        <logsize>10000</logsize> <!-- Max size of a logfile -->
    </logging>

    <security>
        <chroot>0</chroot>
    </security>
</icecast>
  1. 如何配置它以读取mp4文件?

1 个答案:

答案 0 :(得分:1)

Icecast无法中继RTSP流。您只能中继兼容的HTTP Progressive流(这些流服务器是Icecast和SHOUTcast之类的服务器。)

Icecast也不会解码您的MP4。

您需要使用FFmpeg之类的工具来中继到Icecast。像...

ffmpeg -i <your RTSP URL> icecast://example.com/stream