Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

In windows I can open "My Computer" and click on the "Webcam" icon to get a feed from my webcam. I can also take snapshots of that feed.

Can I do the same in Ubuntu? Without installing any extra applications like Photobooth.

share|improve this question
2  
mplayer tv://device=/dev/video –  Stefan Oct 20 '10 at 7:13
    
@Stefan: can you? that's too simple! –  phunehehe Oct 20 '10 at 8:47
    
"Without installing any extra applications". That's a pretty weird and severe constraint. I would just install something like cheese. –  Wim Coenen Oct 20 '10 at 9:43
    
@phunene, well it works for me.... sometimes –  Stefan Oct 20 '10 at 13:40
    
@phunehehe: Yes, we can ;-) –  echox Oct 20 '10 at 17:36

1 Answer 1

up vote 4 down vote accepted

Since you want an answer "without installing any extra applications like Photobooth," I've tried to give a solution that doesn't depend on very much. Also I'm assuming that your webcam uses "Video4Linux2" and that it is /dev/video0. If this is a modern webcam and if you only have one, these are pretty good assumptions.

From the command line:

$ gst-launch-0.10 v4l2src device=/dev/video0 ! xvimagesink

Note that "v4l2src" contains a lowercase L and not the number 1. On your system the command may be gst-launch or something starting with gst-launch but with a different version number. Tab completion should help you find the exact command name. This tool is in the gstreamer0.10-tools package on my Ubuntu system, which is a dependency of libgstreamer, which is a dependency of a large number of the apps on my Ubuntu system and is likely present in the default installation.

Other Applications

If you don't mind installing other applications, here is how you can do this in a few other applications. All of them can easily be installed via apt-get or another package manager of your choosing:

  • VLC: $ vlc v4l2:///dev/video0 Also, you can do this from the VLC GUI by going to File->Open Capture Device
  • mplayer: mplayer tv://device=/dev/video01 (from Stefan in the comments)
  • Cheese: This is a photobooth-like app that is very simple to use.
share|improve this answer

Your Answer

 
discard

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.