Florian Wesch

Taking screenshots on the Raspberry PI

Posted Oct 26 2014 by Florian Wesch

Want to share something you created on your PI and could figure out the best way to create a screenshot? This small blog post will show you an easy way to create snapshots. Screenshots work both in X and in the linux console since the tool directly captures the screen using the lowlevel Dispmanx API.

Installing the tool

The screenshot tool is part of a small collection of tools written for info-beamer pi but they are perfectly usable without using info-beamer itself. Source code is available on github.

Installing should be easy. First fetch the source code using git:

pi@raspberrypi ~ $ git clone https://github.com/info-beamer/tools.git
Cloning into 'tools'...
remote: Counting objects: 36, done.
remote: Total 36 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (36/36), done.
pi@raspberrypi ~ $ 

Now you have the code available in the directory tools. Enter the directory tools/screenshot and run make.

pi@raspberrypi ~ $ cd tools/screenshot/
pi@raspberrypi ~/tools/screenshot $ make
cc -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST [...] screenshot.c -o screenshot
pi@raspberrypi ~ $ 

You can now use the program screenshot. For easier use you can also install it in /usr/local/bin so you can run it from anywhere:

pi@raspberrypi ~/tools/screenshot $ sudo make install
install -D -o root -g root -m 755 screenshot /usr/local/bin/screenshot
pi@raspberrypi ~/tools/screenshot $ 

Taking screenshots

Taking screenshots is easy. Just call the screenshot program and send its output to a file:

pi@raspberrypi ~ $ screenshot > /tmp/my-first-screenshot.jpg
pi@raspberrypi ~ $ 

Now you have the current content of the screen captured in /tmp/my-first-screenshot.jpg.


Read more...


info-beamer.com offers the most advanced digital signage platform for the Raspberry Pi. Fully hosted, programmable and easy to use. Learn more...


Get started for free!

Trying out the best digital signage solution for the Raspberry Pi is totally free: Use one device and 1GB of storage completely free of charge. No credit card required.


Follow @infobeamer on twitter to get notified of new blog posts and other related info-beamer news. It's very low traffic so just give it a try.

You can also subscribe to the RSS Feed RSS feed.


Share this post:

Share using Twitter


Questions or comments?
Get in contact!