2016-12-04 108 views
1

當我嘗試在瀏覽器播放器上播放我的icecast流或直接訪問掛載點時,它會持續長達一至兩分鐘,直到聽到任何聲音。 icecast中的哪些設置會影響這種行爲?我的服務器硬件不能是原因。此外,問題僅影響瀏覽器 - 桌面播放器沒有緩衝時間。當我使用shoutcast時,所有網絡播放器都會及時加載。Icecast2:長時間瀏覽器播放時的裝載點緩存

<icecast> 
    <location>Earth</location> 
    <admin>[email protected]</admin> 
    <limits> 
    <clients>200</clients> 
    <sources>3</sources> 
    <threadpool>5</threadpool> 
    <queue-size>524288</queue-size> 
    <client-timeout>20</client-timeout> 
    <header-timeout>15</header-timeout> 
    <source-timeout>60</source-timeout> 
      <burst-on-connect>0</burst-on-connect> 
      <burst-size>65535</burst-size> 
    </limits> 

    <authentication> 
      <source-password>hackme</source-password> 
      <relay-password>hackme</relay-password> 
      <admin-user>admin</admin-user> 
    <admin-password>hackme</admin-password> 
    </authentication> 

     <!-- {%comment-open-if:icecast.directory.yp-url==""%} --> 
    <directory> 
    <yp-url-timeout>15</yp-url-timeout> 
    <yp-url>http://yp.shoutcast.com</yp-url> 
    </directory> 
    <directory> 
     <yp-url-timeout>15</yp-url-timeout> 
     <yp-url>http://www.oddsock.org/cgi-bin/yp-cgi</yp-url> 
    </directory> 
    <directory> 
     <yp-url-timeout>15</yp-url-timeout> 
    <yp-url>http://dir.xiph.org/cgi-bin/yp-cgi</yp-url> 
    </directory> 
    <!-- {%comment-close-if:icecast.directory.yp-url==""%} --> 

     <hostname>test.test</hostname> 
     <port>8008</port> 
    <bind-address>1.1.1.1</bind-address> 

    <!-- Only define a <mount> section if you want to use advanced options, 
     like alternative usernames or passwords --> 
     <mount> 
    <bitrate>128</bitrate> 
    <mount-name>/mp3</mount-name> 
    <fallback-override>0</fallback-override> 
    <fallback-when-full>0</fallback-when-full> 
    <public>1</public> 
    <max-listeners>150</max-listeners> 
    <fallback-mount></fallback-mount> 
    <genre>alternative</genre> 
    <type>audio/mpeg</type> 
    </mount> 

    <mount> 
    <bitrate>64</bitrate> 
    <mount-name>/mobile</mount-name> 
    <fallback-override>0</fallback-override> 
    <fallback-when-full>0</fallback-when-full> 
    <public>1</public> 
    <max-listeners>50</max-listeners> 
    <fallback-mount></fallback-mount> 
    </mount> 

    <fileserve>1</fileserver> 

     <paths> 
      <basedir>/usr/local/centovacast/var/vhosts/tester/</basedir> 
      <logdir>var/log/</logdir> 
    <webroot>web/</webroot> 
    <adminroot>admin/</adminroot> 
    <pidfile>var/run/server.pid</pidfile> 
      <alias source="/" dest="/status.xsl"></alias> 
    </paths> 

    <logging> 
    <accesslog>access.log</accesslog> 
    <errorlog>error.log</errorlog> 
    <playlistlog>playlist.log</playlistlog> 
    <loglevel>2</loglevel> 
    <!-- 4 Debug, 3 Info, 2 Warn, 1 Error --> 
     </logging> 

    <security> 
    <chroot>0</chroot> 
     </security> 

</icecast> 
+0

使用像OGG/Vorbis格式支持的格式或ogg/opus。 – TBR

回答

0

當流式傳輸MP3時,它會被任意分段並按原樣發送。也就是說,Icecast不會對幀進行任何檢查或對齊,這意味着當重新同步到具有小緩衝區的服務器時,客戶端可能會稍微延遲。

然而,延遲一分鐘是一個非常長的時間。 LAME(3.99.1我認爲?)出現了一個問題,它正在創建Chrome難以同步的流。您沒有提及您使用的編碼器,但是如果它使用LAME,請嘗試升級或降級版本。如果您正在使用別的東西,請嘗試切換到LAME。另外,請嘗試不同的瀏覽器,以查看您是否僅在Chrome中遇到此問題。

基於HTTP的逐行MP3(與您的設置相同)是最常見的互聯網廣播形式,如果設置正確,它可以正常工作。