Token导航 LogoToken导航TokenDH.com
待分类执行命令github未标认证来源可访问clear审计提醒

extract-moves-from-video从视频中提取动作

Agent Skill

用于辅助视频生成、动画合成、脚本化剪辑或 Remotion 等视频项目开发。它适合让 Agent 组织镜头、生成素材说明、维护合成代码或排查渲染问题。使用时需要确认分辨率、时长、素材路径和导出格式;涉及外部素材、人物肖像或商业发布时,应先核对版权授权和内容审核要求。

总安装

838

周安装

36

GitHub Stars

93

下载量

294
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:extract-moves-from-video(从视频中提取动作)
来源仓库:https://github.com/letta-ai/skills
仓库路径:skills/extract-moves-from-video
安装命令:
npx skills add https://github.com/letta-ai/skills --skill extract-moves-from-video
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/letta-ai/skills --skill extract-moves-from-video

简介

用于从屏幕录像或游戏视频中识别并转录可见文本输入指令。

  • 适合自动化脚本生成、终端命令回放或文本冒险游戏支持。
  • 使用时需指定提示符特征(如 >)以区分命令与输出。
  • 输出为按时间排序的命令序列,可用于后续模拟执行。
  • extract-moves-from-video 属于待分类类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Extract Moves From Video

Overview

This skill provides a systematic approach for extracting text commands from video recordings. Common use cases include extracting gameplay commands from text adventure games (like Zork), capturing terminal commands from screen recordings, or transcribing any typed input visible in video content.

Workflow

Step 1: Analyze the Source Video

Before processing, understand the video characteristics:

  1. Determine video properties: Resolution, duration, frame rate
  2. Identify text regions: Where commands appear on screen (e.g., after a prompt character like >)
  3. Assess text style: Font type, color, background contrast (terminal text on dark backgrounds requires specific handling)
  4. Check for audio: Determine if audio transcription could supplement OCR (verify audio contains relevant content before installing large packages like Whisper)
  5. Understand typing patterns: Estimate how frequently new commands appear to inform frame sampling rate

Step 2: Download and Prepare Video

  1. Download video using appropriate tools (yt-dlp, youtube-dl, or direct download)
  2. Verify download integrity before proceeding
  3. Extract video metadata to confirm properties match expectations

Step 3: Extract Frames Strategically

Frame extraction requires balancing coverage against processing time:

  1. Analyze command frequency first: Manually review a sample of the video to understand how often new commands appear
  2. Choose appropriate sampling rate:

- Fast typing: 0.5-1 second intervals - Slow typing: 2-3 second intervals - When uncertain, extract at higher frequency and subsample later (avoids re-extraction)

  1. Use FFmpeg for extraction: ffmpeg -i video.mp4 -vf "fps=1" frames/frame_%04d.png
  2. Focus on relevant screen regions: If commands appear in a specific area, crop frames to that region to improve OCR accuracy

Step 4: Optimize OCR Configuration

OCR accuracy depends heavily on proper configuration for the specific video type:

  1. Test on sample frames first: Before processing all frames, tune OCR settings on 5-10 representative frames
  2. Configure Tesseract page segmentation mode (--psm):

- --psm 6: Assume uniform block of text - --psm 7: Single text line - --psm 13: Raw line (treat as single line, no analysis)

  1. Preprocess images for better OCR:

- Binarization: Convert to black/white with appropriate threshold - Invert colors if text is light on dark background - Increase contrast for low-contrast videos - Scale up small text (2x-3x enlargement often helps)

  1. Test multiple threshold values: Common values (127, 150, 180) work differently depending on video; empirically test which produces best results

Example preprocessing with Python/OpenCV:

import cv2
img = cv2.imread('frame.png', cv2.IMREAD_GRAYSCALE)
# Invert if light text on dark background
img = cv2.bitwise_not(img)
# Binarize with tested threshold
_, img = cv2.threshold(img, 150, 255, cv2.THRESH_BINARY)
# Scale up for better OCR
img = cv2.resize(img, None, fx=2, fy=2, interpolation=cv2.INTER_CUBIC)

Step 5: Extract and Parse Commands

  1. Run OCR on preprocessed frames: Use Python bindings (pytesseract) for efficiency over subprocess calls
  2. Identify command patterns: Look for prompt markers (e.g., >, $, >>>) that precede commands
  3. Handle OCR output carefully:

- Do not assume commands start at line beginning (OCR introduces whitespace) - Account for partial prompt character recognition (e.g., > may become or »)

  1. Use flexible pattern matching: # More robust than grep "^>" import re command_pattern = re.compile(r'[>›»]\s*(.+)')

Step 6: Clean and Deduplicate Results

Critical: Understand the data domain before cleaning:

  1. Preserve legitimate duplicates: In many contexts (games, shell sessions), the same command can appear multiple times intentionally
  2. Use temporal deduplication: Only remove duplicates from consecutive frames showing the same command, not all duplicates globally
  3. Handle partial commands: Commands being typed appear partially; only capture complete commands
  4. Validate corrections: When fixing OCR errors, verify corrections are contextually appropriate

Temporal deduplication approach:

def temporal_dedupe(commands):
    """Remove only consecutive duplicates, preserving repeated commands."""
    result = []
    prev = None
    for cmd in commands:
        if cmd != prev:
            result.append(cmd)
            prev = cmd
    return result

Step 7: Verify Results

Verification is essential for accuracy:

  1. Sample verification: Manually compare extracted commands against source frames for a random sample
  2. Domain validation: If extracting game commands, verify they are valid commands for that game
  3. Sequence logic check: Verify the command sequence makes logical sense (e.g., movement commands follow plausible paths)
  4. Count verification: Compare total extracted commands against expected count based on video length and typing speed

Common Pitfalls

OCR Quality Issues

  • Mistake: Using default OCR settings without optimization
  • Solution: Always tune --psm mode and image preprocessing on sample frames first

Incorrect Deduplication

  • Mistake: Using global deduplication (e.g., awk '!seen[$0]++') which removes all repeated commands
  • Solution: Use temporal deduplication that only removes consecutive duplicates

Prompt Detection Failures

  • Mistake: Using rigid patterns like grep "^>" that assume specific formatting
  • Solution: Use flexible regex that accounts for OCR variations and whitespace

Wasted Tool Installation

  • Mistake: Installing large packages (Whisper for audio) without verifying they're needed
  • Solution: Check if audio contains useful content before installing audio processing tools

No Intermediate Checkpointing

  • Mistake: Processing all frames without saving intermediate results, losing progress on timeouts
  • Solution: Save results after each processing stage; implement progress checkpoints

Abandoned Verification

  • Mistake: Not validating extracted commands against source material
  • Solution: Always verify a sample of extractions and validate overall sequence logic

Verification Checklist

Before finalizing extracted commands:

  • Sample of extracted commands verified against source frames
  • Command count is reasonable for video duration
  • No obvious OCR artifacts remain (random characters, split words)
  • Legitimate repeated commands are preserved (not incorrectly deduplicated)
  • Command sequence follows logical order
  • Domain-specific validation performed (e.g., commands are valid for the game/application)

Tool Selection Guide

TaskRecommended ToolNotes
Video downloadyt-dlpMore maintained than youtube-dl
Frame extractionffmpegIndustry standard, reliable
OCRtesseract via pytesseractUse Python bindings for efficiency
Image preprocessingOpenCV (cv2)Flexible, well-documented
Pattern matchingPython re moduleMore flexible than grep

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

26.62%
按下载量换算78

Gemini CLI

22.91%
按下载量换算67

Codex

20.12%
按下载量换算59

Antigravity

13.37%
按下载量换算39

OpenCode

7.33%
按下载量换算22

windsurf

3.35%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/letta-ai/skills --skill extract-moves-from-video;npx skills add letta-ai/skills --skill "extract-moves-from-video" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills