Monday, May 14, 2012

Stream multiple computer screens online

The BIG technological hurdle that had to be accomplished for the Headshots from the Heart Marathon was the part that actually turns this into a gaming marathon - we don't want you just watching a webcam feed that shows a bunch of people sitting around playing video games, even with all the extra exciting entertainment and auctions we're going to have going on... we want to bring the action to YOU. We want you to be able to watch us gaming and see every frag we make. In addition to having a webcam that'll show you the hosts and what's going on around us while we play, we're going to be feeding the in-game action DIRECTLY to the stream.

There are a few ways to handle this, and really, it all depends on what exactly you need to setup, and how much money you want to spend.

Just a notice... While I go in-depth in my tutorials, there is a fair amount of stuff here that may be overly technical for some.


The Software Method

This method breaks down in to a few steps:

On the computers playing the video games:
  1. VLC captures the screen.
  2. VLC hosts a stream of the captured screen.
On the streaming computer:
  1. VLC grabs the stream and plays it back.
  2. WebcamMax Captures the video being played in VLC and acts as a webcam source.
  3. WebcamMax adds whatever effects we want.
  4. Livestream Procaster see the WebcamMax source, mixes in audio and streams to the internet.


So first, we install and launch VLC Media Player on all our computers.
http://www.videolan.org/

Stream the Gaming Rigs

On each computer we want to stream video from, we have to setup streaming. This'll be done on each of the gaming rigs, and perhaps even on the computers we'll be chatting with.

 In the "Media" menu, there's an option for "Stream"

After going in to the stream area, we need to choose what we want to stream, as VLC gives us many options. You can actually stream files, DVDs, etc.

We choose "Capture Device" and change the capture mode to "Desktop". This means that everything you see will be streamed.

 Don't forget to change the frame rate. By default, it sets to 1 fps.

1 Frame Per Second would be very choppy, so set it to 30, which is standard video quality.

Then click "Stream".



On the first Stream Output screen, just click "Next"

To setup the destination, choose "HTTP" from the drop-down, and click "Add".


This'll create an HTTP stream on port 8080 by default. If you don't know what that means, that's OK...  just leave it there.

The complicated explanation is that port 8080 is fine unless you have other services running on that port. You need to know the port for connecting to the stream, or for forwarding in your router if you want to stream to the internet.

Next you need to setup the Transcoding Options. This tells VLC the format, size and quality of the stream. I had some trouble here, with VLC crashing with different settings. I was able to get "MPEG-2 + MPGA (TS)" working though, and the quality was nice.


 There are some extra settings you have to setup though, so click the tools icon.
Luckily, these settings stay the same every time you launch VLC, so you only have to do this once.

The only tab you really need to setup is the Video Codec one.
  • Bitrate
    • Determines the picture quality of the video, BUT increasing it too high can add some lag and choppiness.
  • Frame Rate
    • We've already covered that this is how smooth the video will be. 30 fps is standard.
  • Resolution
    • This is the size (dimensions) of the video. 640 x 480 is pretty good, while HD is more in the range of 1920 x 1080. (1080p)
    • Livestream limits its free accounts to 640 x 480, and paid accounts (HD) at 1280 x 720. (720p)



Since we're not streaming audio from the games, we turn it off. Streaming it would just use up more processing and network bandwidth.


Save the settings, and hit "Next" to get to the final stream page, where all you need to do is hit "Stream".



Now, you're streaming. Anything you see on your computer, so does anyone connected to your stream.
You can minimize the VLC window and start your game.

You'll need to find your computers IP address so that you can connect to the stream though.

Open up a command prompt using "Start" then "Run" or [WINDOWS KEY] + [R] and type in "cmd".


type in "ipconfig" and hit [ENTER]


The "IPv4" address is what you need.
This means my stream is located at: http://192.168.9.21:8080   (  http://   [IP]   :   [PORT]  )



Play back the Stream

On the capture computer, we need to start by playing back the stream from the gaming rig.

Once again, we open VLC, but to play back, we choose "Open Network Stream"

Then, in the network URL field, enter the address to the gaming stream.

OOoooooo... yeah, this is what happens when you play back on the same computer that's streaming.

Capturing the Stream in Webcam Max

Webcam Max is an excellent program for rebroadcasting various sources and acting as a webcam. Any program that can use a webcam (MSN, Skype, Livestream, etc) can choose this program instead of your webcam.

By using Webcam Max, you gain access to all sorts of handy tools. You can broadcast your normal webcam, desktop, video games, programs, web streams and video files.

Then, you're able to add all sorts of effects to the feed. This includes text, graphics, picture in picture, facial recognition, lenses, etc. There's a wide range, and you're able to add more.

Webcam list in Skype after installing WebcamMax

When setting up the "Capture Screen" source, I choose Mode: "Specific Window" and then click and drag the "Select" button to the VLC window. (Notice it even highlights the area in blue) I turned the Cursor option to "None", but if you were doing a tutorial on a piece of software, you might want to leave it so you can point at stuff.




 The "Add Effects" section has plenty of features.

One we'll probably be using is the "Text" option to display how things are going, like the number of Headshots, donation amounts, etc.


Other effects include screen wraps, and facial recognition:



We might also use the Picture in Picture settings so that we could broadcast a live webcam image of the event, at the same time as the in-game action.



Once we've setup WebcamMax how we like, the next step is to stream in to the web.




Streaming to the Internet

We're streaming through a service called LiveStream. They offer free ad-supported streaming as well as paid high-res and extra feature streaming. Signing up and configuring my account was easy, though their story boarding stuff seems a little complicated at first glance.

But that's OK, because the main thing is to download and install their Procaster software to make things easy:
http://new.livestream.com/broadcast-live/encoder

From here, we sign in and setup the video stream.


As I've already mentioned, choose WebcamMax as the capture source.
Then click "Preferences" so we can take care of a few settings...

In the Video tab, you can setup a few things... most of it it picks up properly, but the "Settings" button next to your cam source will let you change the Cam Properties. I had to manually set the size to 640x480 @ 30 fps.



The Audio tab lets you change the sound quality, and gives you access to the mixer.

If all you're sending is a microphone, you can change the Channels field to "mono" and save some overhead. It'll reduce bandwidth and could reduce lag.

In the audio mixer, you can control what source(s) feed the stream. You have microphone inputs which are the standard for capturing audio. It might be an actual mic, or something built in to a webcam. Another option here is "Speaker Audio" so that anything you can here, so can your viewers. If you click "+ ADD SOURCE" you can have multiple audio sources here - like both a mic AND your speakers.

There's also a Mixer icon once you start streaming if you need to adjust this.


Then, to stream away, just click "GO LIVE"



The Hardware Method

The other way to handle these connections is using a video capture device. (either a video card, or USB capture box / dongle) There are plenty of options if you're trying to capture COMPOSITE or S-VIDEO, but things get a little trickier (and expensive) as you get in to HD connectors like COMPONENT and HDMI. While big-box stores have return policies so you can try equipment before committing, I didn't find much at the HD range, or staff who knew what they were talking about.
(Actually, to be honest, I spent collectively maybe 2 hours in Staples, Future Shop and Best Buy, not being approached by a single employee, and none of the stores were busy)

Streaming Video Capture

If you plan on streaming gaming consoles, then you can't just use software to grab the video. You'll need something to interface between your computer and your game-station.

Like the software method, you'll still need to actually stream the video once you've captured it. Every program that uses a webcam has a drop-down somewhere to choose which video device you want to stream. Usually it'll just list your webcam, but my digital microscope also shows up in this list, and so do some video capture cards / boxes. If your capture device appears as a webcam, then great! You can take the incoming video and stream it directly to the internet. If not, then as long as you can watch the incoming video live, WebCamMax can capture that playback window and pass it through.

Unfortunately, it doesn't seem like many manufacturers build their capture devices with streaming in mind, and most lack the technical support to help you figure out if theirs will work. Since many of the higher end cards are special order, this can get dodgy when you need to spend a bunch of money and aren't able to return it if it doesn't work. (I want to give a nod to Aver Media, who not only had great support people, they actually put me in touch with their techs to answer some questions...Which btw, sounds like some of theirs will work, but defaults to Component, and can't be changed)

Full disclosure, I didn't end up testing / using this method, but the following is the theory:

Originally, I thought we might have to spit the video out and re-capture it...



  1. Each computer has an HDMI output.
    Desktops are configured to use both video outs, sending the same signal to each.
    This allows a monitor to be connected for gaming, and a cable for video capture.
  2. Each computer connects to an HDMI switch.
    The switch takes 4 inputs and spits out 1 output.
    Using a button on the switch, you control which of the 4 computer displays it outputs.
  3. The HDMI switch connects to a video capture card on the computer.
Total cost, you're looking at about $200 for the HDMI capture device, $50-150 for the switch and another $50-100 in cables = $300 - 450.


VARIABLES:

  • Capturing game play from less than 4 computers.
    • If you only have a couple computers, you might be able to save some money on your switch.
  • Capturing game play from 1 computer.
    • Skip all this - you can just use WebCamMax to capture the video full screen.
    • If you must output the video for some reason, basically just skip the switch.
  • Capturing game play from more computers.
    • If you have more than 4 computers, you'll need either a larger switch or multiple switches chained together. (One big switch is the cleanest way, but gets very expensive.)
  • Capturing a Game System
    • You only have 1 thing to capture, so you can skip the switch.
  • Different video formats
    • What gets complicated is if you don't have 1 common video signal... Between Composite, S-Video, Component, HDMI, VGA and DVI, things can get ugly...
    • You can find adapters / converters for just about any which-way you want. A box, especially a powered one, will always be more reliable than a simple cable with 2 different ends.
    • Converting from low-quality (Composite / S-VIDEO) to high-quality (Component / HDMI) has a better chance of working than trying to squish high-quality down to low-quality.
    • When converting to digital (DVI / HDMI) you may have to watch your resolution. (720p / 1080p)
    • Each converter will probably lower the overall quality a little bit, and too many converters might not work at all.


No comments:

Post a Comment