-
Ubuntu | NGINX | HLS | Liquidsoap Will I need to create the folders, or did the installer not do the jobs? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 47 replies
-
Hi @carrzkiss,
These directories are expected to be populated by the OS installer. |
Beta Was this translation helpful? Give feedback.
-
I am sorry; you are right; I did not clarify. |
Beta Was this translation helpful? Give feedback.
-
Can you please explain this part
|
Beta Was this translation helpful? Give feedback.
-
OK. |
Beta Was this translation helpful? Give feedback.
-
Maybe @carrzkiss needs somewhat a bit detailed guide) I'm reading all this like a thriller :) Let's do like Vito is suggesting:
wget https://github.com/savonet/liquidsoap/releases/download/v2.2.4/liquidsoap_2.2.4-ubuntu-jammy-2_amd64.deb -O liquidsoap.deb
sudo apt-get install --no-install-recommends ./liquidsoap.deb
cd /home/carrzkiss
mkdir liquidsoap
cd liquidsoap
Paste this script: Script# This is from my original Icecast/Liquidsoap script
# log dir
# set ("log.file.path","/var/log/liquidsoap/101.log")
set("scheduler.fast_queues",1)
# Music
music = playlist("https://www.website.com/DJ/101.asp",mode="normal")
# Start building the feed with music
#
# I've changed your radio to radio 101
#
radio101 = music
# ===========================================
# Provide by gAlleb on March 24, 2024
# (https://github.com/savonet/liquidsoap/issues/3825#issuecomment-2018942115)
# ===========================================
# Stream it out
radio101 = mksafe(radio101)
# For Station101
# Define 3 streams with different bitrates. You can make 1 or 2 streams (as you wish).
aac_lofi = %ffmpeg(
format="mpegts",
%audio(
codec="aac",
samplerate=44100,
channels=2,
b="96k",
profile="aac_low"
)
)
aac_midfi = %ffmpeg(
format="mpegts",
%audio(
codec="aac",
samplerate=44100,
channels=2,
b="128k",
profile="aac_low"
)
)
aac_hifi = %ffmpeg(
format="mpegts",
%audio(
codec="aac",
samplerate=44100,
channels=2,
b="192k",
profile="aac_low"
)
)
# Put them all together
hls_streams = [("aac_lofi", aac_lofi), ("aac_midfi", aac_midfi), ("aac_hifi", aac_hifi)]
# Make interesting names for your segments
def hls_segment_name(~position,~extname,stream_name) =
timestamp = int_of_float(time())
duration = 4
"#{stream_name}_#{duration}_#{timestamp}_#{position}.#{extname}"
end
output.file.hls(playlist="radio101.m3u8",
segment_duration=4.0,
segments=5,
segments_overhead=2,
segment_name=hls_segment_name,
#
# Please note that you need to indicate here real paths to your nginx server.
# They would probably be /var/www/html/...
#
persist_at="C:/nginx/html/hls/persist",
"C:/nginx/html/hls",
#
#
#
#
hls_streams,
radio101
)
A new file will open, paste the following into it (remember we are taking into account, that you have created [Unit]
Description=Liquidsoap daemon for %I
After=network.target
Documentation=https://www.liquidsoap.info/
[Service]
Type=simple
User=carrzkiss
ExecStart=liquidsoap /home/carrzkiss/liquidsoap/%I.liq
Restart=always
[Install]
WantedBy=multi-user.target
Press
This will enable your liquidsoap script (/home/carrzkiss/liquidsoap/101.liq) as a service and enable liquidsoap service on system boot.
You should see your config file
You should find something like this:
P.S. Since we made systemd service with
Or you can run the service as root which is not great, just change
Try this as a starting point. Then you can tune up your nginx config with dedicated config, aliases if needed, other settings, modify liquidsoap script, etc. etc. |
Beta Was this translation helpful? Give feedback.
-
The stream stops after about 11 seconds. If I comment out the meta, it will run normally.
The error hits on this line.
My 101.liq code without Meta
|
Beta Was this translation helpful? Give feedback.
Maybe @carrzkiss needs somewhat a bit detailed guide) I'm reading all this like a thriller :) Let's do like Vito is suggesting:
Like Vito has said, it's better for you to use .deb package on Ubuntu 22.04. So forget about opam for now.
Navigate to your home user directory (e.g. /home/carrzkiss) and download and install Liquidsoap using following commands:
liquidsoap
in you home directory (e.g. /home/carrzkiss)