购得一台可以播放流媒体的设备,一般用它来听网络电台,还有一些电视转的流媒体音频。
也可以编辑电台,添加自己的电台或者更新。
于是,考虑做个私人电台,或许先仅仅是私网使用。其实基本只有两步:
- Icecast作服务器
icecast.xml中,
<source-password>hackme</source-password>改为自己的推流密码
<admin-user>admin</admin-user>
<admin-password>hackme</admin-password> 管理员帐号密码
<clients>100</clients> 收听人数
<sources>2</sources> 最大推流数
-
ffmpeg推流
ffmpeg -re -i “1.mp3” -c:a libvorbis -q:a 4 -content_type “audio/ogg” -f ogg “icecast://source:hackme@127.0.0.1:8000/radio”
ffmpeg -re -i “1.mp3” -c:a libmp3lame -b:a 128k -content_type “audio/mpeg” -f mp3 “icecast://source:hackme@127.0.0.1:8000/radio”
AAC比mp3更好: ffmpeg -re -i 1.mp3 -c:a aac -b:a 96k -content_type “audio/aac” -f adts “icecast://source:hackme@127.0.0.1:8000/radio”
省 25% 带宽,音质仍好 ffmpeg -re -i “1.mp3” -c:a libvorbis -q:a 2 -content_type “audio/ogg” -f ogg “icecast://source:hackme@127.0.0.1:8000/radio”
省 60%+ 带宽 ffmpeg -re -i “1.mp3” -ac 1 -c:a libvorbis -q:a 0 -content_type “audio/ogg” -f ogg “icecast://source:hackme@127.0.0.1:8000/radio” -
流媒体收听 http://你的IP:8000/radio
2026.5.14
- 启动 Icecast2
- ffmpeg推流:
ffmpeg -re -stream_loop -1 -i “./Compass.mp3” -c:a libmp3lame -b:a 128k -f mp3 icecast://source:hackme@127.0.0.1:8000/stream
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i list.txt -c:a libmp3lame -b:a 128k -f mp3 icecast://source:hackme@127.0.0.1:8000/stream - 收听:http://127.0.0.1:8000/stream
我的电台推送:
ffmpeg -re -stream_loop -1 -i “Compass.mp3” -c:a libmp3lame -b:a 128k -f mp3 icecast://source:123123@125.65.42.34:9911/stream
按列表播放,控制了音频质量及声音大小:
ffmpeg -re -f concat -safe 0 -i list.txt -ar 44100 -ac 2 -c:a libmp3lame -b:a 128k -filter:a “loudnorm=I=-16:LRA=11:TP=-1.5” -f mp3 icecast://source:123123@125.65.42.34:9911/stream
修改电台地址:
ffmpeg … -f mp3 icecast://source:密码@IP:8000/mymusic
收听地址即为:http://IP:8000/mymusic
golang电台系统:
https://github.com/DatanoiseTV/tinyice
1. 运行主程序后,在管理页面设置频道ease及密码
2. ffmpeg -re -f concat -safe 0 -i list.txt -ar 44100 -ac 2 -c:a libmp3lame -b:a 128k -filter:a “loudnorm=I=-16:LRA=11:TP=-1.5” -f mp3 icecast://:123123@125.65.42.34:9911/ease
3. http://127.0.0.1:8000/ease 收音
https://github.com/stack-store/go-fm
https://github.com/owncast/owncast
打赏