屏幕记录Android Wear

pow*_*366 15 android wear-os

执行时:

adb -s localhost:4444 shell screenrecord /sdcard/dcim/rec.mp4
Run Code Online (Sandbox Code Playgroud)

我明白了:

ERROR: unable to create video/avc codec instance
WARNING: failed at 280x280, retrying at 1280x720
ERROR: unable to create video/avc codec instance
Run Code Online (Sandbox Code Playgroud)

是否可以在Android Wear上录制屏幕?

Way*_*ski 30

在LG G Watch上,您可以使用以下命令捕获具有280x280显示屏和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
Run Code Online (Sandbox Code Playgroud)

对于带有FFMPEG的320x320手表,您可以使用:

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
Run Code Online (Sandbox Code Playgroud)

(2015年7月编辑)此命令现在适用于所有Android Wear设备http://www.tinmith.net/wayne/blog/2014/08/android-wear-screenrecord.htm

  • 使用最新的ffmpeg我无法得到`-vf"format = fps = 60,yuv420p"`工作,所以用这个代替`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`请注意,我使用`-r 10`来获得更慢,更合理的视频速度 (7认同)