youcast

Create MultiCast Video Streams From YouTube Playlists

YouCast

YouCast is a Rust-based desktop application that turns YouTube videos and playlists into continuous UDP Multicast streams.

It allows you to build your own local IPTV network by defining "Channels" sourced from YouTube. YouCast manages the background processes to download, encode, and broadcast the content effectively simulating 24/7 TV stations on your local network.

✨ Features

  • Modern GUI: Built with Iced for a clean, dark-themed interface.
  • Channel Management: Create, edit, and delete custom channels.
  • Custom Metadata: Set Channel Name, Provider Name, and Service IDs (SDT info).
  • 24/7 Looping: Automatically restarts the playlist/video when it finishes to simulate a broadcast network.
  • Low Latency Transcoding: Uses FFMPEG with ultrafast presets for real-time streaming.
  • Multicast Support: Broadcasts via UDP (e.g., 239.255.0.1:1234), compatible with VLC, TiviMate, and other IPTV clients.

🛠️ Prerequisites

YouCast relies on two external command-line tools to function. These must be installed and available in your system's PATH.

  1. FFmpeg
  2. yt-dlp

Verify Installation: Open your terminal/command prompt and type ffmpeg -version and yt-dlp --version. If both commands return version info, you are ready.

🚀 Installation & Running

  1. Clone the repository

    git clone https://github.com/SarahRoseLives/youcast.git
    cd youcast
  2. Run with Cargo

    cargo run --release

📺 How to Use

1. Create a Channel

  1. Click the + Add Channel button.
  2. Name: The name displayed in the UI and burned into the video feed.
  3. Multicast IP: Use a valid multicast address (e.g., 239.255.0.1 up to 239.255.255.250).
  4. Port: Default is 1234.
  5. Playlist URL: Paste a full YouTube Video URL or Playlist URL.

2. Start Streaming

  1. Click the green Start Stream button on the channel card.
  2. The status will change to LIVE.
  3. Note: It may take 5-10 seconds for the FFMPEG process to buffer and begin sending packets.

3. Watch the Stream

You can watch the stream using VLC Media Player:

  1. Open VLC.
  2. Go to Media -> Open Network Stream.
  3. Enter the URL: udp://@239.255.0.1:1234 (Replace with the IP/Port you configured).
  4. Click Play.

⚙️ How it Works

When you click "Start Stream", YouCast spawns a system shell process that executes a pipeline:

while true; do 
  yt-dlp -o - "URL" | ffmpeg -i pipe:0 -c:v libx264 -f mpegts udp://...
done
  1. yt-dlp fetches the video and pipes the raw data to stdout.
  2. ffmpeg reads from stdin, transcodes the video to H.264 (720p), injects the channel name as an overlay, and outputs an MPEG-TS stream via UDP.
  3. The Loop ensures that if a video ends (or the playlist finishes), the command immediately restarts, keeping the "TV Channel" on air.

⚠️ Troubleshooting

  • Stream won't play in VLC:
    • Ensure you included the @ symbol in VLC (e.g., udp://@239.255.0.1:1234).
    • Check your Firewall. You may need to allow ffmpeg to send public UDP packets.
    • Multicast often works best on Wired (Ethernet) connections. Some WiFi routers block or throttle multicast traffic.
  • "Failed to start ffmpeg" error:
    • Ensure ffmpeg and yt-dlp are in your System PATH.
    • Restart your PC after installing them if the app can't find them.