Page 1 of 1

Tutorial: Icecast + OBS = Video!

Posted: Thu Aug 21, 2025 9:12 am
by Swifthawk
How to stream audio & video with Icecast and OBS Studio.

Here I describe how to self-host a streaming server for free on a standard PC, using Free and Open Source Software (FOSS).

I've wanted to self-host streaming video (and audio) since I started UruTunes back in 2007, and now I've finally figured it out. This article documents the ongoing saga of an unhealthy chunk of my life, researching all around the web, and endless testing in Chrome, Firefox, VLC, and more. I hope it helps you, and 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. It's all free.

Of course, this is all just my experience and opinions; 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).


Updated February 26, 2026.

Important!
This is about running server software directly from your own computer and is not recommended for old or slow PCs. Running a server requires Port Forwarding through your router, and this setup requires an upstream Internet speed of around 1 Megabit per second, per user - 100-Mbps for 100 users. This low number is 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 well before proceeding.

Port Forwarding is a way to translate your external IP address (WAN/Wide Area Network/public/Internet) to your internal IP address (LAN/Local Area Network/private/devices). Internal IP addresses usually start with "192.168...". Without port forwarding, no one outside your LAN can "see" or connect to your server. 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 (new!) which has many improvements over 2.4 (very old), 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. The kind folks over at the #Icecast IRC channel (irc.libera.chat) have tolerated me asking dumb questions and helped immensely. :D

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 and codec out there.

This is a commonly used setup that runs well on an average PC, i.e. 1080p at 24 fps in stereo, but sometimes I do other resolutions and fps by tweaking these numbers. If you want to stream stereo audio only, 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.

Containers & Codecs.
The 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 the most modern, efficient for bandwidth, freely available, and supported by the most players and providers. My process has been to just do the work of "brute force" testing each and every combo that made sense to me, for hours, and hours (and hours) on end, and this is where I landed. I highly recommend using AV1 for video, in your hardware 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>2595000</queue-size>
  • <burst-size>432500</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. This buffer is shared by all connected player clients so it's not a huge chunk of server memory.
  • Burst-size is how much data (Bytes) each player is given at the start. Burst must be smaller than queue.
Burst and queue sizes should be based on the BIT-rate of your stream as set by your source client (OBS or whatever). To calculate them, I have a rule of thumb that goes like this:
  1. Take your total BIT-rate (BITs per second of video + audio), and divide it by 8 to get the BYTEs (per second).
  2. For burst-size, multiply the BYTEs by 5, amounting to 5 seconds.
  3. For queue-size, multiply the BYTEs by 30, amounting to 30 seconds. Some browsers seem to need this much to play smoothly.
The following 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>
Additional metadata like the currently playing title must be provided to Icecast by the source client and not all support it.


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

These settings are very specific and interdependent on each other. If OBS won't start recording or stops on it's own, it's likely because of the combination of settings - especially the container, audio, and video codecs. To see if you're overloading your system, watch the bottom of the OBS window for messages, and use the Stats dock to watch for dropped or skipped frames — there should be very few if any. I recommend testing with a large and complex video with lots of movement.

Settings >
> Audio > General:
  • Sample Rate: 48kHz — Required by some codecs.
  • Channels: Stereo — 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 "Numerator" of 2997 and "Denominator" of 125 which gets silently rounded by OBS to a nearly perfect 23.98.
> Output > Recording:
  • Type: Custom Output (FFmpeg)
  • FFmpeg Output Type: Output to URL
  • File path or URL: icecast://[username]:[password]@[host]:[port][/mount] — From icecast.xml. Replace these square bracketed labels with your values from Icecast.
  • Container Format: 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, but Icecast overrides these. 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: 500 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.
  • Keyframe interval: 36 — Number of normal frames between keyframes; higher == less server load (fewer keyframes), but more latency; medium impact.
  • Rescale Output: [ ] — no/off; better done in Settings > Video above.
  • Show all codecs: [x] — yes/on
  • 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 are available, it's worth trying whatever your hardware can do, which you'd have to learn from its documentation. Otherwise, a good software encoder is the default: libvpx-vp9 - libvpx VP9.
  • Audio Bitrate: 192 Kb/s — Lower == less server load; small impact. This is for stereo; for more channels, you may want a higher rate (448 Kb/s for 5.1). Here at UruTunes we love great sound and this does that.
  • Audio Encoder: Disable encoder — Yep, none. On my system, NVIDIA's AV1 hardware video encoder seems to handle the audio with the OPUS audio codec, but the audio bitrate above still matters (I think?) 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 stand-alone 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.
If you've followed this perfectly, you should have a working stream. Click "Start Recording" in OBS and bask in the glow of your newly conquered skill set. If it starts, you're live! If not, there are many things to try - like changing the container/codecs combination. Feel free to contact me here if you need help.

Please let us know if this helped you. Thanks!

:D