Login  •  Register

Tutorial: Icecast + OBS = Video!

Streaming & Listening. Tips, Tutorials, and Support.
Post Reply
User avatar
Swifthawk
Site Admin
Posts: 88
Joined: Sun May 24, 2020 10:43 am

Tutorial: Icecast + OBS = Video!

Post by Swifthawk »

Updated January 9, 2026. I continuously update this article as I learn more.

I've wanted to learn how to "self-host" streaming video since I started UruTunes back in 2007, and now I've finally done it! :ugeek: This setup uses Free and Open Source Software (FOSS) because that's how I roll. 8-) And of course, this is all just my opinions and experience; your mileage may vary. But I am looking for input, so if you find something wrong, missing, or confusing, please let me know. I have no affiliation with any entity or product described here, other than UruTunes.com.

This article is the ongoing saga and result of a possibly unhealthy chunk of my life researching all around the web and testing in Firefox, Chrome, VLC and more. I hope it helps you, and if it does, I hope you'll turn us on to your stream by listing it here on UruTunes.com — just join this forum and shoot me a message. ;)

Important!
This is about running server software directly from your own computer and is not recommended for slow PCs. Running a server requires Port Forwarding through your router, and this setup requires an Internet upstream speed of around 2 Megabits per second, per user — that's 100 Mbps for 50 users. These numbers are only made possible by using modern, high-efficiency compression codecs — namely AV1 for video and Opus for audio. Other codecs require significantly more bandwidth. There are always security concerns with running any public service so be mindful of that and understand it before proceeding.

Port forwarding is a way to translate your external IP address (WAN, public, Internet) to your internal IP address (LAN, private, devices). Internal IP addresses usually start with "192.168...". Without port forwarding, no one outside your LAN can "see" or connect to your computer. It's done via the settings in your internet router/gateway, and the steps are different for every make and model, so you'll need to work that out with the manufacturer's documentation. The default port for Icecast is 8000.

Icecast Streaming Media Server https://icecast.org/
Icecast is hugely popular with everyone from large commercial service providers such as Caster.fm, right down to little people like you and me using it every day. I use the latest version 2.5 for Windows, which has many improvements under the hood, like more reliable playback in various players. Because Icecast is rock-solid stable, free, fast, flexible, small, and ubiquitous across the Net, I've built my setup around it.

OBS Studio (Open Broadcaster Software) https://obsproject.com/
OBS is also quite popular and has a large community on Discord and elsewhere. Many successful streamers use it for production on the big services like Twitch and YouTube, and it's excellent at mixing, converting, and recording live video and audio, with support for nearly every standard out there.

This is my most commonly used setup, i.e. 1080p at 24 fps with 5.1 surround sound, but sometimes I do other resolutions and fps by tweaking these numbers. If you want to stream just plain stereo audio by itself, I recommend using BUTT (Broadcast Using This Tool) instead of OBS, because it's truly great at audio, and OBS is intended for combined video and audio. For plain stereo, Icecast's default settings work perfectly, but still read the documentation and change the passwords.

About containers and codecs. The most tricky bit about making this work for me has been deciding on the combination of container and audio/video codecs. I've looked high and low for those most modern, efficient for bandwidth, freely available, and supported by the most players and providers. My process has been to just do the hard work of "brute force" testing each and every combo that made sense to me for hours on end, and this is where I landed. I highly recommend using hardware AV1 for video if at all possible, because it ticks all the boxes and its performance is simply the best. It's allowed me to crank down the bitrate to such low levels as to make self-hosting in high quality on a typical Internet connection truly workable.


Strap in and good luck! You can do this! :)
Icecast, in the icecast.xml file:
https://icecast.org/docs/icecast-latest/ (Official docs)
In addition to standard stream settings (see those docs), either in the applicable <limits> or <mount> section, add or replace these 2 lines.
  • <queue-size>3555000</queue-size>
  • <burst-size>229500</burst-size>
  • Queue-size is how much data (Bytes) is kept in the server's memory to buffer the inevitable ups and downs in a player's network and processing speeds. If a player lags behind more than the queue-size, their playback stops.
  • Burst-size is how much data (Bytes) each player is given at the start. Burst must be smaller than queue.
NOTE: For burst and queue sizes, I have a rule of thumb that goes like this:
Take your total BIT-rate (bits per second of video + audio, from OBS or whatever), divide it by 8 to get the BYTE-rate, then use that number for a burst-size (amounting to 1 second). Then for queue-size, multiply the BYTE-rate by 30. 30 seconds is a lot, but that buffer is shared by all connected player clients so it's not a huge chunk of server memory, and some browsers seem to need it to play smoothly.

These metadata values go inside a <mount> block; they're optional, and can be set here in Icecast or below in OBS. Metadata in Icecast supersedes/overrides the same values in any source (OBS or whatever).
  • <stream-name>Stream Name</stream-name>
  • <stream-description>Stream Description</stream-description>
  • <genre>Stream Genre</genre>

OBS: Here we're using the Recording function, not Streaming, because it's just how OBS works.

Settings >
> Audio > General:
  • Sample Rate: 48kHz — Required by some codecs.
  • Channels: 5.1 — Fewer == less server load; small impact.
> Video:
  • Base (Canvas) Resolution: 1920x1080 — Lower == less server load; huge impact.
  • Output (Scaled) Resolution: 1920x1080 — Same as canvas; better done here than in Output > Recording below.
  • Common FPS Values: 24 — Lower == less server load; huge impact. This frame rate should match that of the source material if possible (but no lower), to allow the lowest rate while still avoiding "judder" or choppiness. Strangely, many modern movies are still recorded at 23.976 FPS, but OBS won't take decimals, so I actually use the "Fractional FPS Value" with a "Numerator" of 2997 and "Denominator" of 125 which gets internally rounded by OBS to a nearly perfect 23.98.
> Output > Recording:
  • Type: Custom Output (FFmpeg)
  • FFmpeg Output: Output to URL
  • File or URL: icecast://[username]:[password]@[host]:[port][/mount] — From icecast.xml. Replace these square bracketed labels with your values from Icecast.
  • Container: webm — This is a modern and open standard that many services are gravitating to.
  • Muxer settings — Space separated prop='val'; single quotes only. Only content_type is required, the others are optional and can be set here or in Icecast above. Here's an example full string entry:
    content_type='video/webm' ice_name='Stream Name' ice_description='Stream Description' ice_genre='Stream Genre' ice_public=1
  • Video bitrate: 948 Kb/s — Lower == less server load but reduced quality; huge impact. This leverages AV1's efficiency, and other codecs might require a higher video bitrate.
  • Rescale: [ ] no/off — better done in Settings > Video above.
  • Keyframe interval (frames): 36 — Number of normal frames between keyframes; higher == less server load (fewer keyframes), but more latency; medium impact.
  • Show all codecs: [x] yes
  • Video Encoder: av1_nvenc - NVIDIA NVENC av1 — Huge impact. Important: This is NVIDIA'S hardware encoder; if you have an AMD GPU you should try: av1_amf - AMD AMF AV1. Hardware encoding is always better/faster for rendering and encoding, with AV1 being the best. But if neither of these work, a good software encoder is the default: libvpx-vp9 - libvpx VP9.
  • Audio bitrate: 448 Kb/s — Lower == less server load; small impact. This is for high-fidelity 5.1 surround, but 96 to 192 will do for plain stereo.
  • Audio Encoder: Disable encoder — Yep, none. On my system, NVIDIA's AV1 hardware video encoder above seems to handle the audio with the OPUS audio codec, but the audio bitrate above still matters so set that first then disable this — strange thing. If your hardware's video encoder doesn't provide audio, try libvorbis - libvorbis here.
    NOTE (if you can't do hardware): I discovered that the libopus audio codec doesn't work in VLC for playback, so I changed to libvorbis which seems to work across all playback cases. However, as of this writing, Firefox has a bug in their libvorbis decoder that mixes up audio channel assignments — I've reported it and they're working on it.
That's it! Save everything, start Icecast and OBS, then click "Start Recording". If it starts, you're live! If not, there are many things to try.

Please let us know if this helped you. Thanks!

:D
Post Reply