The increase in popularity of user-generated streams, driven by Starcraft II and several of the games in the moba genre, has given rise to an enormous expansion of streaming providers such as Twitch.tv and Own3d.tv. Unfortunately, to enjoy these streams, you’re usually tied to a browser window and the flash player to enjoy these streams. You can name the upsides of this solution all you want, but the obvious downsides remain:
- doesn’t work on systems that don’t have the flash player (like those heinous i-devices)
- introduces horrible usability, e.g.:
- no volume adjusting by scroll wheel or multimedia keys
- no clicking onto the video to bring focus to it (without it redirecting you to some page)
- no small window-borders, instead you have the cluttered browser ui where it’s completely unnecessary
- no way of viewing the actual resolution of the stream’s video data
- high cpu load when VLC can playback h264 using the GPU’s video decoding unit to do this more efficiently
… i guess you catch my drift.
Sadly, streaming providers such as the aforementioned ones don’t provide a portable, universally usable address that users can just plug into their system’s favorite video player to playback these streams. This is where this article comes in.
Unfortunately, stream providers don’t offer streams as regular rtmp URIs and instead rely on some configuration via the respective flash video player. The obvious reason for this is, among visual customization, to provide an easy way of displaying advertisements as an overlay to the video.
Getting around this layer of abstraction can be accomplished by using rtmpdump. It provides parameters for passing along configuration parameters that are normally provided by the flash video player. Amusingly, it has an option named for justin.tv which should show that it was in part developed with accessing streams from this provider in particular in mind. You can set it to output the grabbed video/audio stream into a pipe, a construct that most operating systems support, where it can be picked up by a player that has the capability to do so.
This is where VLC [use 1.1.11 linked on the page, newer versions seem broken] comes into play, because it can do just that. It also includes a nice network streaming interface that doesn’t crap out when there is initial buffering; so far this is the best program i’ve found for this particular use.
Assembling the required configuration parameters to build a command line for rtmpdump isn’t that easy, so i’ve written a script that does it for you: