android record screen and extract key frames

Record Android screen via scrcpy, dynamically set keyframe intervals with ffmpeg, then extract and list key frames as PNG images.

MIT-0 · Free to use, modify, and redistribute. No attribution required.
0 · 26 · 0 current installs · 0 all-time installs
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (record Android screen, set keyframe interval, extract key frames) align with the included scripts and README. The scripts legitimately require adb, scrcpy, ffmpeg and perform the described operations.
Instruction Scope
SKILL.md and scripts instruct only local actions: checking for tools, using scrcpy to record, using ffmpeg/ffprobe to analyze and re-encode, and listing PNGs. The scripts probe the connected device (adb devices, getprop) which is expected for this use case. There are no external network endpoints, hidden uploads, or instructions to read unrelated system files.
Install Mechanism
There is no remote code download, but scripts/install.sh performs system changes: installing packages (brew/apt), adding the user to plugdev, writing a udev rules file to /etc/udev/rules.d and reloading rules. These are expected to enable USB access to Android devices but require sudo/admin rights and will modify system configuration.
Credentials
No credentials or sensitive environment variables are requested. Only optional env vars are KEYFRAME_INTERVAL and OUTPUT_DIR which are appropriate for the task.
Persistence & Privilege
The skill does not request persistent automatic inclusion (always:false) and does not modify other skills. However, the install script requires and uses elevated privileges (sudo) to modify udev rules and groups — a necessary but privileged action to access USB devices.
Assessment
This skill appears to be what it claims: it records an Android device with scrcpy and extracts key frames with ffmpeg. Before installing/running: review scripts/install.sh because it will prompt to install packages and (on Linux) add you to plugdev and write /etc/udev/rules.d/51-android.rules (requires sudo). Only run the install script if you trust these changes; consider running the workflow manually if you prefer (install adb/scrcpy/ffmpeg via your package manager and run scripts/main.sh commands). Verify packages come from your distro's or Homebrew repositories, and back up any system udev rules if you are concerned. If you only want to run extraction against existing videos, you can skip the install and recording steps and run the extract-frames command on local files.

Like a lobster shell, security has layers — review code before you run it.

Current versionv1.0.0
Download zip
latestvk97f1j6kmk84gejcdh4dgy99c9831hdz

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

Skill: 录屏并提取关键帧

描述

这个skill用于通过scrcpy录制Android设备屏幕,然后使用ffmpeg提取关键帧。支持动态计算关键帧间隔,避免提取过多帧。

前置条件

  • Android设备已通过USB连接并启用调试模式
  • 已安装必要的工具:adb, scrcpy, ffmpeg

工具检查

运行前会自动检查以下工具是否安装:

  • adb (Android Debug Bridge)
  • scrcpy (屏幕录制工具)
  • ffmpeg (视频处理工具)

主要功能

1. 录屏

使用scrcpy录制Android设备屏幕:

scrcpy -t -r input.mp4
  • -t:显示触摸操作
  • -r:录制到文件
  • Ctrl+C停止录制并保存

2. 设置关键帧间隔

动态计算关键帧间隔,避免提取过多帧:

ffmpeg -i input.mp4 -c:v libx264 -x264opts keyint=10 output.mp4
  • keyint=10:每10帧一个关键帧(可调整)

3. 提取关键帧

提取所有关键帧为PNG图片:

ffmpeg -i output.mp4 -vf "select=eq(pict_type\,I)" -vsync vfr keyframes_%03d.png

4. 列出提取的帧

显示所有提取的关键帧图片:

ls -la keyframes_*.png

使用方式

快速开始

# 1. 检查工具
openclaw skill screen-record-frames check-tools

# 2. 开始录屏(按Ctrl+C停止)
openclaw skill screen-record-frames record

# 3. 处理视频并提取关键帧
openclaw skill screen-record-frames extract-frames

# 4. 列出提取的帧
openclaw skill screen-record-frames list-frames

完整流程

# 一次性执行完整流程
openclaw skill screen-record-frames full-process

配置选项

关键帧间隔

可以通过环境变量设置关键帧间隔:

export KEYFRAME_INTERVAL=20  # 每20帧一个关键帧
openclaw skill screen-record-frames extract-frames

输出目录

export OUTPUT_DIR=./recordings
openclaw skill screen-record-frames full-process

注意事项

  1. 确保Android设备已连接并启用USB调试
  2. 录屏过程中按Ctrl+C停止录制
  3. 关键帧数量取决于视频长度和间隔设置
  4. 提取的帧会保存为keyframes_001.png格式

故障排除

  • adb设备未找到:检查USB连接和调试模式
  • scrcpy无法启动:确保设备屏幕已解锁
  • ffmpeg处理失败:检查视频文件格式
  • 无关键帧提取:调整keyint值或检查视频编码

Files

6 total
Select a file
Select a file to preview.

Comments

Loading comments…