问题
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?
回答1:
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
回答2:
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
回答3:
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
来源:https://stackoverflow.com/questions/25491528/screen-record-android-wear