Video is constantly buffering
It's unfortunate that your Twitch viewing can sometimes be disrupted by random internet hiccups or bad routing from your ISP. You may put up with this and think there's no way of fixing it, well, there may be a way!

Instead of using the web browser video stream and chat room, you can use a program called Livestreamer to send the video to VLC Media Player and a Java based program called Chatty for the chat room.

What are the benefits of this? Firstly, you can specify the buffer time, so no matter how delayed your video connection may be, you'll always be able to maintain a constant stream. Secondly, moving the chat room from your web browser enables you to completely close it, saving resources that you may need for other things.

Basic set up to watch streams
When I want to watch a stream, I will go to Twitch and look for a streamer that I want to watch. I make a note of the streamer's channel name and then close my web browser. I open Chatty and get ready to log in.

With Chatty open, I log in to Twitch using an open auth token that is connected to my password (but isn't actually my password). In the same step, I connect to the chat room of the streamer that I want to watch.

Once connected, I ask Livestreamer to gather information about the stream. The response shows me which quality options are supported (low, medium, high, source e.t.c.). I select the quality setting I wish to watch. Livestreamer will open VLC Media Player and tell it to connect to the stream that I just selected.

That's it! Doesn't sound too complicated, does it?

Where to download the software
Download Chatty from GitHub
Download Livestreamer from Tanuki
Download VLC Media Player from VideoLAN

Grab the standard version of Chatty, the installer for Livestreamer if you're on Windows or use the command line if you're on Linux/MAC, and the installer for VLC Media Player. You may also need an archiver such as 7-Zip in order to extract the archive(s).

How to set up the software
Extract Chatty to its own folder (e.g. C:\Chatty). Install Livestreamer according to the instructions on the install page (or use the installer). Install VLC Media Player, using the installer.

Launch Chatty and you should be greeted with the Connect box. Click the Create login button and a box will pop up with Login configuration. Click the Request login data button and a box will pop up with Get login data.

You'll see several check boxes. Read user info, Editor access, Allow running ads, Show your subscribers. You don't actually need any of these to watch streams! Un-check the boxes and press the Open (default browser) button to open your browser and create a login.

If everything went as planned, you should see some information in your web browser:

Chatty - Access token received. You can close this page now and go back to Chatty.

If you look on the Login configuration box, you should now see that the Chat access option has a green tick next to it but the other 4 have a red cross next to them. If this is correct then your login token was created!

Your password is not used during this process! All you are doing is asking the Twitch web site (which you were already logged into, on your web browser) to generate an access token and send this access token back to Chatty, so that it can access the features you requested.

Click the Verify login button to confirm that your access token was created successfully. If you see "Login verified and ready to connect." then you're good to go! Press the Done button to close the Login configuration.

After the box closes, you should now see your user name next to the Account label. In the Channel input, enter the name of the streamer's channel you wish to connect. Press the Connect button when you're ready to connect. You'll see something similar to the text below.
Checking for new version..
You already have the newest version.
Trying to connect to irc.twitch.tv:6667
Joining #streamerchannel..
You have joined #streamerchannel
You should now be connected to the chat room of your chosen streamer!

Linking Chatty to Livestreamer
From the Extra menu, select Livestreamer and a box will pop up with several options. You should not need to change any of the options here, all you need to do is enter the streamer's channel name in the input that says:

Enter stream name or URL (or commandline options):
streamerchannel

When you've entered the name of the streamer's channel, press the Open stream button to retrieve information about that channel. When your display shows the PROCESS ENDED text, you should also see a row of buttons underneath that show which quality options are available.

Partnered
audio, high, low, medium, mobile, source

Non-Partnered
audio, source

Choose a quality option and Livestreamer will open VLC Media Player and connect to the stream!

If the stream opened and started playing straight away then congratulations! You have now replaced the Twitch web platform with a local alternative that has more configuration options and is generally more stable!

Minimize video buffering
So, you've done all of this and it's still skipping? Don't worry! All you need to do is change the Livestreamer options file and add a buffer, so that X amount of seconds are downloaded before your video begins to play.

You'll need to locate the configuration file for Livestreamer. On a Windows machine, this file should be located in the folder below. Other operating systems may vary, so please refer to the Livestreamer help for more information. Copy the text below and paste it into your folder location bar.

%userprofile%\AppData\Roaming\livestreamer

You should see a file called livestreamerrc. Load this file into a text editor such as Notepad++ and look at the VLC section. You should see something similar to the text below.
player="C:\PF (x86)\~\vlc.exe"
#player="C:\PF\~\vlc.exe"
# Using --file-caching is recommended, but is only supported in VLC 2.0+
#player="C:\PF (x86)\~\vlc.exe" --file-caching=5000 --network-caching=5000
#player="C:\PF\~\vlc.exe" --file-caching=5000
Please note that I have replaced Program Files (x86) with PF (x86) and the 64-bit Program Files with PF to save space on this page. I've also replaced VideoLAN\VLC with ~ for the same reason! I hope this does not cause too much confusion for you!

So, by default, the top line will be used and this is no good because it offers no buffering! Add a # to the beginning of that line to disable it and remove the # from the line further down that has the --file-caching stuff on the end. If you've done this successfully then your configuration should now look similar to the text below.
#player="C:\PF (x86)\~\vlc.exe"
#player="C:\PF\~\vlc.exe"
# Using --file-caching is recommended, but is only supported in VLC 2.0+
player="C:\PF (x86)\~\vlc.exe" --file-caching=5000 --network-caching=5000
#player="C:\PF\~\vlc.exe" --file-caching=5000
If your configuration looks similar to this then save the file and try to connect to a video stream again. You should now see that it takes a few more seconds to connect, buffer, and play the video. If the buffer is enabled then you shouldn't have any more problems with buffering. If for some reason it's still stopping and starting, try increasing the buffer size to 10 seconds, as shown below.
player="C:\PF (x86)\~\vlc.exe" --file-caching=10000 --network-caching=10000
This should hopefully solve any further buffering issues. If you found that 5 seconds was already fine then you could also try decreasing this value to around 2 or 3 seconds, which will keep your stream more in sync with the real time video and live streamer spoken responses to your questions.

Final thoughts
As a user of fiber optic broadband, I expect a low bit-rate video stream to play flawlessly but this is not the case. I have witnessed the bad routing of my ISP disappear by using a VPN server to connect to Twitch, but this seems like overkill for most users because good VPN servers are not free.

The solution explained in this guide seems like a suitable replacement for the Twitch web platform, even if it's a little tricky to set up. Once it's set up, the difference is very clear. Perhaps the stream buffering will not be an issue in future, but until then, I will use this completely free alternative!

If this guide has helped you to solve your buffering issue then please let me know! If you feel that you need to repay me for my efforts in explaining it to you, I'd really love for you to follow me on Twitch, Twitter, Facebook, e.t.c. I'll be eternally grateful! The links are on the footer bar, below. <3