Broadcasting Video, from Ubuntu to Ustream, With WebcamStudio

This tutorial will explain how to stream video from Ubuntu, to Ustream, via WebcamStudio.

INSTALLING WEBCAMSTUDIO

First, you need to download and install WebcamStudio. Luckily, you can now grab it from this page at GetDeb. It’s listed as only for Intrepid, but I’m running it on Jaunty just fine. Click the download link and either: choose to open the file with GDebi, or: save it to your computer and double click it.

Ok, so now you have WebcamStudio (WCS) installed. Thing is: WCS uses Java, and when I first installed WCS it wouldn’t run as it was looking in the wrong place for Java, so try loading WCS by clicking on it’s name in Applications > Sound & Video. Did it load? If so, jump ahead to PulseAudio. If it hasn’t loaded, try this:

Check the java directory mentioned in: /usr/bin/webcamstudio. So you’ll need to:

sudo gedit /usr/bin/webcamstudio

and look for the line beginning with JAVA_DIR, mine (working correctly) is:

JAVA_DIR=/usr/lib/jvm/java-6-openjdk/bin

So, check where your Java is installed and put it’s /bin directory in the JAVA_DIR line.

Now WCS should load no problem.

INSTALLING PULSEAUDIO

PulseAudio partly installed by default in Jaunty (9.04), but we need to install the PulseAudio Manager widget. So in the package manager, search for the package named: paman. It will install the PulseAudio Manager, and a few other bits and bobs.

If you check your Applications > Sound & Video menu, you’ll see a new entry which is for PulseAudio Device Chooser. Click it to start it, and you’ll notice a new icon appearing in your tray:

pulseaudiomanager

CONFIGURING WEBCAMSTUDIO

In the Virtual Webcam tab (in WCS), you should see a PLAY button greyed out with PAUSE and STOP available.

wcs-01

If the virtual webcam is not playing, exit WCS, open a command line and try:

sudo chmod 666 /dev/video*

To make sure you are in the video group thus enabling the loopback device. So, load up WCS again and check that the virtual device is playing.

Click the STOP button in the Virtual Webcam tab and edit the FPS (I usually set it at 24, or 25) and Output Format, aka: webcam size. Your Output Device should say .video loopback’. If you’re happy with those options, click PLAY to restart the virtual webcam.

PLAYING VIDEO

This is where it is a bit hit and miss. There are problems between Java and Gstreamer (says the developer) so sometimes a video either won’t play in WCS, or it will crash WCS. But let’s give it a try.

Select the Preview tab (in WCS), and click the + icon which is on the top left hand side of the WCS window:

wcs-add

Select whatever you want to broadcast, I’ll select a video file in this example as it is the most difficult to get working, then click the small play button (on the left) to preview the file in the preview tab.

wcs-videopreview

You can, if you wish, go to Ustream and check that it can find your virtual webcam and broadcast the video but, at this stage, you’ll have no audio on the broadcast.

BROADCASTING AUDIO

This is the tricky part. We need to try and pipe the video’s audio through PulseAudio and fool the flash player (that many video sites use) in to thinking that video audio is our mic. Here’s how it’s done.

Left click the PulseAudio icon in your tray and select Configure Local Sound Server then, in the window that appears, click the Simultaneous Output tab, then check the box beside ‘Add Virtual output for simultaneous output on all local sound cards

pa-configlocalss

pa-prefs

Next, left click the PulseAudio (PA) icon, again, and choose Volume Control. If you’ve previously previewed a video in WCS you’ll see WebcamStudio mentioned in the Volume Control window, if not, try playing something in WCS. You should see the volume bars flicker with the video sound.

pa-wcsaudio

Right click on WCS name (in the Volume Control window) and tick the Move Stream > Simultaneous Output option.

pa-sim-output

NOTE: The Recording tab is blank at the moment, that’s ok.

Time for the big test! Go to Ustream, login and click BROADCAST NOW. In the Volume Control’s Recording tab, you should see an ALSA plug-in, which wasn’t there before:

pa-recording

You should see your video playing (prior to going live) in the Ustream window, with the VU meter flickering if you have audio. If all looks good in the broadcast window, click START BROADCAST!

wcspaustream

Here I am, broadcasting a video file on Ustream.

WebcamStudio is quite a powerful little app, you can use it to alter the sound, add titles to the video, even have scrolling text and what-not! The yellow text on my example (above) is added using the text option in Ustream.

Share and Enjoy:
  • Digg
  • Facebook
  • Google Bookmarks
  • email
  • Fark
  • Print
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis
  1. #1 by Anon at September 7th, 2009

    Hey OP. Thanks very much for this. I couldn’t figure out why livestream wouldn’t see my virtual camera. But after reading this I discovered that it was because my webcamstudio was not seeing my videoloopback. So I just reinstalled it, and it works great now. My only problem now is the really awful framerate for streaming a game. Even though my computer should be able to do much more.

  2. #2 by Ronnie at September 7th, 2009

    yeah, the frame-rate produced is pretty choppy. I tried broadcasting a video file over Ustream and a friend said that it was only JUST watchable and no more… :( Here’s hoping that future versions are less choppy. And more stable, sometimes when I minimised/maximised the app it would crash, which is a tad inconvenient in the middle of something…

  3. #3 by Tincho at June 4th, 2010

    Hi Ronnie!. Ive installed everything following this steps, but in the “Virtual webcam” tag, it doesnt detect any “output device”.
    What can be wrong? Thanks a lot!

(will not be published)