Project

General

Profile

Screenshots » History » Revision 7

Revision 6 (dl lud, 08/20/2019 06:50 PM) → Revision 7/17 (doak complex, 01/23/2020 08:18 PM)

h1. Screenshots 

 On Android, it is usually possible to take a screenshot by pressing the _Volume Down_ Volume Down and _Power_ Power buttons. A shortcut can also be added to the menu that pops up when long-pressing the _Power_ Power button. These options only work on _Replicant_ Replicant when [[Graphics|llvmpipe is enabled as renderer]] for _SurfaceFlinger_ (the screen compositor). Be aware that there are issues with other apps like _Gallery_. renderer]]. Furthermore, there doesn't seem to exist an app in _F-Droid_ F-Droid that makes it possible to take screenshots on _Replicant_ Replicant when _llvmpipe_ llvmpipe is not enabled. 

 Regardless of which graphics renderer is enabled, it is possible to take screenshots when the device is connected to a PC with a USB cable. The following steps explain the procedure. 

 h2. Preparations 

 Make sure [[ADB]] is running as root. 

 Download this script: "screencap.sh":https://git.replicant.us/replicant/user-scripts/plain/screencap/screencap.sh 

 You need to have _ffmpeg_ ffmpeg installed. If _ffmpeg_ ffmpeg is not available on your _GNU/Linux_ GNU/Linux system but _avconv_ avconv is (e.g. as part of _libav-tools_), libav-tools), you will have to change the line 
 <pre> 
 FFMEG="ffmpeg" 
 </pre> 

 to 
 to 

 <pre> 
 FFMEG="avconv" 
 </pre> 

 at the beginning of the script. 

 h2. Taking a screenshot 

 Run the script to take a screenshot: 
 <pre> 
 ./screencap.sh -f OUTPUT.PNG 
 </pre> 

 @OUTPUT:PNG@ is the filename of the screenshot. The screenshot will be saved with this filename in the directory you are running the script in. The script only supports the PNG format for screenshots. 

 The display size in pixels is autodetected. If you want the script to take less time for a screenshot, you can add the screen size as another option, e.g.: 
 <pre> 
 ./screencap.sh -s 720x1280 -f OUTPUT.PNG 
 </pre> 

 h3. In recovery mode 

 It is possible to take screenshots in recovery mode with the script by running: 
 <pre> 
 ./screencap.sh -r -s SCREENSIZE -f OUTPUT.PNG 
 </pre> 

 As screen size detection does not work in recovery mode, the screen size needs to be specified.