To send a Liquidsoap radio stream to YouTube Live, you need more than the radio audio: add a video source, encode the combined audio and video with FFmpeg, then send it to the URL and stream key shown in YouTube Live Control Room. A still image is the simplest visual; a moving video is an alternative when you can support its extra encoding and bandwidth demands.
The Liquidsoap book documents this audio-to-video workflow, but its sample endpoint uses RTMP. YouTube recommends encrypted RTMPS, so retrieve the current URL from your stream settings and use it if your encoder supports it. Do not copy an endpoint or key from an old script and assume it is still right.
Build the audio-and-video signal path
Think of the broadcast as a chain: Liquidsoap supplies the radio audio, a still image or video supplies the picture, FFmpeg encodes both into a stream YouTube accepts, and the encoder sends that stream to YouTube’s ingest URL using your stream key. Each part has a separate job. Liquidsoap alone does not turn a radio-only source into a complete video stream for this workflow.
The official Liquidsoap book’s YouTube example illustrates a playlist as the radio source, an image as the video source, source.mux.video to combine them, and an FFmpeg-backed output.url to encode and send the result. Treat it as a pattern to adapt, not a configuration guaranteed to work unchanged with every installed version or build.
This distinction helps when something fails. If there is sound but no picture, inspect the visual source and the muxing step. If YouTube does not detect a stream, inspect the encoder output, destination URL and key. If the preview looks wrong, check the encoding settings and actual signal rather than changing the Liquidsoap playlist first.
Before you start, identify where each item will live: the Liquidsoap configuration, the image or video file, the separate secret file containing your key, and the FFmpeg-capable output. Paths are interpreted on the machine running Liquidsoap, so a file on your laptop is not available to a separate machine unless you copy it there. If you are choosing between a software setup and a simpler file-to-live workflow, our guide to streaming prerecorded store ads continuously explains a different use case and is not a substitute for this radio-audio chain.
Choose a still image or video source
A still image is the straightforward choice for a radio station whose identity is carried by the audio. The Liquidsoap book shows a single image added as video. You can use artwork, a station name, or other suitable visual material, provided you have the rights to use it and it remains legible at the size viewers will see. A static picture also avoids the additional moving-picture source and bitrate demands of a video loop.
A video file can take the place of the image when movement is important, such as a gentle animated background or a visual loop associated with a devotional or ambience channel. The Liquidsoap book documents a video-file alternative. Check that the file can be read continuously, that its duration and looping behaviour suit your source, and that its motion does not make the picture unpleasant or difficult to watch. More movement can require more video data, so test the result over the actual upload connection.
| Visual choice | What it gives you | What to check |
|---|---|---|
| Still image | A simple, stable picture paired with continuous radio audio | Correct file path, suitable dimensions and readable text |
| Video source | Motion or changing visuals alongside the audio | File decoding, looping behaviour, encoding load and upload capacity |
If you already have a video playlist workflow, the guide to looping a nature playlist in VLC for YouTube Live may help you think through the difference between cycling video material and adding a visual to a Liquidsoap radio source. The tools and signal paths differ, so do not assume VLC instructions map directly to Liquidsoap.
Keep the visual source practical. A station logo on a plain background may be more useful than a large, detailed picture that compresses poorly. If the image contains text, check it in YouTube’s preview rather than judging only from the original file. For a video, watch for black frames, unexpected pauses, or a file ending and leaving the output without a picture.
Combine and encode the feed with FFmpeg
In the Liquidsoap pattern, source.mux.video(video=video, radio) combines the video source with the radio source. The resulting source then goes to an FFmpeg output configured to produce a container and audio/video codecs. The book’s example uses FLV output, H.264 video and MP3 audio at a 44.1 kHz sample rate. YouTube lists MP3 or AAC audio for RTMP/RTMPS and 44.1 kHz for stereo audio in its encoder settings guidance.
A compact illustration of the pieces is below. It follows the documented pattern, but it is not a ready-to-run universal script: syntax, output support, file paths, and settings can vary with your Liquidsoap and FFmpeg installation. In particular, the destination must be replaced with the current URL and key you retrieve for your own stream.
radio = playlist("~/Music")
video = single("image.jpg")
radio = source.mux.video(video=video, radio)
ykey = string.trim(file.contents("youtube-key"))
# Configure the FFmpeg-backed output for your installed Liquidsoap version.
# Supply the current YouTube ingest URL and key through the supported output.
The book’s full example places encoding parameters in an FFmpeg format declaration and uses output.url. Its illustrative video bitrate is 300k, which the book describes as deliberately low; it suggests increasing it to around 2000k on a fast connection for better picture quality. Those are example values, not a universal YouTube preset or a promise of quality. Choose settings that your encoder supports and test with your actual visual material and connection.
YouTube’s encoder guidance recommends a two-second keyframe interval and says not to exceed four seconds. Validate the emitted stream rather than assuming a setting in a configuration file has taken effect. Keep the audio sample rate and codec aligned with YouTube’s current guidance, and use a video codec and pixel format that your encoder and destination accept. If you change audio encoding from MP3 to AAC, confirm the installed FFmpeg build and Liquidsoap output can create it.
For a low-motion still image, the video bitrate can often be lower than a busy moving picture needs, but the right value depends on the image, encoder and available upload capacity. The key trade-off is quality against a stable feed: pushing a larger bitrate through an unreliable connection can create interruptions, while an overly low rate can make a picture look poor. The article on OBS settings for a 24/7 stream on a BSNL connection covers connection-aware thinking for another encoder; its specific configuration is not a substitute for testing this FFmpeg output.
Retrieve the current YouTube ingest URL and key
In YouTube Studio, open Live Control Room and create or select the stream you intend to use. YouTube’s encoder setup instructions direct you to configure the encoder with the stream URL and key provided for the stream. Copy both from the current stream settings instead of relying on an address found in an old example or saved note.
Treat the stream key as a password. Store it separately from a script that might be shared or committed publicly, and restrict access to the file or configuration where it is kept. The Liquidsoap book’s example reads the key from a separate youtube-key file and trims surrounding whitespace with string.trim; this avoids putting the secret directly in the visible script and helps prevent accidental spaces or newlines from becoming part of it.
The sample code above illustrates that separation, not a requirement to use a particular filename. Use the secret-handling method suitable for your deployment, and take care that diagnostic output does not print the key. If you suspect it has been exposed, reset it in Live Control Room and update the value used by your encoder. Do not paste it into a public issue, chat, or screenshot.
The URL and key are a pair for the selected stream configuration. If the encoder cannot connect, recopy both rather than changing unrelated encoding options at random. Confirm that you have not combined a URL from one stream with a key from another, and check the exact protocol shown in YouTube settings.
Prefer RTMPS when the output supports it
RTMP is present in the Liquidsoap book’s example, but YouTube recommends RTMPS, an encrypted extension of RTMP. YouTube’s RTMPS guidance explains that the RTMPS URL can be revealed in Live Control Room’s stream settings. Copy the URL shown there; do not build one from a remembered hostname or assume that a familiar endpoint remains current.
RTMPS support depends on the Liquidsoap and FFmpeg output available in your installation and how it is configured. Confirm that your chosen output accepts the protocol and the exact URL YouTube supplies. If it does not, review the supported output options for your installed versions rather than silently replacing the URL with an invented address. The book’s RTMP example is useful for understanding the workflow, but it is not proof that your particular setup supports RTMPS.
If the RTMPS connection fails with a certificate or timeout problem, first verify that you copied the right URL and that the output supports RTMPS. YouTube’s security guidance also discusses trying port 443 when needed. Make that change only where the official guidance and your encoder’s supported configuration call for it, then test again. Keep the stream key out of error reports while diagnosing.
Use RTMP only when it is the protocol supported by the output you can operate, and understand the trade-off: RTMPS provides encrypted ingestion, while a legacy or incompatible output may require additional work to support it. Whatever you use, the destination must match the current stream settings in Live Control Room.
Test the broadcast before relying on it
First run a short test with the same audio, visual source, encoding settings, machine and connection you expect to use. Watch the output locally if your setup permits, then check the preview and stream health in Live Control Room. Confirm that the picture is present, the audio is audible and continuous, and YouTube receives the expected format. A configuration that starts without an error is not by itself evidence that the viewer-facing result is correct.
Check representative sections, not only the first moment. A playlist may move to a track with a different loudness level; a video file may reach a blank or unexpected frame; the connection may struggle when the encoded picture becomes busier. YouTube advises testing with representative audio and motion and monitoring stream health. The purpose is to find problems in the full path before you depend on it through a long broadcast.
A scheduled stream may show an encoder preview before it is actually visible to viewers. Depending on its settings, you may need to click Go live after the preview appears. Check the stream state in Live Control Room rather than assuming that a connected encoder has published the stream. When finished, end the broadcast in YouTube as appropriate for the stream you created.
If the test has no incoming signal, verify the current URL, key and protocol, then check that Liquidsoap’s output is running and the file paths resolve. If the stream arrives but looks poor, inspect the video bitrate and encoder output; the Liquidsoap book explicitly flags its low example bitrate as something to tune. If audio is missing or distorted, verify the chosen audio codec and sample rate against YouTube’s current settings and inspect the encoded output.
For a 24/7 channel, the test should also include an unattended period long enough to check the operational hand-off you rely on: source continuity, connection stability and recovery after a deliberate, controlled restart. Do not treat a short preview as proof that a stream will run indefinitely. If you need an always-on broadcast without leaving a computer running, StreamNeo removes the specific burden of keeping the streaming computer on by turning an uploaded video into a YouTube live stream; it is a separate file-based workflow, not a Liquidsoap audio-to-video encoder.
Keep the workflow maintainable
Once the signal path works, record the parts that must be repeated: the Liquidsoap source, visual file path, encoding choices, current protocol, and where the secret key is stored. Do not record the key in a document that can be shared with the rest of the setup notes. A brief runbook should tell you how to restart the process, where to look for Live Control Room status, and how to replace a key if it is reset.
Keep a known-good copy of the configuration before changing one variable. For example, if you alter the video source and bitrate at once, a bad picture is harder to diagnose than if you change the visual first and then adjust encoding. This is not a reason to avoid improvements; it is a way to identify which change caused a new fault.
Also decide who will notice a failed stream. Liquidsoap and FFmpeg can be configured to report or recover from some failures depending on versions and setup, but you should not assume that a process restarting means viewers have a healthy broadcast. Check the actual YouTube preview and stream health when the channel matters, and make sure someone knows where the credentials and recovery steps are kept.
Before committing, compare the operating options on the pricing page. When the file and channel are ready, start free — 24-hour trial, no card.
FAQ
Can Liquidsoap send radio audio directly to YouTube Live?
Not as a complete video stream in the workflow described here. Add a visual source, combine it with the radio audio, and encode the result before sending it to YouTube. The Liquidsoap book shows this pattern using a still image and an FFmpeg-backed output.
Do I have to use a still image?
No. The Liquidsoap book documents a video-file alternative as well as a static image. A still is simpler to test and places fewer demands on the video source; moving content needs its own checks for decoding, looping, encoding and upload capacity.
Where do I find the RTMPS URL and stream key?
Open the relevant stream in YouTube Studio’s Live Control Room and copy the current URL and key from its settings. Use RTMPS when your output supports it and the URL is supplied there. Keep the key private, and reset it in Live Control Room if it may have been exposed.
What should I check if the encoder connects but viewers see no stream?
Check whether Live Control Room shows a preview and whether the scheduled stream requires you to click Go live. Then inspect the stream’s status and verify that the URL, key, protocol and encoded audio/video are correct. A connected encoder does not necessarily mean the stream is already published to viewers.