$ adb shell
# cat /dev/graphics/fb0 > /sdcard/frame.raw
# exit
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
# cat /dev/graphics/fb0 > /sdcard/frame.raw
# exit
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