avee137
avee137

Reputation: 541

adb - how to capture screen in jpeg format?

How can I capture the screen in .jpg/.jpeg format using 'screencap'?

adb shell screencap -p /sdcard/screencap.jpg

This does not work. I thought changing the extension would help. But it always captures .png. File size in that case is larger than I need.

Upvotes: 1

Views: 7487

Answers (2)

Devstr
Devstr

Reputation: 4641

screencap does not support JPEG as output format, see screencap source code.

You need to do the conversion yourself after you pull the file from the device. This can be done with imagemagick convert command, for example:

adb shell screencap -p /sdcard/screencap.png
adb pull /sdcard/screencap.png screencap.png
convert screencap.png screencap.jpg

If the file size is still too big, you can resize it:

convert screencap.png -resize 50% screencap.jpg

Upvotes: 6

user5636914
user5636914

Reputation:

adb shell screencap -j /sdcard/screen.jpg

Upvotes: -2

Related Questions