Skip to content
Back to skills

Compress Latest Desktop Video

ASecurity

压缩桌面最新视频 - 使用 HandBrake 快速压缩桌面上最新的视频文件,采用快速失败策略

  • 754 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added February 8, 2026
toolsbash

Works with

  • cli

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill compress-latest-desktop-video --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Compress Latest Desktop Video?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Compress Latest Desktop Video
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-compress-latest-desktop-video/badge)](https://www.skillsdirectory.com/skills/majiayu000-compress-latest-desktop-video)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: compress-latest-desktop-video
description: 压缩桌面最新视频 - 使用 HandBrake 快速压缩桌面上最新的视频文件,采用快速失败策略
---

# Compress Latest Desktop Video

快速压缩桌面上最新的视频文件,采用**快速失败(Fast-Fail)**策略。

## 核心原则

- **乐观执行** - 默认环境良好,直接执行压缩
- **快速失败** - 遇到问题立即退出,明确错误原因
- **最小预检查** - 不预先检查工具和环境,减少决策开销

## 工作流程

1. 直接查找桌面上最新的视频文件(不限制时间范围)
2. 使用 HandBrakeCLI 压缩视频(H.264, RF 22, Web 优化)
3. 压缩成功后删除源文件
4. 失败时保留源文件并显示错误

## 压缩参数

- **视频编码器**: H.264 (x264)
- **质量**: RF 22(平衡质量和文件大小)
- **输出格式**: MP4
- **Web 优化**: 已启用
- **音频**: 自动处理

## 使用方法

```
压缩桌面最新的视频
```

## 快速失败错误处理

脚本会在以下情况快速失败并退出:

- ❌ 桌面无视频文件
- ❌ HandBrakeCLI 未安装
- ❌ 压缩失败(输出文件无效)

**失败时执行**:
1. 保留源文件
2. 显示明确的错误信息
3. 提供修复建议(如 `brew install handbrake`)

## 执行效率

- **典型执行时间**: ~8秒(仅压缩时间)
- **预检查时间**: ~0秒(无预检查)
- **相比防御性检查**: 节省 3.5%+ 时间

## 脚本位置

- **优化脚本**: `scripts/compress_fast.sh`
- **原脚本**: `scripts/compress.sh`(保留作为参考)

## 安装依赖

仅在首次失败时需要:

```bash
brew install handbrake
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.