Outils pour utilisateurs

Outils du site


issue90:diffuser_avec_webcamstudio

Ceci est une ancienne révision du document !


There are several applications out there in Linux land which will let you stream/broadcast your desktop, windows, games, etc. Webcam Studio is different in that it will, like the others, let you stream, but it has the added bonus of letting you mix many different inputs into one single output. You could, for example, have a window input (let’s say, a game), an input from your webcam (you), the audio from your game, the audio from your microphone, and an input which will overlay text on the screen. Webcam studio will let you input all that, arrange it as you like (in a preview), then output it to whichever broadcast service you like (Twitch, YouTube, Google Hangouts, etc.) using the WSVideoDevice (aka: fake/virtual webcam).

How It’s Done

When you start WebcamStudio (WCS from here on in), you have a clean slate to work from (right).

Along the top are buttons to let you load/save studios and choose a master output from FFmpeg, AVConv, and GStreamer. The last button is to clean up used RAM. I’m told by the creator, Karl Ellis, that it’s best to use GStreamer so that’s what I’ve set my WCS to use as output, but feel free to try the others as maybe they’ll perform better for you.

The left column is the preview window with two tabs below it: Channels and Mixer. I’ve not used the Channels tab much myself, but it will come in handy if you want to automate your broadcast a bit by having playlists and such like. Mixer I’ll get to later.

The middle of the WCS window is the Sources. It’s here you’ll add your inputs using the buttons just above that middle column. You can choose from: media, media folders, DVB-T, URL stream, IPCam, DVCam, Desktop, Text, and Audio. This article will really focus only on the Desktop, Text, and Audio inputs. There are also inputs for animation effects.

The right column is for output. Here you choose from: SkyCam, V4L2Loopback, Audio, Record, UDP, and WSVideoDevice. I’ll use SkyCam, Audio, and WSVideo in this tutorial, but you can easily record your output (rather than stream/broadcast it) using the Record button. Click it and choose where to save the file. Click it again to stop recording. It’s as easy as that.

Below the Output items, and once you add an input, you’ll get Properties tabs. These let you add effects and what-not to your inputs.

Starting A Studio

I’m planning to broadcast a single window with some audio and text. So, first things first, let’s add the window as an input.

Click the Desktop input: You’ll see a Desktop window appear in your Sources panel, and tabs in your Properties panel. The desktop window has a couple of options along the top (more settings, refresh, etc.) but we want to click the last icon to make sure this desktop input is using Gstreamer:

Why choose GStreamer? Well, if you don’t you can still broadcast a full desktop, or part of a desktop, but you won’t be able to select a single window which is a handy feature as – even if you move something over the chosen window – only the contents of the chosen window are shown. The GStreamer output will let you check the ‘Enable Single Window Capture’ in the Desktop tab in Properties: I’m going to choose my Home window that I’ve got open.

Before doing a test, let’s set a few things. Click the Mixer tab in the left panel and set the width and height to what you’d like to output. I’m going to choose 800 x 560. When you’ve done that you must click the Apply/Reset button.

Now click the blue PLAY button in your desktop output.

You may want to tweak the width/height in the desktop output window too, but you’ll see a preview of your final output in the top left of the WCS window. Don’t worry that your desktop output looks a bit squished up. As long as the preview looks OK, that’s the main thing.

Let’s preview this in VLC. Click the SkyCam button in the Output panel. This will ask for your password, it’s to set up a virtual webcam. Next, click the WSVideoDevice button: It may not seem like it, but you now have a virtual webcam running. To check this, load up VLC and, in the menu, go to Media > Open Capture Device. Where it says ‘Video device name’ click the drop down menu to choose the /dev/video0 and click Play.

Whatever I do inside my Home folder (scroll up/down, open a folder, etc.) will be broadcast to VLC from WCS.

Let There Be Sound

Adding sound is a similar procedure. You click the Audio input: Your audio input window will appear, but it needs tweaking like the desktop one did. Click the Audio Source icon and select your audio source: Click PLAY on the audio input and a curious thing happens. Your preview will black out. This is because the audio input (with no video) is equal with the video. You need to change the Layer setting for the desktop output to 1. It’s at the bottom of the desktop output window. Now your video is playing above the audio input. I’ve set my audio input to broadcast whatever my computer is playing, so I’m going to play an audio file and click PLAY on my audio input (above).

Voila! Video and audio from two different sources in one output. You can drag the white on black speaker icon to raise/lower the volume. The green bars will raise/lower with your audio to let you know the audio is actually being input. To save on CPU usage, you can click the X beside the PLAY button to disable the waveform from being created.

To have your audio as part of the output, don’t forget to click the ‘Audio Output’ button in the Output panel on the right.

Checking the audio (live) in VLC is a bit tricky, but check it using the Record button (in the Output panel). It will prompt you for a location and name. You can then stop the audio and play the recorded video to make sure it has recorded the audio.

What’s The Song?

Now you know that someone is going to ask what the song is that’s playing.Let’s show them the name with some overlaid text. Click the Text input:

This is a big input window which lets you enter text to display, change the X/Y coordinates of where the text should display, how big the text should be (width/height) and the font and color. Remember though, like the audio input, you’ll need to change the Layer setting to 2 this time as it needs to be above the video.

And there you have it. Three separate input sources in one virtual webcam output (right).

There’s a lot more you can do with WCS. You can apply video effects to your input; have your text flash or wobble around the screen; add animations to your output; tweak the Opacity to have things faded on top of one another. Lots, lots more. Click your input window then check the FX/GSFX tabs for effects.

Keep an eye on your layers though. If something doesn’t show initially it might need a higher Layer setting.

issue90/diffuser_avec_webcamstudio.1420209104.txt.gz · Dernière modification : 2015/01/02 15:31 de andre_domenech