Login  •  Register

Tutorial: Icecast + OBS = Video!

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

Tutorial: Icecast + OBS = Video!

Post by Swifthawk »

I've wanted to learn how to stream video since I started UruTunes back in '07, and now I've finally done it! :ugeek:

Some may be surprised to learn that Icecast can do video also, but it does it quite well. Since it's free, powerful, small, and stable, I've based this (my) setup on it. This article is the result of dozens of hours researching and testing in Firefox and Chrome.

Important!
This involves running server software directly from your own computer. It's not recommended for slow PCs or internet, or lots of users, and requires Port Forwarding through your router. Internet upload speed of at least 10 Megabits per second (Mbps), per user is recommended. That's 100 Mbps for 10 users.

Of course, this uses Free and Open Source Software (FOSS) because that's how I roll.

Strap in and good luck! You can do this!

Icecast Media Server https://icecast.org/download/ Beta: https://icecast.org/news/icecast-release-2_5-beta1/
Icecast is very popular, but the project is quite stagnant at this point with no activity I can find since January 1st, 2015. That date refers to version 2.4.99.1 aka 2.5 Beta 1 for Windows, which I'm using and seems rock-solid, but the 2.4.4 version works great too. There are several places that I've found information, but I can't be sure what's official, and it's all pretty lacking.

Open Broadcaster Software (OBS) https://obsproject.com/download
OBS is also very popular and seems to be recently updated and cared for.

Other sites with good info:
https://wiki.xiph.org/Icecast_Server
https://www.radiocult.fm/blog/streaming-obs-to-icecast
https://epir.at/2018/03/08/obs-icecast-streaming/

Icecast, in the icecast.xml file:
In addition to standard stream settings, either in the applicable <limits> or <mount> section, add/replace these 2 lines.
  • <burst-size>1400000</burst-size>
  • <queue-size>5200000</queue-size>
OBS: In OBS, we're using the Recording function and not Streaming. It's just how OBS works.
Settings >
> Audio > General:
  • Sample Rate: 48kHz (required by libopus below)
  • Channels: 5.1 (for surround sound, or stereo)
> Video:
  • Base (Canvas) Resolution: 1920x1080
  • Output (Scaled) Resolution: 1920x1080 (better done here than in the Output > Recording below)
  • Common FPS Values: 30 (lower == less overhead)
> Output > Recording:
  • Type: Custom Output (FFmpeg)
  • FFmpeg Output: Output to URL
  • File or URL: icecast://username:password@host:port/mount (from icecast.xml)
  • Container: webm
  • Muxer settings (for FFmpeg, space separated prop=val, single quotes only). Here's the full string entry:
    content_type=video/webm cluster_size_limit=6M cluster_time_limit=5100 ice_name='Show Title' ice_description='Show Description' ice_genre='Show Genre' ice_url=www.UruTunes.com ice_public=1 live=true
  • Video bitrate: 1000 Kb/s (lower == less overhead, 1000 is max for a 2017 PC)
  • Rescale: no[ ] (more overhead; better done in Settings > Video above)
  • Keyframe Int: 23 (higher == less overhead but more latency; anything over 29 borks Chrome)
  • Show all codecs: yes[x]
  • Video Encoder: libvpx-vp9 - libvpx VP9 (default)
  • Audio bitrate: 768 Kb/s (lower == less overhead; 768 is for surround but 96 is fine for stereo)
  • Audio Encoder: libopus - libopus Opus (Default) libvorbis - libvorbis (requires 48 kHz in Audio > General > Sample Rate above)
    EDIT: I discovered that libopus doesn't work in VLC for playback, so I've changed this to use libvorbis which seems to work across all playback cases. However, as of this wrtiting, Firefox actually has a bug in their libvorbis decoder that mixes up audio channel assignments - hopefully that gets fixed soon.
To start the show, in OBS click "Start Recording".

As always, if you have any questions or input, please let me know.
Post Reply