17

When executing:

adb -s localhost:4444 shell screenrecord /sdcard/dcim/rec.mp4

I get:

ERROR: unable to create video/avc codec instance
WARNING: failed at 280x280, retrying at 1280x720
ERROR: unable to create video/avc codec instance

Is it possible to record the screen on Android Wear?

powder366
  • 4,351
  • 7
  • 47
  • 79

3 Answers3

32

On the LG G Watch, here are some commands you can use to capture a video of the display on a watch with 280x280 display and MPlayer:

adb shell screenrecord --time-limit 30 --o raw-frames --verbose /sdcard/test.raw
adb pull /sdcard/test.raw myfile.raw
mplayer -demuxer rawvideo -rawvideo w=280:h=280:format=rgb24 myfile.raw

For a 320x320 watch with FFMPEG you can use this:

adb shell screenrecord --size 320x320 --o raw-frames /sdcard/test.raw
adb pull /sdcard/test.raw
ffmpeg -f rawvideo -vcodec rawvideo -s 320x320 -pix_fmt rgb24 -r 60 -i test.raw  -an -c:v libx264 -filter:v -vf "format=fps=60,yuv420p" test.mp4

(Edited July 2015) This command should work on all Android Wear devices now http://www.tinmith.net/wayne/blog/2014/08/android-wear-screenrecord.htm

Wayne Piekarski
  • 3,203
  • 18
  • 19
  • I found vooya to play the LG Wear video on Mac http://www.offminor.de/ Are there better options? – powder366 Aug 26 '14 at 15:25
  • 7
    Using the latest ffmpeg I couldn't get `-vf "format=fps=60,yuv420p"` to work, so used this instead `ffmpeg.exe -f rawvideo -vcodec rawvideo -s 320x320 -pix_fmt rgb24 -r 10 -i test.raw -an -c:v libx264 -pix_fmt yuv420p test.mp4` Note too that I used `-r 10` to get a slower, and more reasonable, video speed – SoftWyer Nov 08 '14 at 17:50
  • 1
    You can also record from the Emualtor with the same procedure, you just need to set the "Use host GPU" option in the AVD settings. – bonnyz Jan 12 '15 at 16:41
  • 1
    I tried doing this from the emulator and for some reason all the videos come out with really weird frame rates no matter what -r value I use? Is this just a typical issues of recording raw video from the emulator or just doing it in general? – Peter Fox Jan 28 '15 at 00:41
  • `adb shell screenrecord` and `adb pull` works fine, but what about `mplayer` & `ffmpeg` commands? do I need to install anything else? Please suggest. – krishna5688 Aug 11 '15 at 05:22
4

On LG G Watch 5.0.1 I use for record:

adb shell screenrecord --time-limit 30 --o raw-frames --verbose /sdcard/test.raw

For pull the video recorded:

adb pull /sdcard/test.raw

And finally convert to mp4 video with ffmpeg 2.5.3:

ffmpeg -f rawvideo -pix_fmt rgb24 -s:v 280x280 -r 25 -i test.raw -c:v libx264 output.mp4
olidroide
  • 113
  • 6
1

set r=9 is better

ffmpeg -f rawvideo -pix_fmt rgb24 -s:v 280x280 -r 9 -i test.raw -c:v libx264 output.mp4 -y
BuffK
  • 1,189
  • 14
  • 17