Ultimate streaming guide

= Introduction =

I've written a few guides on this topic. Things have changed pretty dramatically since the last time I tackled writing one, so I figured I'd update my own knowledge with a new comprehensive guide and share it. I'll try to keep things comprehensive but compact and to-the-point. I'm also assuming you have at least some knowledge of how video recording works on a PC, and won't explain every glossary word in detail. If you're genuinely confused, post a reply here and I'll try to answer your questions.

= This guide will cover =


 * Requisites for video streaming
 * Widely used streaming software
 * Xsplit
 * Open Broadcaster Software(OBS)
 * Flash Media Live Encoder (FMLE)
 * Specific configurations
 * Hardware options

= Part 1: Requisites & general guidelines = There's quite a few of us who record footage too our hard drives and edit/upload it too services like youtube. That's great for ultra high-quality footage and designed projects, but video streaming is a bit different. streaming involves encoding & compressing video for upload to the internet in real time. This presents some challenges/limitations and advantages over prerecorded video uploading. Streaming video allows for more interaction between viewers and producers while being bound to more technological limitations then local recording and later upload.

TLDR: Live-streaming video is not the same as uploading a pre-recorded video. There can be greater technological limitations and less option to edit your video.

Know your limitations
Live stream encoding is about as taxing on your actual CPU as recording to your HDD. The stream software works a bit harder to package the data for sending too the internet, but the process of screen capture and encoding frames is comparable. Video encoding also takes place entirely on the CPU; graphics cards are not a factor. Most likely, your bottleneck will be your internet bandwidth. I stream at about 1400 Kbps and I have a maximum bandwidth of about 1600 to any of the twitch.tv servers. This means the video I stream has to be at or below that 1600 mark. This can have some very detrimental affects on the quality of the video I'm able to stream. Your streaming software isn't magic; it cannot encode a high definition video into a very small bitrate without significantly degrading the quality of the video. However, streaming at the same bitrate and a lower resolution can yield much clearer video. The catch is you may not be able to stream in 720p all the time, or 1080.

This is where intuition comes in; you'll have to decide where you want to allow the quality of the video to degrade or cut the resolution down and not stream in HD. This especially comes into play when streaming more dynamic video like an FPS game where the scene is constantly moving and changing.

TLDR: Streaming is CPU bound and not affected by things like RAM, disk write speed or your Graphic card. Internet bandwidth will probably be your bottleneck. Higher resolutions require higher bitrates and more internet bandwidth. Choose a bitrate and resolution that yields good quality video.

Here's an example to demonstrate the issue
These videos are recorded at the same bitrate, 1400 Kbps (Kilo bytes per second), and at different resolutions. The 1280x720 video is a higher resolution, but the bitrate is too low and the video is frequently grainy and poor quality. The other video is 852x480 which isn't as high a resolution but is much clearer because the bitrate is high enough to smoothly encode all the video. You'll also notice that the video is clearest when nothing is happening. It takes more bandwidth to encode movement in the scene then it takes to encode a still image. The scene with the C4 explosion best demonstrates this.
 * 1280x720 example
 * 852x480 example

Important note: Remember that whatever bitrate you stream at must be matched by the viewers or they'll get choppy video. A high bitrate could make the video very smooth but also make it impossible to watch for many people.

Now that we've got that bandwidth talk out of the way, let's consider our hardware. 4 years ago streaming was only available to people with very high end and CPUs. This was due to the limitations of technology at the time as well as a lack of well programmed and optimized software. Modern CPUs are almost all able to encode just fine, whether you prefer AMD or intel. I've used an AMD 955 black edition CPU with no problem and I currently use a cheapy i7 2600 series CPU. Anything with 4+ cores and a speed around or above 3 Ghz should be sufficient. Ultra high-end hardware is only really necessary in cases of super high quality streams; we won't be covering that sort of thing here. TLDR:A mid-range CPU should work fine. Higher end hardware isn't necessarily needed except for some extremely high definition cases.

= Part 2: Popular streaming software = At this point, you're probably already aware of some common programs used for streaming. While more new options seem to popup every few months, we'll focus on the 3 most widely known and used sources for now.

I will not be discussing You may think these programs are all equal and have similar merits, but they actually vary quite a bit. Functionality changes according to which program you decide to use and the quality of the output will also vary. Hopefully, I can give you a quick synopsis on what each option offers and help you decide which one to try first.
 * Xsplit
 * Open Broadcasting Software
 * Flash media live encoder
 * Wirecast
 * Built-in streaming software, like the Planetside 2 streaming service

Xsplit
Xsplit started out a few years ago when there was no good alternative to FMLE. It was one of the first programs that caught on with gamers and the gaming industry and was the first streaming program developed & designed with gaming in mind. It boasted a new x.264 codec that was more efficient then h.264 & offered multicore rendering, which was cutting edge at the time. It offered superior quality and functionality over the other widely available software of the time, FMLE. However, it is a commercial program and costs money for many of its features to be unlocked. The freeware version imposes, what some would consider, unfair limitations. Even my own paid-for version lacks some useful features because my license is for personal use and not commercial/business related. However, it still gets the job done if you decide to use it.

Some features xsplit offers:
 * Storing multiple scenes (4 with unpaid, 12 with paid version)
 * Custom global hotkeys for many settings including muting & scene changing
 * Scalable preview window, but no option to disable
 * Setting broadcast details on your website (Twitch, own3d, etc)
 * Embed text, media files, images with transparencies
 * Game source capture (Paid feature)
 * Stream @ framerates above 25 (Paid feature)
 * Stream @ resolutions up to 1080 (Paid feature)
 * Stream delay (Paid feature)
 * Store multiple streams information
 * Chroma key
 * Screen capture (Watermarked in free version)

TLDR: Skip down to settings recommendations if you don't care to read settings explanations.

Basic overview & configuration


The UI is pretty self explanatory. The view is a direct preview of what your stream will look like before compression & encoding. You can add sources with the button in the lower left corner and move them around on-screen. Different sources can be layered in the sources menu by pulling them up/down. Un-checking source boxes will make them invisible regardless of their layer position.

The options menu:


Some of these settings may look familiar if you've done any video encoding/recording before, but others are certainly going to be new.

Stream key: this is the unique identifier the streaming service will use to identify you. You can find it in twitch.tv by going to dashboard -> streaming apps -> show key. Anyone can stream to your channel with this key, so keep it secret!

Location: select which server you stream too. A server that's farther away from you will increase the risk of packet loss and dropped frames, making your stream look choppy. Choose one that's close too your actual location. Important: Always test your connection with the "test bandwidth" button before streaming! I've had a poor connection to the Chicago before, making my stream choppy despite the fact that it's literally less then 1 hour drive time from my home.

Preset: Used for compression and encoder settings. By default, this is set to "veryfast" which does minimal compression on the video and uses the least cpu resources. Setting this to slower settings can use much more CPU resources but reduces the amount of bandwidth needed to stream your video smoothly. You can leave this alone and get by just fine 90% of the time.

Quality: this one is quite important and often overlooked. The quality setting determines how good each individual frame of your video looks, or how much it's compressed when captured and packaged for streaming. Setting the quality a bit lower will conserve bandwidth space by making each frame slightly smaller in data size. This can help keep your stream looking a bit smoother and more consistent when capturing dynamic footage (video that has lots of motion and color changes).

VBV max bitrate & Buffer size: these settings dictate what maximum bitrate your stream should hit. The buffer is how much data should be contained on your computer during the stream. Setting the buffer higher then the maximum bitrate will tell xsplit to retain more data before sending it, and results in more dropped frames and bandwidth spikes. Alternatively, setting the buffer a bit lower then the maximum bitrate will tell xsplit to hold less data and make the video smaller as it's streamed, making the video more consistent, similarly to the quality setting.

Resolution: you can generally keep this on default stage resolution, since that's what you'll be streaming at.

Audio format: make sure this setting is the same as your microphone settings! Setting it lower then your microphone's settings will really mess up your audio! Mono can save you a bit of bandwidth but makes spacial/positional audio impossible to hear for viewers. My 48,000 KHz microphone being streamed @ 44,100 KHz

Audio bitrate: Self explanatory. 96000 is somewhere around compressed mp3 quality.

Codec: choose between AAC & Speex. I've only ever tried AAC.

Automatically save a local copy will record the stream in an flv file. It's not easy to use in editing due to the format, and isn't easy to convert to different formats either. It can be useful if you just want a copy of the video, or want to rebroadcast later.

Interleave audio & video into one RTMP channel: this basically helps protect against audio & video desync. Somewhat pointless to turn this off.

Settings recommendations:
If you can't hit that 1700 kbps bitrate mark, I'd recommend dropping the resolution down and maintaining fps and bitrate. Anything in the 16:9 aspect ratio should work fine. I use 852x480 for fps games where the screen is often dynamic and moving and 1280x720 for things like SC2 and dota2 where large portions of the screen are static images.
 * 1280x720 resolution is a standard ATM. It offers HD at reasonable bandwidth requirements.
 * 20 FPS as a minimum; higher frame rate will look smoother but will increase bandwidth requisites.
 * 1700-2000 kbps bitrate for 720 video.
 * Quality between 6 and 10, depending on how confident you are in your internet being consistent.
 * Audio bitrate: 128000 if you have some bandwidth headroom, 96000 as a minimum.

Open Broadcaster Software
OBS is a brand new piece of software being developed as open source and rivals functionality of professional paid versions of xsplit. In my experience, it starts up much faster, uses less cpu resources & produces comparable quality video to xsplit while being entirely free. However, the software is still in alpha phase and has much more work to be finished before it's perfected.

Some features xsplit offers:
 * Any resolution & frame rate up too 120
 * Scaleable preview window, but no option to disable
 * Embed text & images with transparencies but no video/media files (yet)
 * Local stream delay
 * Storing multiple scenes
 * Store multiple streams information
 * Store multiple setting presets & switch between them easily
 * Chroma key
 * Screen capture
 * Game source capture

TLDR: Skip down to settings recommendations if you don't care to read settings explanations.

Basic overview & configuration


OBS functions and looks very similar to xsplit. The preview window is grayed out unless you're actively streaming or previewing the stream. Scenes don't exist at startup; you'll have to create scenes by right-clicking the scenes box and selecting Add Scene. You can add sources to your scene by right clicking in the sources box and selecting an option (Software, image, video/camera, text). You can define global sources to quickly add them to any new scene with preset configurations. IE: My webcam is set to 800x640 resolution @ 30fps globally & I can add it with these settings to any scene immediately. You can also right-click scenes in the scenes box and set hotkeys & rename them, which is quite useful. All settings made are saved in real time, so there's no loading/saving presets to a file.

Setting up & editing scenes


Scenes don't automatically preview in OBS. Clicking the preview stream button will show you the scene and allow editing. To resize/move sources in the scene, highlight the object in the sources box and click the edit scene button. A red resizing box will appear around the object and allow you to resize/move it wherever you need just like in xsplit. Turning edit scene off will lock the scene and not allow free editing when clicking on the preview window.

The options menu:
OBS isn't as straightforward as xsplit and the important options are set across several tabs. I'll cover them 1 at a time. Click settings to open the menu; options tabs are located to the left.

General
Change the language & create/switch settings presets.

Encoding
Quality: this one is quite important and often overlooked. The quality setting determines how good each individual frame of your video looks, or how much it's compressed when captured and packaged for streaming. Setting the quality a bit lower will conserve bandwidth space by making each frame slightly smaller in data size. This can help keep your stream looking a bit smoother and more consistent when capturing dynamic footage (video that has lots of motion and color changes).

Max bitrate & Buffer size: these settings dictate what maximum bitrate your stream should hit. The buffer is how much data should be contained on your computer during the stream. Setting the buffer higher then the maximum bitrate will tell xsplit to retain more data before sending it, and results in more dropped frames and bandwidth spikes. Alternatively, setting the buffer a bit lower then the maximum bitrate will tell xsplit to hold less data and make the video smaller as it's streamed, making the video more consistent, similarly to the quality setting.

Audio format: make sure this setting is the same as your microphone settings! Setting it lower then your microphone's settings will really mess up your audio! Mono can save you a bit of bandwidth but makes spacial/positional audio impossible to hear for viewers. My 48,000 KHz microphone being streamed @ 44,100 KHz

Audio bitrate: Self explanatory. 96000 is somewhere around compressed mp3 quality.

Codec: choose between AAC & MP3. I've only ever tried AAC.

Broadcast Settings
Stream key: this is the unique identifier the streaming service will use to identify you. You can find it in twitch.tv by going to dashboard -> streaming apps -> show key. Anyone can stream to your channel with this key, so keep it secret!

FMS URL: select which server you stream too. A server that's farther away from you will increase the risk of packet loss and dropped frames, making your stream look choppy. Choose one that's close too your actual location. Important: Always test your connection with the "test bandwidth" button before streaming! I've had a poor connection to the Chicago before, making my stream choppy despite the fact that it's literally less then 1 hour drive time from my home. OBS doesn't have a built in latency test, so try JTVping.

Delay (seconds): self explanatory, but a very neat feature. This setting tells the software to retain the video data for x seconds and send out the stream after the delay. It even does a countdown when you stop streaming before ending the stream to allow people to watch the full end. Works great.

Dashboard Link: specify the url to your twitch.tv dashboard. I have yet to see this setting be used for anything.

Save to file & File path: tell OBS to record your stream to an flv file on your HD and specify the location for it to be saved.

Video
Base Resolution: This setting defines what resolution OBS will be recording video from. This should ALWAYS match the resolution of the game you're playing. If you want to capture an entire monitor, there's also an option to do that.

Resolution Downscale: This decides what resolution you want to stream at. Unfortunately, there's no option to set a custom size yet but the downscale options are pretty good. Select 1.5 to stream a 1080p game in 720p, or 2.0 to stream in 480 & etc.

Audio
Specify your audio device, push to talk settings, mute/unmute hotkeys for your microphone & stereo audio, force mono & set artificial volume gain if your mic is real quiet.

Advanced - Be careful with these settings!
Use Multithreaded Optimizations & set process priority: Keep multithreaded optimizations on in almost all situations. Process priority can be turned up to ensure more CPU resources are diverted to rendering/encoding, but you risk losing more CPU power from your game as well.

x264 CPU preset: Used for compression and encoder settings. By default, this is set to "veryfast" which does minimal compression on the video and uses the least cpu resources. Setting this to slower settings can use much more CPU resources but reduces the amount of bandwidth needed to stream your video smoothly.

Use CBR: X264 will try to ensure your stream goes out at exactly the bitrate specified in the Encoding settings. This results in a less spiky (bandwidth wise) stream at the cost of quality, as x264 cannot allocate more bits to high motion without violating the CBR restriction. You should not need to enable this unless you have very specific network requirements.

Custom X264 settings: If you know the encoder very well and want to customize/tweak it for your own purposes, this is where you can do it.

Allow 61-120 fps entry in video settings: check this if you want to stream @ more then 60 fps (you crazy madman).

Audio - Use higher quality resampling: If your audio source is not 44,100 KHz, OBS will resample it. Useful if you're like me and have a 48,000 KHz microphone that doesn't sample correctly @ 44,100 KHz.

Use send buffer: this will cause OBS to buffer video/audio frames to this packet size before sending them to the network. This is not normally needed unless you are experiencing throughput problems.

Bind to interface: If you have multiple network interfaces, select the one which you wish OBS to use.

Settings recommendations:
These will be identical to the xsplit settings, because the two programs mirror eachother. If you can't hit that 1700 kbps bitrate mark, I'd recommend dropping the resolution down and maintaining fps and bitrate. Anything in the 16:9 aspect ratio should work fine. I use 852x480 for fps games where the screen is often dynamic and moving and 1280x720 for things like SC2 and dota2 where large portions of the screen are static images.
 * 1280x720 resolution is a standard ATM. It offers HD at reasonable bandwidth requirements.
 * 20 FPS as a minimum; higher frame rate will look smoother but will increase bandwidth requisites.
 * 1700-2000 kbps bitrate for 720 video.
 * Quality between 6 and 10, depending on how confident you are in your internet being consistent.
 * Audio bitrate: 128000 if you have some bandwidth headroom, 96000 as a minimum.

Flash media live encoder
FMLE, the original free software for streaming video. FMLE was popularized among gamers by Sean Plott in the SC2 scene where he started his Day9 Daily web show and offered up FMLE as his streaming software of choice. FMLE is developed by adobe and is completely barebones, but provides the clearest possible picture & is highly customizable. It also can be run from a command line through a bat file, which saves some resources and makes starting/stopping your stream very easy.

Some features xsplit offers:
 * Scalable preview window, can also disable
 * Stream @ any framerate
 * Stream @ any resolution
 * Store multiple streams information in xml config files
 * Launch from a command line

FMLE is different then xsplit and OBS. FMLE is a barebones encoder which does not offer a built in software capture module, meaning you'll need to find an external source program to provide a software capture source. Dxtory works, as well as other video capture software. I'm using playclaw, which I got for a free a bit ago.

TLDR: Skip down to settings recommendations if you don't care to read settings explanations.

Basic overview & configuration


This is the only gui window FMLE will ever give you. It has many of the same settings of xsplit and OBS, lacking a few but gaining a few more.

Video
Preset: FMLE has a few presets for what they consider balanced bitrates and bandwidth requirements. These are pretty outdated, and you should generally keep it set to custom and specify your own numbers.

Format: Pick your encoder & specify the encoder settings. This is the only program of the 3 covered here that doesn't use the x.264 encoder and instead uses H.264 or VP6. VP6 requires more bandwidth and higher bitrates but can produce a better quality video while H.264 has been the standard for the past ~5 years and produces great quality as well. Neither are as efficient as X.264, but they can produce a more crisp picture.

Input Size: unlike xsplit and OBS, you won't be setting up a virtual screen here. In FMLE, we specify an input size video and then crop/shrink it for streaming. The input size setting doesn't allow custom enteries, so specify whatever option is larger then, or equal too, your desired output size. If your input size is larger then your desired output, you'll need to use the crop feature to cut out the extra portions of the capture area. IE: I want to capture 800x480 resolution so I'd select 800x500 input size and crop 20 pixels off the bottom.

Bit Rate: FMLE doesn't allow specifying the buffer and max bitrate sizes; instead we just have this bit rate option. Set it to something practical for your stream resolution. 1700+ for 1280x720 @ 30fps is a good starting place

Audio
Device: FMLE also doesn't allow the mixing of your microphone and stereo mix. Instead, we can only select one or the other. There's a trick to getting both; go into your recording devices settings for your microphone and turn on the "listen to this device" option to hear your microphone through your stereo mix. You'll have to hear yourself through the sound, but it works. Other options exist, but they're much more complicated and involve more software.

Channels: stereo to allow positional audio & panning effects, mono for less bandwidth.

Sample rate: make sure this setting is the same as your microphone settings! Setting it lower then your microphone's settings will really mess up your audio! My 48,000 KHz microphone being streamed @ 44,100 KHz

Bit Rate: Self explanatory. 96000 is somewhere around compressed mp3 quality.

Stream to flash media server: Keep this selected unless you're trying to record locally only.

FMS URL: this is the same setting as location in xsplit & OBS. Select the server that is closest to your location. We need the actual addresses of each server to use this option, so take a look at them here: http://api.justin.tv/api/ingest/xsplit.xml And test your latency to the servers using JTVping

Stream: this is the unique identifier the streaming service will use to identify you. You can find it in twitch.tv by going to dashboard -> streaming apps -> show key. Anyone can stream to your channel with this key, so keep it secret!

Auto Adjust: this feature will let you decide what FMLE does in the case of a bandwidth/data spike that will degrade the quality of your stream. You can basically choose between making the video choppy by dropping frames, or making it look like crap but keep it smooth.

Save to file: save your stream in a f4v file. Similarly to flv from xsplit and OBS, f4v isn't very easy to convert or work with in editing.

Streaming from the command line


A big advantage FMLE has over xsplit and OBS is streaming from the console. It's not the easiest thing in the world to setup, but it works fantastically and minimizes the cpu resources used during streaming.

I won't cover this topic much here; I'll just give a brief overview of some of the basic settings that can be used. This is highly customizable and subject to virtually any setting possible in a windows command prompt.

The general idea is to start the cmd version of FMLE, which is present in the program folder, and give it a few arguments to specify settings & etc. You can open a command prompt and type in the commands manually for windows each time, but the much easier route is to make a custom .bat file and just open the file whenever you want to stream. This will start your stream as soon as you open the .bat file. Be prepared to go live as soon as you start it!


 * First, start FMLE and create the settings you want to use. Specify your video, audio and stream settings.
 * Next, save that configuration: File -> Save Profile
 * Open notepad
 * In the first line, type CD
 * Specify the path to FMLEcmd.exe (Most likely at C:\Program Files (x86)\Adobe\Flash Media Live Encoder 3.2) in quotation marks after CD.
 * Press enter to go to the next line and add "start FMLECmd.exe"
 * Add /p after FMLECmd.exe to specify your custom preset profile, and add the location in quotations (default "startup.xml" will be used if not specified)
 * Save the notepad file as a .bat and double click it to automatically start the command line.
 * The bare minimum .bat file should look like this:

The bare minimum .bat file should look like this: CD "C:\Program Files (x86)\Adobe\Flash Media Encoder 3.2"start FMLECmd.exe

There are many more parameters you can set for FMLE to read when starting in command line mode. For a full list of the parameters: link

You can also set affinity to lock FMLE to certain cores of your computer, and set the priority for windows in the .bat file.Use "/affinity 80" to bind the CPU affinity to the last core of a hyperthreaded quad-core CPU (an i7), or use "/affinity 8" to bind it to the 4th core of a non-hyperthreaded quad core cpu (an i5). You can also add the "/high" flag to change the process priority to high.

Online documentation for any more questions: link

Here is an excellent in-depth guide to using the command line FMLE: link

Settings recommendations:

 * 1280x720 resolution is a standard ATM. It offers HD at reasonable bandwidth requirements.
 * 20 FPS as a minimum; higher frame rate will look smoother but will increase bandwidth requisites.
 * 1700-2000 kbps bitrate for 720 video.
 * VP6 isn't a very viable codec anymore, stick with H.264 & use the 3.1 or 3.2 baseline setting.
 * Set keyframes every 10 seconds
 * Audio bitrate: 128000 if you have some bandwidth headroom, 96000 as a minimum.

If you can't hit that 1700 kbps bitrate mark, I'd recommend dropping the resolution down and maintaining fps and bitrate. Anything in the 16:9 aspect ratio should work fine. I use 852x480 for fps games where the screen is often dynamic and moving and 1280x720 for things like SC2 and dota2 where large portions of the screen are static images.