You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Shoutcast服务播放Intro文件后无法继续推流的问题求助

问题描述

按照SHOUTcast文档配置sc_serv.conf中的IntroFile=hawkad%d.mp3,用于客户端连接时播放Intro音频,但客户端(如VLC)连接后仅能播放Intro文件,后续无法切换到广播推流内容,且sc_serv.log中无报错信息。

Intro文件为128kbps的hawkad128.mp3,转换命令如下:

ffmpeg -v debug -i "hawkad1.mp3" -c:a libmp3lame -b:a 128k -ac 2 -ar 44100 -vn "hawkad128.mp3"

sc_serv.log片段

2023-01-20 10:45:53 DEBUG   ident is DIDC7cbfe1e5ac534c819760f0f27fe02820-8000, DID is e7ccb8b69a8c41d99e9d91422834ddf663499bdf7762f3dde7a2e7f416427e6
2023-01-20 10:45:53 INFO    [MAIN] Starting 2 network threads
2023-01-20 10:45:53 INFO    [RIP] Reserved 14 IP's from global rip file
2023-01-20 10:45:53 INFO    [MICROSERVER] Listening for source and client connections on port 8000
2023-01-20 10:45:53 INFO    [MICROSERVER] Listening for legacy source connections on port 8001
2023-01-20 10:45:53 INFO    [MICROSERVER] Flash policy file server not enabled
2023-01-20 10:45:57 INFO    [SRC 74.123.47.237:41970 sid=3] SHOUTcast 1 source connection starting.
2023-01-20 10:45:57 INFO    [SRC 74.123.47.237:41970 sid=3] Loaded intro file `hawkad128.mp3' (68758 bytes - processed down to 68545 bytes)
2023-01-20 10:45:57 INFO    [SRC 74.123.47.237:41972 sid=1] SHOUTcast 1 source connection starting.
2023-01-20 10:45:57 INFO    [SRC 74.123.47.237:41972 sid=1] Loaded intro file `hawkad128.mp3' (68758 bytes - processed down to 68545 bytes)
2023-01-20 10:46:09 INFO    [DST 74.123.47.237:49388 sid=1] HTTP client connection accepted. User-Agent: `VLC/3.0.18 LibVLC/3.0.18', UID: 1, GRID: 1
2023-01-20 10:46:09 INFO    [DST 74.123.47.237:49388 sid=1] HTTP client connection closed (0 seconds) [Bytes: 7940] Agent: `VLC/3.0.18 LibVLC/3.0.18', UID: 1, GRID: 1
2023-01-20 10:46:09 INFO    [DST 74.123.47.237:49389 sid=1] SHOUTcast 1 client connection accepted. User-Agent: `VLC/3.0.18 LibVLC/3.0.18', UID: 2, GRID: 2
2023-01-20 10:46:11 INFO    [DST 88.99.58.163:49840 sid=1] SHOUTcast 1 client connection accepted. User-Agent: `WinampMPEG/5.50', UID: 3, GRID: 3
2023-01-20 10:46:19 INFO    [ADMINCGI sid=1] Title updated [Volbeat - Don’t Tread on Me]
2023-01-20 10:46:19 INFO    [YP sid=1] Stream #1 has been updated on the SHOUTcast Directory.
2023-01-20 10:46:24 INFO    [ADMINCGI sid=3] Title updated [Craig Padilla - Perspective of Disappearance ~ , Zero Ohms, Skip Murphy]
2023-01-20 10:46:24 INFO    [YP sid=3] Stream #3 has been updated on the SHOUTcast Directory.

sc_serv.conf配置文件

;======================================================
; Hawkwynd Radio sc_serv configuration file
; last updated 1/20/23 
; =====================================================

publicserver=always
adminpassword=redacted
password=redacted
requirestreamconfigs=1
streamautodumptime_1=180
autodumptime_1=180

; stream_1 configuration

streamadminpassword_1=redacted
streamid_1=1
streampassword_1=redacted
;serverport_1=8000
streampath_1=stream
streamauthhash_1=FDC1C391-A44D-47B5-840A-00C34DA9AA38

; Intro File 
IntroFile="hawkad%d.mp3"
   
; stream_2 configuration

streamid_2=2
streampassword_2=redacted
; streamport_2=8000
streampath_2=test

; ambient stream configuration
streamid_3=3
streampassword_3=redacted
streampath_3=ambient 

; general configuration

logfile=logs/sc_serv.log
w3clog=logs/sc_w3c.log
banfile=control/sc_serv.ban
ripfile=control/sc_serv.rip

shoutcast1clientdebug=0
shoutcast2clientdebug=0
httpclientdebug=0
shoutcastsourcedebug=0
uvox2sourcedebug=0
httpsourcedebug=0
relayshoutcastdebug=0
relayuvoxdebug=0
relaydebug=0
httpstyledebug=0
webclientdebug=0
admetricsdebug=0
yp2debug=0
streamdatadebug=0
statsdebug=0
microserverdebug=0
threadrunnerdebug=0
forceshortsends=1
ratelimit=0
flvclientdebug=0
W3CEnable=Yes
streamauthhash_2=2CFE193B-7B42-416C-A4B7-5F86BEEE0C6F
streamauthhash_3=5ad7056f-82e3-4417-8813-94b23acff819
解决方案

1. 修复Intro文件的编码兼容性

SHOUTcast对MP3文件的帧格式要求严格,需确保文件为**恒定比特率(CBR)**且无冗余标签。调整ffmpeg转换命令:

ffmpeg -i "hawkad1.mp3" -c:a libmp3lame -b:a 128k -ac 2 -ar 44100 -vn -flags +bitexact -id3v2_version 0 "hawkad128.mp3"
  • -flags +bitexact:保证编码输出与标准完全一致,避免兼容性问题
  • -id3v2_version 0:移除ID3v2标签,防止SHOUTcast处理时出错

2. 验证IntroFile变量匹配

配置中%d用于匹配流的比特率,需确保目标流的实际比特率与文件名中的128一致。可先测试固定文件名:
将IntroFile="hawkad%d.mp3"改为IntroFile=hawkad128.mp3,重启sc_serv后测试连接,看是否能正常切换到推流。

3. 检查SHOUTcast版本兼容性

部分旧版本sc_serv在多流环境下处理Intro后切换推流存在bug,尝试升级到最新稳定版。

4. 优化客户端连接方式

从日志看,VLC先建立HTTP连接后关闭,再建立SHOUTcast 1连接。直接使用完整流路径连接:
在VLC中输入http://你的服务器地址:8000/stream(对应streampath_1),确保客户端直接连接到目标流。


内容的提问来源于stack exchange,提问作者Scott Fleming

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.03 21:55:15