wayne piekarski Recording the screen with Android Wear and screenrecord

 
Share Blog article posted August 2014

It is possible to capture the video from the display of an Android Wear device, and this blog post will show you a few tricks that you need to know to make this work for you.

Capture

On most current Android Wear devices, you can use the following command to capture video (press Control-C when you are done capturing):

    adb shell screenrecord --o raw-frames /sdcard/test.raw

If you get an error message, you may need to specify the resolution of 320x320 (most watches) or 280x280 (LG G Watch) with the --size argument:

    adb shell screenrecord --size 320x320 --o raw-frames /sdcard/test.raw

Once you have captured the video, you need to pull it over to your local machine for further processing:

    adb pull /sdcard/test.raw

Conversion

Now you need to convert the raw video frames into a video that most other video players can understand. Note that these examples assume 320x320 at 10 fps, but you will need to use 280x280 for the LG G Watch, and tweak the FPS value depending on the actual capture rate.

avconv

Available using apt-get install libav-tools on Ubuntu 14.04

    avconv -f rawvideo -vcodec rawvideo -s 320x320 -pix_fmt rgb24 -r 10 -i test.raw  -an -c:v libx264 test.mp4

ffmpeg

Available using apt-get install ffmpeg on older Ubuntu distributions, and on OSX machines. Note that some versions need different command line arguments, so try one of the following:

    ffmpeg -f rawvideo -vcodec rawvideo -s 320x320 -pix_fmt rgb24 -r 10 -i test.raw  -an -c:v libx264 -filter:v -vf "format=fps=10,yuv420p" test.mp4
    ffmpeg -f rawvideo -vcodec rawvideo -s 320x320 -pix_fmt rgb24 -r 10 -i test.raw  -an -c:v libx264 -pix_fmt yuv420p test.mp4

mplayer

    mplayer -demuxer rawvideo -rawvideo w=320:h=320:format=rgb24 test.raw

mencoder

    mencoder -demuxer rawvideo -rawvideo w=320:h=320:format=rgb24 test.raw -o test.mp4 -ovc x264

Share Blog article posted August 2014


Developer Advocate for Android and IoT


Mila the pit bull


Dylan with custom GoPro backpack


Outdoor augmented reality research
Tinmith 1998-2006


Mila and Dylan


Buddy the dog in Australia
Rest in Peace little friend (1995-2010)


Developer Advocate for Android and IoT


Mila the pit bull


Dylan with custom GoPro backpack


Outdoor augmented reality research
Tinmith 1998-2006


Mila and Dylan


Buddy the dog in Australia
Rest in Peace little friend (1995-2010)


Contact Wayne Piekarski via email wayne AT tinmith.net for more information

Last Updated 2017