Jump to content

[Guide] How to watch Twitch streams in VLC Player

So you can't watch Twitch streams properly, because your Laptop gets too loud or your PC is too slow? This method should drastically reduce the CPU power needed to play the stream. I will show you how to put a simple Batch file together that does most of the things for you. All you will have to do is to enter the channel you want to watch and the desired quality. Keep in mind that this method circumvents ads.

Livestreamer as well as VLC run on almost anything: Windows, OSX, Linux and BSD

UPDATE: You're now able to watch past broadcasts
 
What you need:. 
-VLC Player (DL: http://www.videolan.org/vlc/index.html)
-Livestreamer (DL: https://github.com/chrippa/livestreamer/releases)
-Editor
 
What you need to do:
1: Download and install VLC and Livestreamer
2: Create a new text document on your Desktop
3: Paste the following lines into the text file (You might have to change the second line if you installed Livestreamer in a different folder)
remove the space between @ and echo

@ echo offcd C:\Program Files (x86)\LivestreamerSET /P url=[Please enter the twitch.tv username]SET /P quality=[Please enter the quality]SET /P videoID=[Please enter the video ID or live for livestream]IF %videoID%==live (    livestreamer.exe twitch.tv/%url% %quality%) ELSE (    livestreamer.exe twitch.tv/%url%/v/%videoID% %quality%)


@ echo off // Hides executed commands from the Batch file
cd C:\Program Files (x86)\Livestreamer  // Changes the folder to the folder Livestreamer was installed in
SET /P url=[Please enter the twitch.tv username] // Creating the variable "url" 
SET /P quality=[Please enter the quality] // Creating the variable "quality"

SET /P videoID=[Please enter the video ID or live for livestream] // Creating the variable for vods
IF %videoID%==live (       // deciding if live was typed in
    livestreamer.exe twitch.tv/%url% %quality% //running the script in live mode 
) ELSE (     // execute if you typed in a vod ID
    livestreamer.exe twitch.tv/%url%/v/%videoID% %quality% //running the script in VOD mode
)

 
4: Save the text file and change its name to Twitch.bat (or anything really, as long as it ends with .bat ). If you want to move the file, put it wherever you want.
 
Executing the Batch file will open a console windows, asking you for the channel name (the bit after twitch.tv/). After that you're asked for the quality you want to watch in. You have the choice of the usual Twitch qualities: Source, High, Medium, Low, Mobile

 

Thanks to @manikyath for adding VOD support

 

8kukhVa.jpg

Molex to SATA, lose all your data

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Nice.

I know with YouTube videos, you can just drag the URL into VLC and it will work; that is not possible with Twitch streams?

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
Share on other sites

Link to post
Share on other sites

you could have it prompt you for the username and quality, rather than it being "hard coded"

 

my batchfile skills arent that well anymore sadly.

 

EDIT: wait, thats the code for the prompting isnt it? /durr

Link to comment
Share on other sites

Link to post
Share on other sites

 

EDIT: wait, thats the code for the prompting isnt it? /durr

exactly :D

Molex to SATA, lose all your data

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

exactly :D

i told you my batchfile skills are bad :P

 

/le save script :P

Link to comment
Share on other sites

Link to post
Share on other sites

I recall Luke semi-covering this

Shot through the heart and you're to blame, 30fps and i'll pirate your game - Bon Jovi

Take me down to the console city where the games are blurry and the frames are thirty - Guns N' Roses

Arguing with religious people is like explaining to your mother that online games can't be paused...

Link to comment
Share on other sites

Link to post
Share on other sites

should i make a java application that casts this in a nice GUI? i'd probably be able to, and be more appealing to the folks that dont like console.

Link to comment
Share on other sites

Link to post
Share on other sites

That's pretty cool. Any advantages over this than just using the Twitch player?

Link to comment
Share on other sites

Link to post
Share on other sites

That's pretty cool. Any advantages over this than just using the Twitch player?

Not as much cpu usage and you can't see twitch chat

Molex to SATA, lose all your data

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Not as much cpu usage and you can't see twitch chat

Lord knows that's useful.

Link to comment
Share on other sites

Link to post
Share on other sites

so, i managed to make a very crude java application that does pretty much the same as this script, but in an approachable UI.

decided to also add in chatty support, although that seems to be a bit derpy.

 

a few questions have arised tho:

- can i post the jar file on the forum? (y'know, software distribution)

- should i post the source code / java project along with it?

- chatty appareantly has built in livestreamer support, am i doing something redundant?

- how can i post it so it doesnt disappear into oblivion after a week?

Link to comment
Share on other sites

Link to post
Share on other sites

so, i managed to make a very crude java application that does pretty much the same as this script, but in an approachable UI.

decided to also add in chatty support, although that seems to be a bit derpy.

 

a few questions have arised tho:

- can i post the jar file on the forum? (y'know, software distribution)

- should i post the source code / java project along with it?

- chatty appareantly has built in livestreamer support, am i doing something redundant?

- how can i post it so it doesnt disappear into oblivion after a week?

You could make the default channel LTT, so it could be featured here http://linustechtips.com/main/topic/193630-complete-list-of-forum-addons-scripts-apps-etc/

Molex to SATA, lose all your data

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

i feel like it doesnt quite fit there, because even if its for the LTT twitch channel, its not really for the forum.

You would need to bend the rules a bit :D If you don't submit it, then make a separate thread for the program. 

Molex to SATA, lose all your data

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Thank you for this helpful and easy to understand Batch File Guide! ^_^

 

Not sure if it was mentioned in here but is it possible to play Archived Twitch Videos (aka: Past Broadcasts) in VLC with this same Batch File code??

Past Broadcasts don't work for me this way at all, only Live Broadcasts work fine w/ this Batch File.

 

Hmm... The only way I found to do it so far is simply by opening: Run.exe and typing in, for example: "Livestreamer.exe www.twitch.tv/linustech/v/10082916 Source" and it auto opens Livestreamer and VLC and plays the Past Broadcast from the Twitch url that you paste in. Works for Past and Live Broadcasts as well! :lol:

 

PS: I really like the "Skip Forward" button in VLC, as during Past Broadcast playback, it "quickly" fast forwards, and esp if I hold down that Skip Forward button for a bit.

 

Unfortunately we can't just Time Shift to any point in time in a Past Broadcast, nor can we Rewind, as far as I can tell. But it's only a few minor quirks. VLC Twitch playback is still awesome for when Twitch site itself starts going ape shit laggy and starts pausing & freezing.

 

Oh also, if you increase the "Current Playback Speed" from 1x to like 8x or 16x or even 32x it kinda works even better to skip even faster forward in the archive. But that gets a bit CPU intensive for some PC's, so be careful w/ pushing an HLS Stream in a 32x speed. :P

 

Anyways, if you do find a way to playback Archived Broadcasts via this Batch File, do share with us please, thank you!!

Link to comment
Share on other sites

Link to post
Share on other sites

Thank you for this helpful and easy to understand Batch File Guide! ^_^

 

Not sure if it was mentioned in here but is it possible to play Archived Twitch Videos (aka: Past Broadcasts) in VLC with this same Batch File code??

Past Broadcasts don't work for me this way at all, only Live Broadcasts work fine w/ this Batch File.

 

Hmm... The only way I found to do it so far is simply by opening: Run.exe and typing in, for example: "Livestreamer.exe http://www.twitch.tv/linustech/v/10082916 Source" and it auto opens Livestreamer and VLC and plays the Past Broadcast from the Twitch url that you paste in. Works for Past and Live Broadcasts as well! :lol:

 

PS: I really like the "Skip Forward" button in VLC, as during Past Broadcast playback, it "quickly" fast forwards, and esp if I hold down that Skip Forward button for a bit.

 

Unfortunately we can't just Time Shift to any point in time in a Past Broadcast, nor can we Rewind, as far as I can tell. But it's only a few minor quirks. VLC Twitch playback is still awesome for when Twitch site itself starts going ape shit laggy and starts pausing & freezing.

 

Oh also, if you increase the "Current Playback Speed" from 1x to like 8x or 16x or even 32x it kinda works even better to skip even faster forward in the archive. But that gets a bit CPU intensive for some PC's, so be careful w/ pushing an HLS Stream in a 32x speed. :P

 

Anyways, if you do find a way to playback Archived Broadcasts via this Batch File, do share with us please, thank you!!

i could patch it into my java app, its as simple as adding a field to target videos, and add the necessary code behind it. (which isnt much)

other than that, probably pretty easy to patch it into the batchfile as well.

Link to comment
Share on other sites

Link to post
Share on other sites

@ echo offcd C:\Program Files (x86)\LivestreamerSET /P url=[Please enter the twitch.tv username]SET /P quality=[Please enter the quality]SET /P videoID=[Please enter the video ID]livestreamer.exe twitch.tv/%url%/v/%videoID% %quality%

theres the code to watch past broadcasts. could add a hook to automagically switch between both.

 

@ echo offcd C:\Program Files (x86)\LivestreamerSET /P url=[Please enter the twitch.tv username]SET /P quality=[Please enter the quality]SET /P videoID=[Please enter the video ID, "live" for livestream]IF %videoID%=="live" (    livestreamer.exe twitch.tv/%url% %quality%) ELSE (    livestreamer.exe twitch.tv/%url%/v/%videoID% %quality%)

 

something along these lines perhaps?

Link to comment
Share on other sites

Link to post
Share on other sites

-snip-

theres the code to watch past broadcasts. could add a hook to automagically switch between both.

-snip-

something along these lines perhaps?

 

 

Thank you so so much, @manikyath & @sirtoby !!

I think this Batch code is complete and works perfectly fine for both Live and Past casts now, awesome! :lol:

Good work guys.

Now lets hope Twitch dumps this horrid Flash Video Player all together and moves fully to HTML5... before that Youtube Gaming website lunches. Hurray for competition! ^_^

Link to comment
Share on other sites

Link to post
Share on other sites

Thank you so so much, @manikyath & @sirtoby !!

I think this Batch code is complete and works perfectly fine for both Live and Past casts now, awesome! :lol:

Good work guys.

Now lets hope Twitch dumps this horrid Flash Video Player all together and moves fully to HTML5... before that Youtube Gaming website lunches. Hurray for competition! ^_^

WAIT... that actually worked perfectly first try? (i actually didnt bother testing...)

 

also, twitch has a new player going on on some channels, sometimes it seems.

Link to comment
Share on other sites

Link to post
Share on other sites

Edit: @sirtoby & @manikyath I tested it out again, though I'm a total newbie when it comes to Command Prompts / Batch Files but...

 

Hmm, perhaps one minor quirk, which also seems like a Livestreamer+VLC limitation (or a Batch file code issue?) is that we still can't watch: Currently "In-Progress Past Broadcasts", as they're being Archived in 3 mins chunks delays. It only works fully on Twitch site directly, like usual, w/ Flash and all.

Livestreamer simply does not recognize an Archived Video ID file as a Past Broadcast until the Broadcaster finishes Live Streaming for the night. And if Twitch or our local POPs are having buffering and freezing problems on Twitch site directly, and the Streamer, let's say casts for 7-8 every night... we have to unfortunately wait just as long so that the Broadcast finishes... then gets archived fully!

Otherwise, the 2nd Batch File seems to work just fine for watching Live or catching up on yesterday's & older Broadcasts. just don't try to watch In-Progress Broadcasts, it won't work, just shows it as Live, not from the beginning of the current archive, from what I understand. :(

But I hope I'm wrong, maybe someone can find a simple workaround solution, or perhaps it is indeed a Livestreamer / HLS limitation? :huh:

Guess we still can't dump the Twitch site, all together, just yet... :rolleyes:

 

Edit: Oh, and I don't think I can even see the new HTML5 Twitch Alpha Player yet, guess I need to get off my good ol' trusty Firefox v34 and upgrade to FF v40, which would break half of my Firefox Addons' functionality. :wacko:

Link to comment
Share on other sites

Link to post
Share on other sites

Edit: @sirtoby & @manikyath I tested it out again, though I'm a total newbie when it comes to Command Prompts / Batch Files but...

 

Hmm, perhaps one minor quirk, which also seems like a Livestreamer+VLC limitation (or a Batch file code issue?) is that we still can't watch: Currently "In-Progress Past Broadcasts", as they're being Archived in 3 mins chunks delays. It only works fully on Twitch site directly, like usual, w/ Flash and all.

Livestreamer simply does not recognize an Archived Video ID file as a Past Broadcast until the Broadcaster finishes Live Streaming for the night. And if Twitch or our local POPs are having buffering and freezing problems on Twitch site directly, and the Streamer, let's say casts for 7-8 every night... we have to unfortunately wait just as long so that the Broadcast finishes... then gets archived fully!

Otherwise, the 2nd Batch File seems to work just fine for watching Live or catching up on yesterday's & older Broadcasts. just don't try to watch In-Progress Broadcasts, it won't work, just shows it as Live, not from the beginning of the current archive, from what I understand. :(

But I hope I'm wrong, maybe someone can find a simple workaround solution, or perhaps it is indeed a Livestreamer / HLS limitation? :huh:

Guess we still can't dump the Twitch site, all together, just yet... :rolleyes:

 

Edit: Oh, and I don't think I can even see the new HTML5 Twitch Alpha Player yet, guess I need to get off my good ol' trusty Firefox v34 and upgrade to FF v40, which would break half of my Firefox Addons' functionality. :wacko:

I guess that's a limitation of Livestreamer. You could write to the developer, and request the feature. I wasn't even aware that you can watch a vod while the stream is still going.

Molex to SATA, lose all your data

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Edit: Oh, and I don't think I can even see the new HTML5 Twitch Alpha Player yet, guess I need to get off my good ol' trusty Firefox v34 and upgrade to FF v40, which would break half of my Firefox Addons' functionality. :wacko:

thats the reason html5 isnt default everywhere yet, backwards compatibility.

 

i've done my own share of neckbeard patching to keep outdated stuff running, some of it i still use.

Link to comment
Share on other sites

Link to post
Share on other sites

Also worth pointing out, if you watch one or two streams often you can make a tiny .bat file like this one 

livestreamer.exe twitch.tv/url quality

and it will launch your favorite stream with just two clicks instead of typing channel name and quality every time.

 

It also works with hitbox.tv

Location: Kaunas, Lithuania, Europe, Earth, Solar System, Local Interstellar Cloud, Local Bubble, Gould Belt, Orion Arm, Milky Way, Milky Way subgroup, Local Group, Virgo Supercluster, Laniakea, Pisces–Cetus Supercluster Complex, Observable universe, Universe.

Spoiler

12700, B660M Mortar DDR4, 32GB 3200C16 Viper Steel, 2TB SN570, EVGA Supernova G6 850W, be quiet! 500FX, EVGA 3070Ti FTW3 Ultra.

 

Link to comment
Share on other sites

Link to post
Share on other sites

I had no idea I can watch a stream without Kappa and KappaPride everywhere.

Born too early to explore the galaxy, born too late to explore the seas, born just in time to make memes.

Link to comment
Share on other sites

Link to post
Share on other sites

I had no idea I can watch a stream without Kappa and KappaPride everywhere.

8m8VQ_9z_400x400.jpg

 

enjoy

EDIT: in all seriousness, let me know if the script does anything odd, shouldnt, but could.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×