【问题标题】:Icecast with Liquidsoap not working带有 Liquidsoap 的 Icecast 无法正常工作
【发布时间】:2018-11-22 12:01:40
【问题描述】:

全部;
Ubuntu 18.04 - Icecast / LiquidSoap / opam / (liquidsoap-daemon)
已安装:taglib mad lame Vorbis cry ssl samplerate magic opus
插件:liquidsoap-plugin-all

系统规格

-System - VirtualBox
-CPU = Intel(R) Core(TM) i7-2720QM CPU @ 2.20GHz
-Memory = 1969MiB (2GB assigned to VM Client)

我已经搞砸了一段时间,但无济于事。
我有这个线程现在已关闭,其中包含您需要查看的有关我的设置的所有内容。 icecast request parsing failed

我正在测试的播放列表:

 #!/usr/bin/liquidsoap
 # Log dir
set("log.file.path","/var/log/liquidsoap/radioliq.log")

 # Music
myplaylist = playlist("/home/UserName/music-store/")
 # Some jingles
jingles = playlist("/home/UserName/music-store/jingles/jingles.m3u")
 # If something goes wrong, we'll play this
security = single("/home/UserName/music-store/Sec.mp3")

 # Start building the feed with music
radio = myplaylist
 # Now add some jingles
radio = random(weights = [1, 4],[jingles, radio])
 # And finally the security
 radio = fallback(track_sensitive = false, [radio, security])

  # Stream it out
output.icecast(%vorbis,
  radio, host = "192.168.2.20", port = 8000,
  password = "********", mount = "test.ogg")

当我运行它时

sudo /etc/init.d/liquidsoap restart

我明白了

Stopping liquidsoap channels: no script found in /etc/liquidsoap
Starting liquidsoap channels: radio1.liq OK

它显示正在启动 radio1.liq,但是,它正在停止,因为它在该目录中找不到任何东西。那就是它在 radio1.liq 文件中的位置。

当我跑步时

sudo systemctl status liquidsoap

我的输出是这样的:

● liquidsoap.service - LSB: Starts the liquidsoap daemon
   Loaded: loaded (/etc/init.d/liquidsoap; generated)
   Active: active (exited) since Tue 2018-06-12 17:47:52 EDT; 3h 0min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1312 ExecStart=/etc/init.d/liquidsoap start (code=exited, status=0/SUCCESS)

Jun 12 17:47:47 liquid-ice systemd[1]: Starting LSB: Starts the liquidsoap daemon...
Jun 12 17:47:52 liquid-ice liquidsoap[1312]: Starting liquidsoap channels: radio1.liq OK
Jun 12 17:47:52 liquid-ice systemd[1]: Started LSB: Starts the liquidsoap daemon.

如您所知,Active 是(exited),而其他时候,它像 Icecast 一样(running)。但是,我通常必须重新启动系统才能显示(running
我刚重启了,还是显示(exited),这是第一次没有变成(running)。通常它会给我一个错误,我必须修复某些东西,但它现在没有这样做。

● icecast2.service - LSB: Icecast2 streaming media server
   Loaded: loaded (/etc/init.d/icecast2; generated)
   Active: active (running) since Tue 2018-06-12 17:47:50 EDT; 3h 1min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1338 ExecStart=/etc/init.d/icecast2 start (code=exited, status=0/SUCCESS)
    Tasks: 4 (limit: 2289)
   CGroup: /system.slice/icecast2.service
           └─1403 /usr/bin/icecast2 -b -c /etc/icecast2/icecast.xml

Jun 12 17:47:48 liquid-ice systemd[1]: Starting LSB: Icecast2 streaming media server...
Jun 12 17:47:48 liquid-ice icecast2[1338]:  * Starting streaming media server icecast2
Jun 12 17:47:50 liquid-ice icecast2[1338]:    ...done.
Jun 12 17:47:50 liquid-ice systemd[1]: Started LSB: Icecast2 streaming media server.

当我打开网页界面时,我只得到以下标签(页面)

[Admin] | [Version]

所有其他页面都是空白的:

[Server Status] => Nothing, completely blank.
[Mountpoint List] => Active Mountpoints (This is all it shows on the page)

我还更改了 /etc/init.d/liquidsoap 中的用户名

user=username
group=username

用户名是我的登录名。然后授予我的用户对这些位置的许可。

/etc/liquidsoap/radio1.liq
/run/liquidsoap/

使用以下脚本:

sudo chmod o+w /run/liquidsoap/
sudo chmod o+w /etc/liquidsoap/radio1.liq

这是来自icecast error.log 的最新错误日志

[2018-08-08  02:22:18] INFO sighandler/_sig_die Caught signal 15, shutting down...
[2018-08-08  02:22:18] INFO main/main Shutting down
[2018-08-08  02:22:18] INFO fserve/fserve_shutdown file serving stopped
[2018-08-08  02:22:18] INFO slave/_slave_thread shutting down current relays
[2018-08-08  02:22:18] INFO slave/_slave_thread Slave thread shutdown complete
[2018-08-08  02:22:18] INFO auth/auth_shutdown Auth shutdown
[2018-08-08  02:22:18] INFO yp/yp_shutdown YP thread down
[2018-08-08  02:22:19] INFO stats/stats_shutdown stats thread finished
[2018-08-08  02:22:19] INFO main/main Icecast 2.4.3 server started
[2018-08-08  02:22:19] INFO connection/get_ssl_certificate No SSL capability
[2018-08-08  02:22:19] INFO stats/_stats_thread stats thread started
[2018-08-08  02:22:19] INFO yp/yp_update_thread YP update thread started

radio.log 文件中的 Exerts

2018/08/09 04:35:03 [dynamic.loader:3] Could not find dynamic module for fdkaac encoder.
2018/08/09 04:35:03 [dynamic.loader:3] Could not find dynamic module for aacplus encoder.
..........
2018/08/09 04:35:03 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master.
2018/08/09 04:35:03 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2018/08/09 04:35:03 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2018/08/09 04:35:03 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2018/08/09 04:35:03 [decoder:3] Method "MAD" accepted "/home/darkice/music/Security/sec.mp3".
2018/08/09 04:35:03 [single:3] "~/music/Security/sec.mp3" is static, resolving once for all...
2018/08/09 04:35:03 [threads:3] Created thread "generic queue #1".
2018/08/09 04:35:03 [threads:3] Created thread "non-blocking queue #1".
2018/08/09 04:35:03 [Jingle(dot)mp3:3] Loading playlist...
2018/08/09 04:35:05 [Jingle(dot)mp3:3] No mime type specified, trying autodetection.
2018/08/09 04:35:05 [playlist.basic:3] Wrong mime type audio/mpeg for playlist!
2018/08/09 04:35:05 [playlist parser:3] No format found
2018/08/09 04:35:05 [Jingle(dot)mp3:3] Could not parse playlist: Not_found
2018/08/09 04:35:05 [Jingle(dot)mp3:3] Got an empty list: keeping the old one.
2018/08/09 04:35:05 [musicList:3] Loading playlist...
2018/08/09 04:35:05 [musicList:3] Playlist is a directory.
2018/08/09 04:35:05 [musicList:3] Successfully loaded a playlist of 1 tracks.
2018/08/09 04:35:05 [single_6363:3] Prepared "/home/darkice/music/Security/sec.mp3" (RID 0).
2018/08/09 04:35:05 [test(dot)ogg:3] Connecting mount test.ogg for source@192.168.2.4...
2018/08/09 04:35:05 [test(dot)ogg:2] Connection failed: 401, Authentication Required (HTTP/1.0)
2018/08/09 04:35:05 [test(dot)ogg:3] Will try again in 3.00 sec.
2018/08/09 04:35:05 [threads:3] Created thread "wallclock_main" (1 total).
2018/08/09 04:35:05 [clock.wallclock_main:3] Streaming loop starts, synchronized with wallclock.
2018/08/09 04:43:34 [decoder:3] Method "MAD" accepted "/home/darkice/music/List/01 Send Her To Me.mp3".
2018/08/09 04:43:34 [test(dot)ogg:2] Connection failed: 401, Authentication Required (HTTP/1.0)
2018/08/09 04:43:34 [test(dot)ogg:3] Will try again in 3.00 sec.
2018/08/09 04:43:34 [threads:3] Created thread "wallclock_main" (1 total).
2018/08/09 04:43:34 [clock.wallclock_main:3] Streaming loop starts, synchronized with wallclock.
2018/08/09 04:43:34 [fallback_6368:3] Switch to single_6363.
2018/08/09 04:43:34 [carrzkiss:3] Prepared "/home/darkice/music/List/01 Send Her To Me.mp3" (RID 3).
2018/08/09 04:43:34 [fallback_6368:3] Switch to random_6366 with transition.
2018/08/09 04:35:05 [random_6366:3] Switch to musicList.
2018/08/09 04:35:09 [test(dot)ogg:3] Connecting mount test.ogg for source@192.168.2.4...
2018/08/09 04:35:09 [test(dot)ogg:2] Connection failed: 401, Authentication Required (HTTP/1.0)
2018/08/09 04:35:09 [test(dot)ogg:3] Will try again in 3.00 sec.  

I followed this page here, to get the logging to start.

我在这里缺少什么吗?为了使liquidsoap正常工作,还需要安装其他东西吗?
我按照本教程进行了安装。 Create an internet radio station with Icecast and liquidsoap

我真的不知道还要添加什么。我已经经历了所有事情,甚至在写这篇文章时还做了一些额外的事情。请让我知道您是否需要我检查其他任何内容。请查看我的另一个线程,以获取有关我在这里设置的更多信息。 icecast request parsing failed

运行以下代码。

curl -v 192.168.2.4:8000 >/dev/null

给我这个。

* Rebuilt URL to: 192.168.2.4:8000/
*   Trying 192.168.2.4...
* TCP_NODELAY set
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to 192.168.2.4 (192.168.2.4) port 8000 (#0)
> GET / HTTP/1.1
> Host: 192.168.2.4:8000
> User-Agent: curl/7.58.0
> Accept: */*
> 
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Server: Icecast 2.4.3
< Date: Sun, 12 Aug 2018 18:28:52 GMT
< Content-Type: text/xml; charset=UTF-8
< Cache-Control: no-cache
< Expires: Mon, 26 Jul 1997 05:00:00 GMT
< Pragma: no-cache
< Access-Control-Allow-Origin: *
< Content-Length: 1144
< 
{ [1144 bytes data]
100  1144  100  1144    0     0  95333      0 --:--:-- --:--:-- --:--:--  101k
* Closing connection 0

谢谢。
韦恩

【问题讨论】:

  • 最新的 Icecast error.log 和 Liquidsoap radioliq.log 会有所帮助。最后一个状态表明后者存在问题。另请注意,名称为Icecast,不含驼色,谢谢。
  • 我现在再次访问此问题。在处理网络问题和新的不在办公室工作一段时间后。收集到新信息后,我将发布它。
  • 更新了最新的error.log信息。
  • Icecast 日志中没有任何相关内容。 /var/log/liquidsoap/radioliq.log 呢?另外,请确保 /var/log/liquidsoap/ 是您的用户可写的位置。
  • 我终于得到了用于liquidsoap的日志。只需要写下我所做的一切,让它开始工作和记录。更新的信息将在几分钟内添加。

标签: ubuntu-server icecast liquidsoap


【解决方案1】:

我已经有一段时间没有搞乱 Icecast2 和 Liquidsoap 了。
但是,几周前我就这样做了。
经过一段时间的挣扎,我在得到另一个人的帮助并观看了视频后才弄清楚。
都是权限问题。

创建用户后,“Icedemo”。
(以 root 身份登录)

adduser Icedemo 

授予用户 SUDO 权限。

usermod -aG sudo Icedemo

现在授予 Icedemo 对所有文件夹的权限。

/opt/liquidsoap/Playlists/
/var/log/liquidsoap/
/etc/icecast2/web/
/etc/icecast2/admin/

使用以下脚本授予权限。

cd /opt
sudo chown -Rv icedemo:icedemo liquidsoap/
cd /var/log/
sudo chown -Rv icedemo:icedemo liquidsoap/
cd /etc/icecast2/
sudo chown -Rv icedemo:icedemo web/
sudo chown -Rv icedemo:icedemo admin/

为 icecast.xml 文件保留相同的权限。

以您的用户身份登录 Icedemo

su Icedemo  

完成上述所有操作并且脚本格式正确后。像这样。

# !/home/iceadmin/.opam/default/bin/liquidsoap
# log dir
set ("log.file.path","/var/log/liquidsoap/basic-radio.log")
set("scheduler.fast_queues",1)
 # Music
music = playlist("/opt/liquidsoap/playlists/RadioOne.m3u",mode="normal",reload_mode="watch")

# Start building the feed with music
radio = music

# Stream it out
output.icecast(%mp3(bitrate=256,samplerate=44100,internal_quality=0,id3v2=true,stereo=true,stereo_mode="stereo"),
name="Radio",
encoding="UTF-8",
host="192.168.2.203",
port=8000,
password="hackme",
icy_metadata="true",
description="Internet Radio Station",
mount="Radio",
mksafe(radio))

我们需要重新启动每个服务。

#Restart IceCast   
sudo systemctl restart icecast2
#Check status of IceCast  
sudo systemctl status icecast2
(Ctrl+Z to go to prompt)

接下来,我们需要对 Liquidsoap 做同样的事情。

#Restart Liquidsoap
sudo systemctl restart radio.liq-liquidsoap
#Check status of  Liquidsoap
sudo systemctl status radio.liq-liquidsoap
(After checking the status, you can use (Ctrl+Z to go to prompt))

您的 Liquidsoap 状态输出应该与我的相似。

Icedemo@linuxcore-03:~/liquidsoap-daemon$ sudo systemctl status radio.liq-liquidsoap
● radio.liq-liquidsoap.service - radio.liq Liquidsoap daemon
     Loaded: loaded (/etc/systemd/system/radio.liq-liquidsoap.service; disabled; vendor preset: enabled)
     Active: active (running) since Mon 2021-05-24 03:47:01 UTC; 4s ago
       Docs: http://liquidsoap.fm/
    Process: 54678 ExecStart=/home/Icedemo/.opam/default/bin/liquidsoap /home/Icedemo/liquidsoap-daemon/script/radio.liq-run.liq (code=exited, status=0/SUCCESS)
   Main PID: 54680 (liquidsoap)
      Tasks: 9 (limit: 2251)
     Memory: 17.3M
     CGroup: /system.slice/radio.liq-liquidsoap.service
             └─54680 /home/Icedemo/.opam/default/bin/liquidsoap /home/Icedemo/liquidsoap-daemon/script/radio.liq-run.liq
May 24 03:47:01 linuxcore-03 systemd[1]: Starting radio.liq Liquidsoap daemon...
May 24 03:47:01 linuxcore-03 systemd[1]: Started radio.liq Liquidsoap daemon.

如果上面显示:活动:活动(运行)
接下来,检查您的 Icecast 网页,您应该会看到挂载点,并且您的收音机应该可以正常工作。
在我们上面的示例脚本中访问广播电台将是。

(local) 192.168.2.203:8000/Radio 

这将在其自己的浏览器窗口中加载播放器,并且您的流应该自行启动。如果没有,请点击播放按钮。

就是这样;这就是让您的流媒体收音机工作的方式。
我希望这对其他人有所帮助。

韦恩

【讨论】:

    【解决方案2】:

    好的,既然我认为我有足够的信息/数据,让我们把它分开:

    2018/08/09 04:35:03 [single:3] "~/music/Security/sec.mp3" is static, resolving once for all...
    2018/08/09 04:35:05 [single_6363:3] Prepared "/home/darkice/music/Security/sec.mp3" (RID 0).
    

    您的由“security”配置的liquidsoap内部“fallback”刚刚可用。

    2018/08/09 04:35:03 [Jingle(dot)mp3:3] Loading playlist...
    2018/08/09 04:35:05 [Jingle(dot)mp3:3] No mime type specified, trying autodetection.
    2018/08/09 04:35:05 [Jingle(dot)mp3:3] Could not parse playlist: Not_found
    2018/08/09 04:35:05 [Jingle(dot)mp3:3] Got an empty list: keeping the old one.
    

    没有叮当声的播放列表。我猜它会忽略这一点。

    2018/08/09 04:35:05 [musicList:3] Loading playlist...
    2018/08/09 04:35:05 [musicList:3] Playlist is a directory.
    2018/08/09 04:35:05 [musicList:3] Successfully loaded a playlist of 1 tracks.
    

    “/home/darkice/music/List/01 Send Her To Me.mp3”是指定目录中唯一的文件。

    2018/08/09 04:35:05 [test(dot)ogg:3] Connecting mount test.ogg for source@192.168.2.4...
    2018/08/09 04:35:05 [test(dot)ogg:2] Connection failed: 401, Authentication Required (HTTP/1.0)
    

    它正在尝试连接到您的 Icecast 服务器,但 Icecast 拒绝连接。 最可能的原因是密码与 Icecast 配置中配置为 &lt;source-password&gt; 的密码不匹配。

    您将在时间戳2018/08/09 04:35:05 的 Icecast 错误日志中找到有关连接失败的详细信息 - 请注意,如果这是另一台计算机并且任一计算机的系统时间不同步,则可能存在偏移通过例如NTP。

    【讨论】:

    • 我修复了密码问题。所以现在它连接了。我将如何测试它,看看它是否真的在流媒体?
    • 您现在应该在 Icecast 状态网站上看到一个活动的挂载点。在媒体播放器(例如 VLC)或浏览器(Firefox、Chrome)中打开 http://192.168.2.4:8000/test.ogg 应该会开始播放流。
    • 这就是问题所在。我在网页上没有活动的挂载点,它是空白的。并加载您提供的 URL,我在询问之前尝试了几次,我得到 404 - 找不到您请求的文件 Icecast 的错误日志显示:“/usr/share/icecast2/web/test.ogg”没有这样的文件或目录
    • “没有这样的文件”消息只是一个后备检查。它还会检查 webroot 中是否有文件,而不仅仅是存在流。 // 你说“所以现在它连接了”,但你说没有流显示。在这种情况下,请同时提供liquidsoap 日志和icecast error.log
    猜你喜欢
    • 2018-12-07
    • 2021-09-02
    • 2018-11-03
    • 2020-05-17
    • 2016-11-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多