Capturing images in Android framebuffer
Thursday, January 21, 2010 2:24:14 AM
Grab the raw image from the Android frame buffer using ADB
After capturing the RAW data from the frame buffer of Android, I want to see the result in a common image format so I convert it to PNG by using FFMPEG. Currently Android is using RGB565 format.
Normally, you will get two frames (frame-1.png and frame-2.png), cuz' Android is using double buffering.
$ adb shell
# cat /dev/graphics/fb0 > /sdcard/frame.raw
# exit
After capturing the RAW data from the frame buffer of Android, I want to see the result in a common image format so I convert it to PNG by using FFMPEG. Currently Android is using RGB565 format.
$ IMAGE_RES=320x480 $ RAW_IMAGE=frame.raw $ OUT_IMAGE=frame-%d.png $ #Download the raw data $ adb pull /sdcard/$RAW_IMAGE . $ ffmpeg -vcodec rawvideo -f rawvideo -pix_fmt rgb565 -s $IMAGE_RES \
-i $RAW_IMAGE -f image2 -vcodec png $OUT_IMAGE
Normally, you will get two frames (frame-1.png and frame-2.png), cuz' Android is using double buffering.








Unregistered user # Friday, January 29, 2010 2:13:33 PM
My Linux Blogotaku_2r # Thursday, February 4, 2010 12:17:47 AM
Unregistered user # Monday, June 7, 2010 7:46:49 AM
My Linux Blogotaku_2r # Monday, July 5, 2010 10:00:13 PM
Unregistered user # Wednesday, December 15, 2010 11:46:01 PM
Unregistered user # Sunday, March 27, 2011 2:16:26 PM
Unregistered user # Tuesday, June 14, 2011 11:13:58 PM
Unregistered user # Friday, February 3, 2012 7:24:09 AM