0
votes

I used the script from source. What it does is that it reads the frame-buffer information from the mobile (android) phone and save it as a .raw file. It then uses ffmpeg encoder to create .png file. Unfortunately the png image that I am getting is like (attached below). I tried to play with the "-pix_fmt" option used and tried using rgba instead of rgb32 used in that code (none of them work btw). I used another script (ascreenshooter.py) to analyse the header for this raw image to find few image headers. they are listed as:

version: 1
bpp: 32
size: 2088960
width: 544
height: 960
red_offset: 0
red_length: 8
blue_offset: 16
blue_length: 8
green_offset: 8
green_length: 8
alpha_offset: 0
alpha_length: 8

Please suggest if it is possible to encode this .raw image file to png format. If it is possible than what ffmpeg options I should use and if some other more efficient tool does exit for this encoding process.

Sample raw image as requested:

http://tabak.csc.ncsu.edu/arpit.raw

enter image description here

2
Can you provide a sample raw input file? - llogan
Hi @LordNeckbeard, I have provided the .raw image also. Please let me know where I am going wrong. Thanks. - Glex

2 Answers

0
votes

Do you know which image acquisition facility the script ends up actually using? If it uses screencap - then you could just use screencap -p filename.png to save the image directly to .png file and not have to convert it later on.

0
votes
cd /mnt
adb pull /dev/graphics/fb0 fb0
#LOAD RAW

ffmpeg   -vcodec rawvideo   -f rawvideo   -pix_fmt rgb32   -s 1024x768   -i ./fb0     -f image2   -vcodec png screendump.png

##### 768x1024 PORTRAIT, 1024x768 LANDSCAPE