Post Reply

[TOOL][WIN]Take screenshots of Aroma and Recovery v1.1

OP makers_mark

29th January 2014, 05:38 PM   |  #1  
makers_mark's Avatar
OP Member
Flag Kings Mountain
Thanks Meter: 146
 
98 posts
Join Date:Joined: Sep 2013
More
This is a tool to capture screenshots while in Recovery or the Aroma Installer.

Support has ended, due to the possibility of pixel formats changing from each recovery update you receive.
But I did make a better Recovery Screenshot that handles this problem, and it can be found here or below.
http://forum.xda-developers.com/show...php?p=50029759


It's no big secret around XDA that you can use the program FFmpeg to convert your raw framebuffer file into a normal image file. I've found the values for the Nexus 5 and made a batch script that incorporates the programs adb, and ffmpeg; to save screenshots to your computer. I don't have a Nexus 5, but thanks to an XDA user, @ikslawlok, who posted his raw framebuffer from TWRP 2.6.3.4 on another website, I was able to get it working. Also thanks to @rootSU for testing in Philz, a CWM based recovery. This should work on all versions of Windows. I have only tested in Windows 7 personally. The process, as far as using ffmpeg and adb, used here is also possible in Linux. Some versions of ffmpeg for Linux are antiquated, hence there isn't really a write one script; work for all.

Why would anyone use this or do this?

Most people, that probably includes you reading this, have actually no use for it, nor can you think of a reason too. The uses of this are limited to people that write tutorials, custom recovery themes, and the rare event that you have an anomaly in your recovery and you can't describe it.

I owe a big thanks to @Whiskey103 with his work in this thread over in the HTC One forum.

You have to have the adb drivers installed before you can do anything. Go here for more information.

This rar file contains the programs adb and ffmpeg. This 32-bit version of ffmpeg is one of the newest versions available on their downloads page. You must have adb.exe, ffmpeg.exe, and the two dll files for adb in the same directory as the batch file. The easiest thing to do is just extract the rar to a new directory, then run the file named "RUNrsn511.bat" The screenshots you capture will be saved in the same folder that you unzipped everything in as 'timestamp'.png

Thank you @weihan1102 for helping me test and providing your framebuffer from the modified version of TWRP for multirom!

Download Recovery Screenshot v1.1

If you have already downloaded the original version, and wish to update with support for the modified twrp for multirom without downloading the whole new rar, then hit the button below.
The only difference is the RUNrs.bat batch script. You may wish to just download the new batch file here, it is only 1.7KB zipped. It is RUNrsn511.rar and can just be unzipped into the folder you originally unzipped the other files into. I would then delete the original batch file.

An easier way, I think, is to click show content below and click anywhere in the box. Hit Ctrl+A to select everything, hit Ctrl+C to copy it to the clipboard. Then right click on your original RUNrs.bat file, and select edit. Click in that screen anywhere, hit Ctrl+A to select everything in there, then Ctrl+V to paste the new batch script into RUNrs.bat.

Code:
@ECHO OFF
CLS
TITLE Recovery Screenshot v1.1
MODE CON:COLS=54 LINES=40
COLOR 0B
SET TS=0
SET "ffshowb=-hide_banner"
SET "ffdebug=-loglevel fatal"
IF "%~1"=="-d" (
	REM @ECHO ON
	SET "ffdebug=-loglevel debug"
	SET "ffshowb=%"
	MODE CON:COLS=140 LINES=250
	COLOR 07
	ECHO __________________________________________________________________
	ECHO DEBUG INFO
	ECHO __________________________________________________________________
	)
:START
ECHO[
ECHO ______________________________________________________
ECHO   This will pull a screenshot from your Nexus 5 and
ECHO    save it to the directory that you ran this bat
ECHO   file in. Connect USB ^& reboot into your recovery.
ECHO ______________________________________________________
ECHO         Thanks to Whiskey103 for the idea!!
ECHO               Written by makers_mark
ECHO ______________________________________________________
IF NOT EXIST ffmpeg.exe GOTO NOFILES
IF NOT EXIST adb.exe GOTO NOFILES
ADB kill-server -d >nul 2>&1
IF %TS%=="NOGOOD" GOTO SKIPPEDthatPause

ECHO Press 1 or 2
ECHO 1 - Save a screenshot using multirom twrp recovery
ECHO 2 - Save a screenshot using other recoveries
ECHO ______________________________________________________
CHOICE /C:12 >nul
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF %K%==1 SET "pixfmt=-pix_fmt rgb565"
IF %K%==2 SET "pixfmt=-pix_fmt rgb0"


:SKIPPEDthatPause
ECHO[
ECHO Pulling framebuffer from /dev/graphics/fb0
adb pull /dev/graphics/fb0 frmbfr >nul
IF ERRORLEVEL 1 (cls
	SET TS="NOGOOD"
	ECHO ______________________________________________________
	ECHO Adb is not properly connected.
	ECHO Try "Safely Removing" your N5 from your computer
	ECHO Then unplug your usb cable, and reinsert it.
	ECHO ______________________________________________________
	ECHO[
	ECHO[
	ECHO Press any key to try again.
	ECHO[
	ECHO[
	PAUSE >nul
	CLS
	GOTO START
	)
SET TS=%DATE:/=%_%TIME::=_%
SET TS=%TS:.=%
SET TS=%TS: =%.png
FFMPEG %ffdebug% %ffshowb% -f rawvideo -vcodec rawvideo %pixfmt% -s 1088x1920 -i frmbfr -vf crop=1080:1920:0:0 -y %TS%
IF NOT EXIST %TS% GOTO ERRNE
DEL frmbfr >nul
ECHO ______________________________________________________
ECHO   Screenshot saved as %TS% 
ECHO ______________________________________________________
ECHO Press 1 or 2
ECHO 1 - Save another screenshot
ECHO 2 - Exit
ECHO ______________________________________________________
CHOICE /C:12 >nul
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF %K%==1 GOTO SKIPPEDthatPause
IF %K%==2 GOTO FINISH

:NOFILES

CLS
ECHO The directory that you are running this script in is:
ECHO %~dp0
ECHO[
ECHO You must run this script in the same directory as
ECHO adb.exe and ffmpeg.exe. Press any key to exit 
PAUSE >nul
EXIT

:ERRNE
CLS
MODE CON:COLS=108 LINES=200
COLOR 07
FFMPEG -loglevel debug -f rawvideo -vcodec rawvideo %pixfmt% -s 1088x1920 -i frmbfr -vf crop=1080:1920:0:0 -y %TS%
ECHO ____________________________________________________________________________________________________________
ECHO There was a problem converting the framebuffer to a png file.
ECHO[ 
ECHO To capture the screen of the cmd window, hold down the alt key and press PrtSc on your keyboard.  This
ECHO will save an image of the current window in memory on your clipboard.  Then open paint or photoshop or
ECHO whatever program you use and hit ctrl+N to open a new file, then ctrl+V to paste an image.  Save it and
ECHO please message me it or post in the XDA forum thread.
ECHO[
ECHO[
ECHO If you got to this screen and are not using a Nexus 5, congratulations for successfully pulling the
ECHO framebuffer.  To figure out the resolution to use, try adding 4,8, or 16 to your native width to make it
ECHO evenly divisible by 32. Example resolution is 1080x1920..1080^/32^=33.75 ^< not right, so try 1088^/32^=34 ^< good
ECHO Only worry about width (left to right), height is stored orderly in memory.
ECHO[
ECHO To see a list of all of the pix_fmts supported by ffmpeg, run ffmpeg -pix_fmts
ECHO[
ECHO Press 1 or 2
ECHO 1 - Show available pixel formats
ECHO 2 - Exit
CHOICE /C:12
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF %K%==1 (cls
	MODE CON:COLS=52 LINES=200
	ffmpeg -hide_banner -pix_fmts
	pause
	GOTO FINISH)
IF %K%==2 GOTO FINISH


:FINISH
ADB kill-server -d
EXIT




I have more screenshots at my 2013 Nexus 7 thread.
Last edited by makers_mark; 29th May 2014 at 02:47 AM. Reason: Add link to RSv1.5
The Following 9 Users Say Thank You to makers_mark For This Useful Post: [ View ]
29th January 2014, 05:40 PM   |  #2  
makers_mark's Avatar
OP Member
Flag Kings Mountain
Thanks Meter: 146
 
98 posts
Join Date:Joined: Sep 2013
More
Batch script v1.1
Code:
@ECHO OFF
CLS
TITLE Recovery Screenshot v1.1
MODE CON:COLS=54 LINES=40
COLOR 0B
SET TS=0
SET "ffshowb=-hide_banner"
SET "ffdebug=-loglevel fatal"
IF "%~1"=="-d" (
	REM @ECHO ON
	SET "ffdebug=-loglevel debug"
	SET "ffshowb=%"
	MODE CON:COLS=140 LINES=250
	COLOR 07
	ECHO __________________________________________________________________
	ECHO DEBUG INFO
	ECHO __________________________________________________________________
	)
:START
ECHO[
ECHO ______________________________________________________
ECHO   This will pull a screenshot from your Nexus 5 and
ECHO    save it to the directory that you ran this bat
ECHO   file in. Connect USB ^& reboot into your recovery.
ECHO ______________________________________________________
ECHO         Thanks to Whiskey103 for the idea!!
ECHO               Written by makers_mark
ECHO ______________________________________________________
IF NOT EXIST ffmpeg.exe GOTO NOFILES
IF NOT EXIST adb.exe GOTO NOFILES
ADB kill-server -d >nul 2>&1
IF %TS%=="NOGOOD" GOTO SKIPPEDthatPause

ECHO Press 1 or 2
ECHO 1 - Save a screenshot using multirom twrp recovery
ECHO 2 - Save a screenshot using other recoveries
ECHO ______________________________________________________
CHOICE /C:12 >nul
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF %K%==1 SET "pixfmt=-pix_fmt rgb565"
IF %K%==2 SET "pixfmt=-pix_fmt rgb0"


:SKIPPEDthatPause
ECHO[
ECHO Pulling framebuffer from /dev/graphics/fb0
adb pull /dev/graphics/fb0 frmbfr >nul
IF ERRORLEVEL 1 (cls
	SET TS="NOGOOD"
	ECHO ______________________________________________________
	ECHO Adb is not properly connected.
	ECHO Try "Safely Removing" your N5 from your computer
	ECHO Then unplug your usb cable, and reinsert it.
	ECHO ______________________________________________________
	ECHO[
	ECHO[
	ECHO Press any key to try again.
	ECHO[
	ECHO[
	PAUSE >nul
	CLS
	GOTO START
	)
SET TS=%DATE:/=%_%TIME::=_%
SET TS=%TS:.=%
SET TS=%TS: =%.png
FFMPEG %ffdebug% %ffshowb% -f rawvideo -vcodec rawvideo %pixfmt% -s 1088x1920 -i frmbfr -vf crop=1080:1920:0:0 -y %TS%
IF NOT EXIST %TS% GOTO ERRNE
DEL frmbfr >nul
ECHO ______________________________________________________
ECHO   Screenshot saved as %TS% 
ECHO ______________________________________________________
ECHO Press 1 or 2
ECHO 1 - Save another screenshot
ECHO 2 - Exit
ECHO ______________________________________________________
CHOICE /C:12 >nul
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF %K%==1 GOTO SKIPPEDthatPause
IF %K%==2 GOTO FINISH

:NOFILES

CLS
ECHO The directory that you are running this script in is:
ECHO %~dp0
ECHO[
ECHO You must run this script in the same directory as
ECHO adb.exe and ffmpeg.exe. Press any key to exit 
PAUSE >nul
EXIT

:ERRNE
CLS
MODE CON:COLS=108 LINES=200
COLOR 07
FFMPEG -loglevel debug -f rawvideo -vcodec rawvideo %pixfmt% -s 1088x1920 -i frmbfr -vf crop=1080:1920:0:0 -y %TS%
ECHO ____________________________________________________________________________________________________________
ECHO There was a problem converting the framebuffer to a png file.
ECHO[ 
ECHO To capture the screen of the cmd window, hold down the alt key and press PrtSc on your keyboard.  This
ECHO will save an image of the current window in memory on your clipboard.  Then open paint or photoshop or
ECHO whatever program you use and hit ctrl+N to open a new file, then ctrl+V to paste an image.  Save it and
ECHO please message me it or post in the XDA forum thread.
ECHO[
ECHO[
ECHO If you got to this screen and are not using a Nexus 5, congratulations for successfully pulling the
ECHO framebuffer.  To figure out the resolution to use, try adding 4,8, or 16 to your native width to make it
ECHO evenly divisible by 32. Example resolution is 1080x1920..1080^/32^=33.75 ^< not right, so try 1088^/32^=34 ^< good
ECHO Only worry about width (left to right), height is stored orderly in memory.
ECHO[
ECHO To see a list of all of the pix_fmts supported by ffmpeg, run ffmpeg -pix_fmts
ECHO[
ECHO Press 1 or 2
ECHO 1 - Show available pixel formats
ECHO 2 - Exit
CHOICE /C:12
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF %K%==1 (cls
	MODE CON:COLS=52 LINES=200
	ffmpeg -hide_banner -pix_fmts
	pause
	GOTO FINISH)
IF %K%==2 GOTO FINISH


:FINISH
ADB kill-server -d
EXIT

Batch script v1
Code:
@ECHO OFF
CLS
TITLE Recovery Screenshot
MODE CON:COLS=54 LINES=40
COLOR 0B
SET TS=0
SET "ffshowb=-hide_banner"
SET "ffdebug=-loglevel fatal"
IF "%~1"=="-d" (
	REM @ECHO ON
	SET "ffdebug=-loglevel debug"
	SET "ffshowb=%"
	MODE CON:COLS=140 LINES=250
	COLOR 07
	ECHO __________________________________________________________________
	ECHO DEBUG INFO
	ECHO __________________________________________________________________
	)
:START
ECHO[
ECHO ______________________________________________________
ECHO   This will pull a screenshot from your Nexus 5 and
ECHO    save it to the directory that you ran this bat
ECHO   file in. Connect USB ^& reboot into your recovery.
ECHO ______________________________________________________
ECHO         Thanks to Whiskey103 for the idea!!
ECHO               Written by makers_mark
ECHO ______________________________________________________
IF NOT EXIST ffmpeg.exe GOTO NOFILES
IF NOT EXIST adb.exe GOTO NOFILES
ADB kill-server -d >nul 2>&1
IF %TS%=="NOGOOD" GOTO SKIPPEDthatPause
ECHO Press any key when you are ready.
PAUSE >nul

:SKIPPEDthatPause
ECHO[
ECHO Pulling framebuffer from /dev/graphics/fb0
adb pull /dev/graphics/fb0 frmbfr >nul
IF ERRORLEVEL 1 (cls
	SET TS="NOGOOD"
	ECHO ______________________________________________________
	ECHO Adb is not properly connected.
	ECHO Try "Safely Removing" your N5 from your computer
	ECHO Then unplug your usb cable, and reinsert it.
	ECHO ______________________________________________________
	ECHO[
	ECHO[
	ECHO Press any key to try again.
	ECHO[
	ECHO[
	PAUSE >nul
	CLS
	GOTO START
	)
SET TS=%DATE:/=%_%TIME::=_%
SET TS=%TS:.=%
SET TS=%TS: =%.png
FFMPEG %ffdebug% %ffshowb% -f rawvideo -vcodec rawvideo -pix_fmt rgb0 -s 1088x1920 -i frmbfr -vf crop=1080:1920:0:0 -y %TS%
IF NOT EXIST %TS% GOTO ERRNE
DEL frmbfr >nul
ECHO ______________________________________________________
ECHO   Screenshot saved as %TS% 
ECHO ______________________________________________________
ECHO Press 1 or 2
ECHO 1 - Save another screenshot
ECHO 2 - Exit
ECHO ______________________________________________________
CHOICE /C:12 >nul
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF %K%==1 GOTO SKIPPEDthatPause
IF %K%==2 GOTO FINISH

:NOFILES

CLS
ECHO The directory that you are running this script in is:
ECHO %~dp0
ECHO[
ECHO You must run this script in the same directory as
ECHO adb.exe and ffmpeg.exe. Press any key to exit 
PAUSE >nul
EXIT

:ERRNE
CLS
MODE CON:COLS=108 LINES=200
COLOR 07
FFMPEG -loglevel debug -f rawvideo -vcodec rawvideo -pix_fmt rgb0 -s 1088x1920 -i frmbfr -vf crop=1080:1920:0:0 -y %TS%
ECHO ____________________________________________________________________________________________________________
ECHO There was a problem converting the framebuffer to a png file.
ECHO[ 
ECHO To capture the screen of the cmd window, hold down the alt key and press PrtSc on your keyboard.  This
ECHO will save an image of the current window in memory on your clipboard.  Then open paint or photoshop or
ECHO whatever program you use and hit ctrl+N to open a new file, then ctrl+V to paste an image.  Save it and
ECHO please message me it or post in the XDA forum thread.
ECHO[
ECHO[
ECHO If you got to this screen and are not using a Nexus 5, congratulations for successfully pulling the
ECHO framebuffer.  To figure out the resolution to use, try adding 4,8,16, or 32 to your native width to make
ECHO room for the extra data, ioctrls?, at the end of each pixel row.  Experiment with different pixel formats
ECHO also.
ECHO[
ECHO To see a list of all of the pix_fmts supported by ffmpeg, run ffmpeg -pix_fmts
ECHO[
ECHO Press 1 or 2
ECHO 1 - Show available pixel formats
ECHO 2 - Exit
CHOICE /C:12
IF ERRORLEVEL 1 SET K=1
IF ERRORLEVEL 2 SET K=2
IF %K%==1 (cls
	MODE CON:COLS=52 LINES=200
	ffmpeg -hide_banner -pix_fmts
	pause
	GOTO FINISH)
IF %K%==2 GOTO FINISH


:FINISH
ADB kill-server -d
EXIT
Last edited by makers_mark; 31st January 2014 at 12:08 AM.
The Following User Says Thank You to makers_mark For This Useful Post: [ View ]
30th January 2014, 02:41 AM   |  #3  
Smart-X's Avatar
Member
Thanks Meter: 11
 
52 posts
Join Date:Joined: Dec 2012
Thumbs up
Great! It worked!
I've just test it on my Nexus5.
Thanks!
The Following 2 Users Say Thank You to Smart-X For This Useful Post: [ View ]
30th January 2014, 06:35 AM   |  #4  
weihan1102's Avatar
Senior Member
Thanks Meter: 93
 
321 posts
Join Date:Joined: May 2012
More
Thanks! but seems like the color isn't correct and it content 4 screenshot in a single png file.
Attached Thumbnails
Click image for larger version

Name:	30012014Thu_14_32_0394.png
Views:	115
Size:	65.0 KB
ID:	2548112  
Last edited by weihan1102; 30th January 2014 at 06:47 AM.
The Following User Says Thank You to weihan1102 For This Useful Post: [ View ]
30th January 2014, 11:15 AM   |  #5  
makers_mark's Avatar
OP Member
Flag Kings Mountain
Thanks Meter: 146
 
98 posts
Join Date:Joined: Sep 2013
More
Quote:
Originally Posted by weihan1102

Thanks! but seems like the color isn't correct and it content 4 screenshot in a single png file.

It looks like the multirom twrp uses a different kernel.

Can you do me a favor and substitute '-pix_fmt rgb0' with '-pix_fmt rgba' in the batch file?

To edit the batch file just right click it and choose edit. Find the lines, there's two of them, that start with ffmpeg..... and replace the part above. Save it and try again.
The Following User Says Thank You to makers_mark For This Useful Post: [ View ]
30th January 2014, 11:41 AM   |  #6  
weihan1102's Avatar
Senior Member
Thanks Meter: 93
 
321 posts
Join Date:Joined: May 2012
More
Quote:
Originally Posted by makers_mark

It looks like the multirom twrp uses a different kernel.

Can you do me a favor and substitute '-pix_fmt rgb0' with '-pix_fmt rgba' in the batch file?

To edit the batch file just right click it and choose edit. Find the lines, there's two of them, that start with ffmpeg..... and replace the part above. Save it and try again.

No, the color change but still not the correct color
Attached Thumbnails
Click image for larger version

Name:	30012014Thu_19_39_2637.png
Views:	87
Size:	84.2 KB
ID:	2548424  
The Following User Says Thank You to weihan1102 For This Useful Post: [ View ]
30th January 2014, 12:23 PM   |  #7  
makers_mark's Avatar
OP Member
Flag Kings Mountain
Thanks Meter: 146
 
98 posts
Join Date:Joined: Sep 2013
More
Quote:
Originally Posted by weihan1102

No, the color change but still not the correct color

Can you change the pix_fmt to bgra? I could figure it out later if you could upload your framebuffer file later, I won't be able to be around a computer for about 11 or 12 hours from now.

To save the framebuffer to your computer : shift + right click on the folder adb and other files are in, and select run cmd here. In the command window type 'adb pull /dev/graphics/fb0 rawfb0.raw'. The file rawfb0.raw will be in that same folder now.
30th January 2014, 01:01 PM   |  #8  
weihan1102's Avatar
Senior Member
Thanks Meter: 93
 
321 posts
Join Date:Joined: May 2012
More
Quote:
Originally Posted by makers_mark

Can you change the pix_fmt to bgra? I could figure it out later if you could upload your framebuffer file later, I won't be able to be around a computer for about 11 or 12 hours from now.

To save the framebuffer to your computer : shift + right click on the folder adb and other files are in, and select run cmd here. In the command window type 'adb pull /dev/graphics/fb0 rawfb0.raw'. The file rawfb0.raw will be in that same folder now.

bgra didn't work.

and the rawfb0.raw, here you are

https://drive.google.com/file/d/0B5F...it?usp=sharing
The Following User Says Thank You to weihan1102 For This Useful Post: [ View ]
30th January 2014, 01:11 PM   |  #9  
makers_mark's Avatar
OP Member
Flag Kings Mountain
Thanks Meter: 146
 
98 posts
Join Date:Joined: Sep 2013
More
Quote:
Originally Posted by weihan1102

bgra didn't work.

and the rawfb0.raw, here you are

https://drive.google.com/file/d/0B5F...it?usp=sharing

Thank you so much! I will fix it when I get home.

The Following User Says Thank You to makers_mark For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
ffmpeg, nexus, recovery screenshot, rgb0
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Nexus 5 Android Development by ThreadRank