Pure Data / Video / Webcam
Pure Data is a versatile tool that lets build your interface and your application.
Here, we document the GISS patch ( giss-pdp-v4l.pd or giss-pdp-v4l2.pd ) to make a video stream from a webcam or a capture card.
31/08/2008
Use it!!
Click on the "Pure Data ( Webcam v4l )" or "Pure Data ( Webcam v4l2 )" icon on the desktop :
Alternatively, you can open a terminal and type the command "/usr/local/pd/bin/start-v4l" or "/usr/local/pd/bin/start-v4l2".
You should choose one application or the other depending on the model of your webcam and if it's supported by Video 4 linux or Video 4 Linux 2.
The application should start and the first thing you see is something like this : 
You should also see a blank video window output like this :
You should set up this window on top, this is the window monitoring the stream.
The main window of the application is divided in 4 parts :
The upper part containing the sources input : one playlist for quicktime movies, one playlist for Ogg/Theora movies and a camera input module.
The second part is the mixing desk.
The third part is the stream configuration window.
The last part is the window for activating and monitoring the stream.
1. the first step is to configure your camera to start playing locally
The camera configuration window lets you configure your webcam or capture card : 
Here you have to set a few parameters for your webcam or your capture card :
Here, you should choose the video device you want to use. the default is video0 and is generally the right one.
Check the pd console to see what channels has your card. A webcam has only one channel, the channel 0 which is the default.
This parameter is only used for capture cards, not for webcams.
Now you can test your camera pressing the "start!" and the "preview" button.
Each video module has a "start!" and the "preview" button.
When you activate the preview, a second video window should appear showing you the camera input : 
The same video input should also appear in the general stream output.
2. the next step is to mix different sources to make your program
Once you see the camera input in your streaming window, you can load video clips using one of the playlists ( quicktime movies or Ogg/Theora clips ) : 
You should select a video file in the playlist and press the "start!" button so that it will appear in the streaming window.
If you activate the "preview" button, you'll also have another video window where you can monitor the clips you are playing.
If you want to play a list of clips, you should choose one of the playing modes which is one of : "loop", "random" or "continuous".
You can also adjust the speed of the player, but watch out, this can have a disatrous effect on the sound output.
If the file is playing fine, the number of frames played should increase and you should see your clip in your streaming window.
WARNING: you can play two kinds of video clips : Ogg/Theora clips but this requires a relatively good machine because the Theora decoding needs a lot of CPU power.
The other format are quicktime clips, which should be preferred, but this has some restrictions because only a few video codecs can be decoded properly.
The recommended format is quicktime clips encoded in motion jpeg ( mjpeg ).
Now that you can play some clips and that your camera is functioning, you can use the mixer module to make a mix of clips and camera : 
If your camera input is too dark, you can also use the luminosity module to correct the output : 
If all is working well, you should get a video monitoring window that looks like this : 
3. the next step is to connect and start streaming
Once you are set with you video sources, you must configure your streaming options : .
The streaming options window is composed of 3 parts. First, you must fill the server configuration options :
In this window, you have to fill the following information fields, the one noted in red are mandatory, the stream will not work if you don't fill them :
WARNING : it should be an .ogg mountpoint here, video streaming is made in Ogg/Theora format.
WARNING: Pure Data will not show you any cursor in the field boxes, just click in the box and enter your data followed by <return>.
The second window of the stream configuration is the description of your stream :
You can describe your stream with the following information fields that will appears in players meta-data , all informations here are optional :
WARNING: If you want to enter several words in one of these fields, you have to separate the words with underscore : _.
The last part of the stream configuration is the parameters for the quality of your stream :
You can set up parameters here to fine-tune the quality of your stream.
Each time you change one of these parameters, you will need to reconnect your stream to make it effective.
Every parameter has a default value that is an average quality for your stream ( video : 64kbps + audio : 32 kbps = 96kbps ) :
You can play clips of 25 frames/second but resampled to 7 frames/second which is an average value for a stream and the default value.
NOTE: The weight of your stream will be the sum of the video and of the audio bitrate. By default, it will be 64kbps + 32kbps = 96kbps.
You can use the default values for an average stream unless you want a higher quality stream, this should be tested according to your bandwidth.
Once you have set all the parameters for your stream ( the only mandatory part is the server configuration window ), you can start streaming using the connection window : 3. the next step is to check that the streaming is working
Once you have clicked in the connection window, you can check the status window.
You should see a green button and a few real time information about the stream you are emitting :
Here, you can check the state of the stream you are broadcasting, monitoring the following parameters :
Getting reconnections indicates that there is a problem of synchronization in your stream.
WARNING: When you get a big difference between your audio and your video stream time, this means that the stream is not emitted smoothly, and most probably that you have some bandwidth issues.
You should also check that your stream is not saturated looking at the VU-meter next to the connection window and try to avoid situations like this adjusting the input levels :
Optionally, you can activate the simultaneous recording of your stream at any time.
Recording is independent from streaming, you should activate it in the following window :
You have the option of recording in two formats : quicktime clip or Ogg/Theora clip, or both but don't be too demanding, this requires lots of CPU power.
WARNING: For audio synchronization issues experienced with quicktime format, the recommended format is Ogg/Theora. Tips and Tricks
Please send bugs and comments to gissnetwork at gmail dot com , thanks.
While you are entering your data, the box should look like this :
Don't forget to end up you data with "return".
Back to main page.