Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm interested in using a Raspberry Pi and some webcam to stream video to the web.

First, I would need to know how to setup the webcam.
Second I would like to know if it is possible to push a stream to some service like Ustream.

UPDATE: Can I just plug in any modern USB webcam? Or do I need to install some driver?
Is there a Ustream client that will run on the RPi, or any other similar client that will push live stream to them web?

share|improve this question
This question is quite vague. Have you tried anything so far? – Jivings Jan 29 '13 at 19:19
up vote 5 down vote accepted

To stream to services like UStream you can use ffmpeg:

ffmpeg -f video4linux2 -i /dev/video0 -qscale 1 -r 25 -vcodec libx264 -b 636k -aspect 4:3 -s 640x480 -ar 44100 -ab 64k -async 1 -g 6 -threads 2 -f flv  "${RTMP_URL}/${KEY} flashver=FME/2.5\20(compatible;\20FMSc\201.0)"


  • /dev/video0: where your webcam is connected on Linux
  • RTMP_URL: Ustream channel RTMP server URL to publis
  • KEY: Your Ustream channel KEY

(You can find RTMP_URL and KEY on Ustream Dashboard->Your channelname->Remote section)

Also, I could stream my webcam to my Wowza Media Server (over RTMP) with this:

ffmpeg -re -i /dev/video -qscale 1 -r 25 -vcodec libx264 -vpre fastfirstpass -b 636k -aspect 4:3 -s 640x480 -ar 44100 -ab 64k -async 1 -g 6 -f mp4 -threads 2 rtmp://
share|improve this answer

There is lots of hardware confirmed to work with RPI, so in simple terms - many or even most of USB web cameras will work with RPI.

On the streaming side of things - check out motion. Here is a good example of setup.

share|improve this answer

I believe ustream uses flash. Also, adobe flash media encoder is out of the question since it doesn't work on any OS other than mac/windows.

share|improve this answer
Makes sense. So what other option is there to push out a video stream? – Ron Harlev Jan 31 '13 at 21:19

Using VLC you can send a stream and play it within the network. I haven't tried doing this from another network but somehow there should be a way. If not directily from VLC, then via a website.

Using this code in HTML you can create a website with the stream:

<OBJECT classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"
            width="640" height="360" id="vlc" events="True">
            <param name="Src" value="rtsp://cameraipaddress" />
            <param name="ShowDisplay" value="True" />
            <param name="AutoLoop" value="False" />
            <param name="AutoPlay" value="True" />
            <embed id="vlcEmb"  type="application/x-google-vlc-plugin" version="VideoLAN.VLCPlugin.2" autoplay="yes" loop="no" width="640" height="360"
            target="rtsp://***.***.***.***:8554/" controls="false"></embed>
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.