← Back to Skills Marketplace
mimose101

小米触屏闹钟视频制作

by mimose101 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
133
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install xiaomi-touchscreen-alarm-clock-video-production
Description
B站视频下载裁剪压缩工具。下载bilibili视频、裁剪去除边框、压缩到指定大小时使用。支持b23.tv短链和BV号。别名:闹钟视频下载。
README (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

Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install xiaomi-touchscreen-alarm-clock-video-production
  3. After installation, invoke the skill by name or use /xiaomi-touchscreen-alarm-clock-video-production
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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)
Metadata
Slug xiaomi-touchscreen-alarm-clock-video-production
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 小米触屏闹钟视频制作?

B站视频下载裁剪压缩工具。下载bilibili视频、裁剪去除边框、压缩到指定大小时使用。支持b23.tv短链和BV号。别名:闹钟视频下载。 It is an AI Agent Skill for Claude Code / OpenClaw, with 133 downloads so far.

How do I install 小米触屏闹钟视频制作?

Run "/install xiaomi-touchscreen-alarm-clock-video-production" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 小米触屏闹钟视频制作 free?

Yes, 小米触屏闹钟视频制作 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does 小米触屏闹钟视频制作 support?

小米触屏闹钟视频制作 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 小米触屏闹钟视频制作?

It is built and maintained by mimose101 (@mimose101); the current version is v1.0.0.

💬 Comments