0

I know to take a picture you type into the command line: fswebcam name.jpg. And a photo will be taken and saved to the file name.jpg.

But I want to see the picture I am taking. Like how you do it on a photo, you aim and shoot.

How can I do this on a Rasperry Pi 3B with a USB webcam?

  • 1
    For example fswebcam -|display The display tool is part of the ImageMagick (alternative: GraphicsMagick) package. You need to be more specific in your question and also, this question isn't very specific to the Raspberry Pi. – Janka Jun 04 '18 at 17:45
  • Nothing happen. It just said Writing JPEG image to '-'. What does that mean? – most venerable sir Jun 04 '18 at 18:44
  • According to the manpage, it should write the captured image to stdout. The pipe symbol | then redirects stdout into stdin of the next program in the pipeline, display, which displays the received image data. But it seems the manpage of fswebcam is wrong then. Try without the -, maybe that works as intended with your version of fswebcam. – Janka Jun 04 '18 at 18:51
  • Do you use Raspbian Stretch Lite (try https://raspberrypi.stackexchange.com/a/78119/78211 ) or a desktop environment (which one)? – Fabian Jun 04 '18 at 19:07
  • @Fabian, I use LXPanel 0.9.3 – most venerable sir Jun 05 '18 at 13:47

1 Answers1

1

You could use mplayer to watch the video stream, and press "s" to take a snapshot.

Gerard H. Pille
  • 461
  • 2
  • 5
  • how to i download a launch the mplayer? what is the command for it? – most venerable sir Jun 05 '18 at 13:48
  • "apt-get install mplayer". I do have "deb http://www.deb-multimedia.org stretch main non-free" in my /etc/apt/sources.list. That is "h t t p : / / www.deb-multimedia.org" – Gerard H. Pille Jun 05 '18 at 13:51
  • @mostvenerablesir In future please use a search engine before you ask a live human being to spend their time explaining things to you. https://www.google.ca/search?q=mplayer – goldilocks Jun 05 '18 at 13:52
  • @goldilocks never mind, I won't be a live human being much longer. – Gerard H. Pille Jun 05 '18 at 13:54
  • I did google it. But I am totally new to raspberry pi and don't even know where all these commands come from. I did "apt-get install mplayer" but it tells me "could not open lock file /var/lib/dpkg/lock...are you root?" I followed the answer https://askubuntu.com/a/432154 but still couldn't solve the problem. – most venerable sir Jun 05 '18 at 14:02
  • What is stretch main non-free? – most venerable sir Jun 05 '18 at 14:03
  • 1
    only root can add new packages to your system. You need to be "system administrator". "stretch main non-free" indicates what debian version and kind of packages I want to retrieve from deb-multimedia.org. Also, if you're that new, mplayer is not the right program for you, you should find an equivalent with a graphical interface. Perhaps the 3B can handle VLC. – Gerard H. Pille Jun 05 '18 at 14:07
  • I successfully downloaded mplayer usind sudo. But I am not seeing a live video stream. I enter command "s" nothing happened. – most venerable sir Jun 05 '18 at 14:47
  • 1
    Better have a look at a couple of these articles: https://duckduckgo.com/?q=mplayer+watch+webcam&t=ftas&ia=web and if you're not satisfied with the result, show exactly what command you tried. Just "mplayer" on its own won't do. – Gerard H. Pille Jun 05 '18 at 16:48