I have connected Logitech C170 webcam to one of the USB port of raspi and I can confirm it is working using the motion utility.

I have also installed gstreamer (sudo apt-get install -y gstreamer1.0-tools) and I'm able to test it using gst-launch-1.0 videotestsrc ! ximagesink.

However, when I try to get video input from webcam (gst-launch-1.0 v4l2src device=/dev/video0 ! ximagesink), it runs in to cryptic errors difficult to understand.

Has anyone been able to use webcam with gstreamer on raspberry pi? Please help / share your pipeline / other setup.


See if adding a decodebin into your pipeline helps, it does some automatic 'magic' and works out a lot of the pipeline for you by matching input and outputs. This doesn't help if you want to do more interesting things or have much control but should get an image on the screen.

its from the gstreamer base plugins so you may have to

sudo apt-get install gstreamer1.0-plugins-base` 

to install the package (on raspbian) if

gst-inspect-1.0 | grep decodebin

doesn't return anything.

Then use the following pipeline

gst-launch-1.0 v4l2src device=/dev/video0 ! decodebin ! ximagesink

The pipeline error messages are frustratingly vague!

To get more info on your camera you can use v4l2-ctl -d /dev/video0 to see what v4l2 thinks your camera can output, might help you piece together more of the pipe. This post suggests all the utils are already in Raspbian but if not you should be able to grab the sudo apt-get install v4l-utils package (again, raspbian) to get v4l-ctl



gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! ximagesink
  • 2
    Could you add an explanation of the command to expand upon your answer a bit? – Greenonline May 18 at 6:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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