← 返回 Skills 市场
mimose101

小米触屏闹钟视频制作

作者 mimose101 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
133
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install xiaomi-touchscreen-alarm-clock-video-production
功能描述
B站视频下载裁剪压缩工具。下载bilibili视频、裁剪去除边框、压缩到指定大小时使用。支持b23.tv短链和BV号。别名:闹钟视频下载。
使用说明 (SKILL.md)

闹钟视频下载

依赖

  • yt-dlp: pip install yt-dlp, 以 python -m yt_dlp 调用
  • ffmpeg/ffprobe: 需在PATH中

工作流

1. 下载720P视频

固定下载720P分辨率视频(格式ID: 30064+30280): python -m yt_dlp -f "30064+30280" -o PATH --merge-output-format mp4 URL

说明: 30064为720P视频流,30280为音频流

2. 裁剪边框

使用固定裁剪参数直接裁剪: ffmpeg -y -i IN -vf "crop=792:600:432:56" -c:v libx264 -crf 18 -c:a copy OUT

固定裁剪参数(720p): crop=792:600:432:56

3. 剪切视频(固定去除前后各10秒)

步骤1: 去除前10秒 ffmpeg -y -i IN -ss 00:00:10 -c:v libx264 -crf 18 -c:a copy TEMP

步骤2: 获取剩余视频时长 ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 TEMP

步骤3: 去除后10秒(总时长-10) ffmpeg -y -i TEMP -t (duration-10) -c:v libx264 -crf 18 -c:a copy OUT

说明: 固定去除片头10秒和片尾10秒,总时长减少20秒

4. 压缩到目标大小

目标:压缩到10MB以内

步骤1: 获取视频时长 ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 INPUT_VIDEO

步骤2: 计算动态码率 使用Python计算码率参数(以目标10MB为例):

target_MB = 10
duration = 217.345783  # 从步骤1获取的实际时长
vbr = int((target_MB * 0.9 * 8 * 1024) / duration - 64)  # 视频码率
maxrate = int(vbr * 1.5)  # 最大码率
bufsize = int(vbr * 2)    # 缓冲大小
# 示例输出: vbr=275k, maxrate=412k, bufsize=550k

计算公式:

  • 视频码率: vbr = (target_MB * 0.9 * 8 * 1024) / duration - 64
  • 最大码率: maxrate = vbr * 1.5
  • 缓冲大小: bufsize = vbr * 2

步骤3: 执行压缩 使用计算出的参数执行压缩: ffmpeg -y -i INPUT_VIDEO -c:v libx264 -b:v 275k -maxrate 412k -bufsize 550k -c:a aac -b:a 64k -ar 44100 OUTPUT_VIDEO

验证压缩结果: ffprobe -v error -show_entries format=size -of default=noprint_wrappers=1:nokey=1 OUTPUT_VIDEO

实际案例参考:

  • 输入视频: 792x600, 时长217秒, 约22.4MB
  • 压缩参数: vbr=275k, maxrate=412k, bufsize=550k
  • 输出结果: 约9.0MB, 成功压缩到10MB以内

5. 一键脚本

scripts/download_and_process.py: python scripts/download_and_process.py URL --format_id "30064+30280" --crop "792:600:432:56" --max_size_mb 10 参数: url, --format_id, --crop, --max_size_mb(10), --filename(bilibili_video), --output_dir(Documents)\r

安全使用建议
This skill appears coherent and not malicious, but check the following before installing: 1) Ensure yt-dlp (pip) and ffmpeg/ffprobe are installed and trusted, since the script depends on them but the registry metadata omitted them. 2) The script writes files by default to ~/Documents—change --output_dir if you prefer a different location. 3) The script uses subprocess.run without explicit error handling; run a test on a small file or in a sandbox to confirm behavior. 4) No secrets are requested and there are no hidden network endpoints, but only run code from sources you trust. If you want higher assurance, inspect the included Python script (it is short and readable) and run it locally rather than granting broader automated execution privileges.
功能分析
Type: OpenClaw Skill Name: xiaomi-touchscreen-alarm-clock-video-production Version: 1.0.0 The skill bundle is a legitimate utility designed to download, crop, and compress Bilibili videos for use on a Xiaomi touchscreen alarm clock. The Python script (scripts/download_and_process.py) and the instructions (SKILL.md) use standard media tools like yt-dlp and ffmpeg via subprocess calls with argument lists, which prevents shell injection. No evidence of data exfiltration, persistence, or malicious prompt injection was found.
能力评估
Purpose & Capability
The skill's name/description match the provided code and instructions: downloading via yt-dlp, cropping with ffmpeg, and compressing to a target size. Minor inconsistency: the registry metadata lists no required binaries, but SKILL.md and the script require yt-dlp (python -m yt_dlp), ffmpeg and ffprobe to be available.
Instruction Scope
SKILL.md and the script confine their actions to downloading the provided URL, running ffprobe/ffmpeg and writing output files (default: ~/Documents). The instructions do not request unrelated files, credentials, or network endpoints beyond the video URL.
Install Mechanism
No install spec is provided (instruction-only plus a single Python script). This is low-risk: nothing is downloaded automatically by an installer. The user is expected to install yt-dlp and ffmpeg themselves.
Credentials
The skill requires no environment variables or credentials. The script uses only standard filesystem and subprocess calls and does not access secrets or other services.
Persistence & Privilege
always is false and the skill does not request persistent system privileges or modify other skills/configs. It writes output files to a user-writable directory and then cleans temporary files.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install xiaomi-touchscreen-alarm-clock-video-production
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /xiaomi-touchscreen-alarm-clock-video-production 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
--- name: bilibili-video-download description: B站视频下载裁剪压缩工具。下载bilibili视频、裁剪去除边框、压缩到指定大小时使用。支持b23.tv短链和BV号。别名:闹钟视频下载。 --- # 闹钟视频下载 ## 依赖 - yt-dlp: pip install yt-dlp, 以 python -m yt_dlp 调用 - ffmpeg/ffprobe: 需在PATH中 ## 工作流 ### 1. 下载720P视频 固定下载720P分辨率视频(格式ID: 30064+30280): python -m yt_dlp -f "30064+30280" -o PATH --merge-output-format mp4 URL 说明: 30064为720P视频流,30280为音频流 ### 2. 裁剪边框 使用固定裁剪参数直接裁剪: ffmpeg -y -i IN -vf "crop=792:600:432:56" -c:v libx264 -crf 18 -c:a copy OUT 固定裁剪参数(720p): crop=792:600:432:56 ### 3. 剪切视频(固定去除前后各10秒) **步骤1: 去除前10秒** ffmpeg -y -i IN -ss 00:00:10 -c:v libx264 -crf 18 -c:a copy TEMP **步骤2: 获取剩余视频时长** ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 TEMP **步骤3: 去除后10秒(总时长-10)** ffmpeg -y -i TEMP -t (duration-10) -c:v libx264 -crf 18 -c:a copy OUT **说明:** 固定去除片头10秒和片尾10秒,总时长减少20秒 ### 4. 压缩到目标大小 **目标:压缩到10MB以内** **步骤1: 获取视频时长** ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 INPUT_VIDEO **步骤2: 计算动态码率** 使用Python计算码率参数(以目标10MB为例): ```python target_MB = 10 duration = 217.345783 # 从步骤1获取的实际时长 vbr = int((target_MB * 0.9 * 8 * 1024) / duration - 64) # 视频码率 maxrate = int(vbr * 1.5) # 最大码率 bufsize = int(vbr * 2) # 缓冲大小 # 示例输出: vbr=275k, maxrate=412k, bufsize=550k ``` 计算公式: - 视频码率: vbr = (target_MB * 0.9 * 8 * 1024) / duration - 64 - 最大码率: maxrate = vbr * 1.5 - 缓冲大小: bufsize = vbr * 2 **步骤3: 执行压缩** 使用计算出的参数执行压缩: ffmpeg -y -i INPUT_VIDEO -c:v libx264 -b:v 275k -maxrate 412k -bufsize 550k -c:a aac -b:a 64k -ar 44100 OUTPUT_VIDEO **验证压缩结果:** ffprobe -v error -show_entries format=size -of default=noprint_wrappers=1:nokey=1 OUTPUT_VIDEO **实际案例参考:** - 输入视频: 792x600, 时长217秒, 约22.4MB - 压缩参数: vbr=275k, maxrate=412k, bufsize=550k - 输出结果: 约9.0MB, 成功压缩到10MB以内 ### 5. 一键脚本 scripts/download_and_process.py: python scripts/download_and_process.py URL --format_id "30064+30280" --crop "792:600:432:56" --max_size_mb 10 参数: url, --format_id, --crop, --max_size_mb(10), --filename(bilibili_video), --output_dir(Documents)
元数据
Slug xiaomi-touchscreen-alarm-clock-video-production
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

小米触屏闹钟视频制作 是什么?

B站视频下载裁剪压缩工具。下载bilibili视频、裁剪去除边框、压缩到指定大小时使用。支持b23.tv短链和BV号。别名:闹钟视频下载。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 133 次。

如何安装 小米触屏闹钟视频制作?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install xiaomi-touchscreen-alarm-clock-video-production」即可一键安装,无需额外配置。

小米触屏闹钟视频制作 是免费的吗?

是的,小米触屏闹钟视频制作 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

小米触屏闹钟视频制作 支持哪些平台?

小米触屏闹钟视频制作 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 小米触屏闹钟视频制作?

由 mimose101(@mimose101)开发并维护,当前版本 v1.0.0。

💬 留言讨论