### Live video with input.rtmp, fallback, and output.youtube.live.rtmp Source: https://www.liquidsoap.info Live video streaming setup: ingest RTMP from OBS, fallback to a playlist when no live source, and re-encode with FFmpeg (H.264/AAC) before pushing to YouTube Live. ```liquidsoap # Take a live video feed from OBS over RTMP. live = input.rtmp(listen=true, "rtmp://0.0.0.0:1935/live") # Fall back to a playlist of clips when nobody is streaming. show = fallback([live, playlist("~/videos")]) # Re-encode with FFmpeg and push it to YouTube Live. output.youtube.live.rtmp( key="your-stream-key", encoder=%ffmpeg(%video(codec="libx264"), %audio(codec="aac")), show ) ``` -------------------------------- ### Internet radio with playlist, rotate, crossfade, and output.icecast Source: https://www.liquidsoap.info A complete internet radio setup in Liquidsoap: playlists for music and jingles, a rotate operator for weighted scheduling, crossfade for smooth transitions, and output to an Icecast server with MP3 encoding. ```liquidsoap # A complete internet radio, in a handful of lines. music = playlist("~/music") jingles = playlist("~/jingles") # Three tracks, then a jingle, on repeat. radio = rotate([music.{weight = 3}, jingles.{weight = 1}]) # Smooth transitions between tracks. radio = crossfade(radio) # Stream it out to an Icecast server. output.icecast(%mp3, host="localhost", mount="radio", radio) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.