camshot is a very small tool for capturing images from a v4l2 compatibile camera or webcam in a linux console. It can be useful in many areas. For instance:

  • Linux powered security systems
  • Linux powered robotic systems
  • Linux powered embedded systems
  • Linux scripts
  • Testing camera and getting info about it
  • camshot now supports shared memory & semaphores for interprocess communication.

    Install Camshot:

    1. Get the source code from the download page. Or from the svn():

    svn checkout camshot-read-only

    2. Then go to the source directory and execute

    sudo make install

    Now if you don’t get an error you can start using camshot.

    Usage Examples:


    Example 1:
    Capturing 160×120 bmp images using standard input / output. The files will be in the default destination: /tmp/camshot_TIMESTAMP.bmp where TIMESTAMP is your system current timestamp.

    ~ $ camshot -W 160 -H 120 -o ./
    Letting the camera automaticaly adjust the picture:……….Done.
    Command (h for help): h

    x Capture a picture from camera.
    h Prints this help.
    q Quits the program.

    Command (h for help): x
    Command (h for help): q
    ~ $

    Example 2:
    Capturing 320×240 bmp images using named pipe. In one console execute:

    ~ $ camshot -W 320 -H 240 -p ./campipe
    Letting the camera automaticaly adjust the picture:……….Done.

    In a different console execute:

    ~ $ cat ./campipe > /tmp/tst.bmp

    And as you can see below you can find the captured image in the desired destination /tmp/tst.bmp.

    ~ $ ls /tmp/ | grep tst
    ~ $

    Once done capturing the images simply kill the camshot process:

    ^CCaught CTRL+C, camshot ending
    ~ $