Communitygithub.com

David-Li0406/meta-skill-evloving

生成一个完整的 Python 脚本,用于分析视频音频(RMS)、识别高光时刻、对结果排序,并通过 ffmpeg 提取相应片段,同时提供精确的声波峰值定位(1/3、1/2、2/3)。

meta-skill-evloving 是什么?

该技能旨在帮助开发者快速生成一个功能完善的 Python 脚本,用于从视频文件中基于音频响度(RMS)自动提取高光片段。它通过计算根均方值(RMS)来量化音频音量,并识别响度最高的时刻。用户可以对识别出的时刻进行排序(如按出现顺序或音量大小),并精确控制声波峰值在提取片段中的位置(开头 1/3、中间 1/2、末尾 2/3 或随机)。脚本支持用户交互模式(逐项配置参数)和自动模式(自动计算最大片段数),并利用 ffmpeg 进行高效的视频片段提取。此技能支持包括 Claude Code、Cursor、Codex 在内的主要 AI 代理平台,适用于视频编辑、内容摘要、自动化处理等场景。其核心逻辑清晰,代码结构完整,开发者可直接使用或修改集成到自己的视频处理工作流中。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/David-Li0406/meta-skill-evloving/tree/HEAD/AutoSkill/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/extraction_video_par_intensite_audio

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

extraction_video_par_intensite_audio

生成一个完整的 Python 脚本,用于分析视频音频(RMS)、识别高光时刻、对结果排序,并通过 ffmpeg 提取相应片段,同时提供精确的声波峰值定位(1/3、1/2、2/3)。

Prompt

角色与目标

你是一位 Python 开发与视频处理专家。你的目标是生成一个完整的脚本,该脚本分析视频文件,基于音频响度最高的时刻提取片段,并在提取的片段中应用精确的声波峰值定位逻辑。

沟通与风格偏好

代码必须使用 Python 编写,清晰并带有注释。变量和函数名称应使用英语(例如:calculate_loudness, find_loudest_moments)。用户消息应使用法语。

操作规则与约束

  1. 音频分析:

    • 使用 moviepy.editor.VideoFileClip 读取视频并提取音频。
    • 使用 scipy.io.wavfile 读取音频数据。
    • 如果是立体声,则转换为单声道(np.mean(audio_data, axis=1))。
  2. 音量计算(响度):

    • 实现一个函数 calculate_loudness(audio_data),计算音频的 RMS(Root Mean Square)。
  3. 搜索高光时刻:

    • 实现一个函数 find_loudest_moments,用于识别最响亮的时刻。
    • 接受一个参数 allow_overlap。
    • 如果 allow_overlap 为真:使用 np.convolve 和一个滑动窗口来查找峰值。
    • 如果 allow_overlap 为假:将音频分成不重叠的片段并计算每个片段的平均值。
  4. 片段排序:

    • 让用户选择排序顺序: 1:按出现顺序(时间顺序)。 2:按出现顺序逆序。 3:按音量升序。 4:按音量降序。
    • 在返回列表之前,将此排序应用于高光时刻列表。
  5. 峰值定位(计算逻辑):

    • 让用户选择峰值在片段中的位置(1:开头,2:中间,3:末尾,4:随机)。
    • 根据选择,计算片段的 start_time,公式基于 peak_time 和 segment_duration:
      1. 开头:峰值位于片段的 1/3 处。start_time = peak_time - (segment_duration / 3)
      2. 中间:峰值位于中心。start_time = peak_time - (segment_duration / 2)
      3. 末尾:峰值位于片段的 2/3 处。start_time = peak_time - (2 * segment_duration / 3)
      4. 随机:从 [1/3, 1/2, 2/3] 中随机选择一个比例 r,然后 start_time = peak_time - (r * segment_duration)。
    • 边界处理:确保计算出的 start_time 不小于 0,并且片段不超过视频总时长(video_duration)。如果需要,调整 start_time 以遵守这些限制。
  6. 视频提取:

    • 使用 subprocess.run 调用 ffmpeg。
    • 必须使用以下 ffmpeg 参数:-c:v libx264、-preset medium、-crf 23、-c:a aac、-b:a 192k。
    • 输出文件命名为 {base_name}_moment{i+1}.mp4,存放于 'Output' 文件夹中。
  7. 参数处理与交互:

    • 脚本在启动时需向用户提问。二进制问题的格式必须严格为 "1-Oui 2-Non"。
    • 需要询问的参数:开始偏移(秒)、结束偏移(秒)、片段时长(秒)、声波峰值位置(1-4)、是否允许重叠(1-Oui, 2-Non)、是否自动模式(1-Oui, 2-Non)。
    • 如果选择自动模式:计算最大可能的高光时刻数量(video_duration // segment_duration)。
    • 如果选择非自动模式:询问需要提取的高光时刻数量。
    • 询问排序顺序(1-4)。

反模式

  • 不要在二进制问题中使用 "yes/no" 或 "y/n" 格式。必须使用 "1-Oui 2-Non"。
  • 不要将 float('inf') 直接用作 numpy 数组的索引。
  • 不要忘记在分析之前将立体声音频转换为单声道。
  • 处理完成后不要遗留临时文件(.wav)。
  • 不要使用未定义的计算方法(仅使用 RMS)。
  • 在计算 start_time 时不要超出视频边界(确保 start_time >= 0 且 start_time + duration <= video_duration)。

交互流程

  1. 询问用户参数(偏移、时长、峰值位置、是否重叠、是否自动模式、排序)。
  2. 遍历视频文件(.mp4、.mkv、.wmv、.avi)。
  3. 对于每个视频:提取音频、计算音量(RMS)、查找高光时刻(根据重叠参数)、排序高光时刻、根据峰值位置精确计算 start_time、提取片段。

Triggers

  • 提取视频高光时刻的脚本
  • 音频 RMS 分析或峰值
  • 基于音频提取视频片段
  • 自动 Python 视频处理脚本
  • 按音量排序视频片段
  • 分析声音强度以裁剪视频
  • 定位声波峰值
  • 视频片段提取逻辑

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

David-Li0406/meta-skill-evloving

Browser automation with persistent page state. Use when users ask to navigate websites, fill forms, take screenshots, extract web data, test web apps, or automate browser workflows. Trigger phrases include "go to [url]", "click on", "fill out the form", "take a screenshot", "scrape", "automate", "test the website", "log into", or any browser interaction request.

David-Li0406/meta-skill-evloving

Create technical diagrams using Mermaid syntax for architecture, sequences, ERDs, flowcharts, and state machines. Use for visualizing system design, data flows, and processes. Triggers: diagram, mermaid, architecture diagram, sequence diagram, flowchart, ERD, entity relationship, state diagram, C4 model, component diagram, visualize, draw.

David-Li0406/meta-skill-evloving

Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks

David-Li0406/meta-skill-evloving

Complete color manipulation and green screen effects system. PROACTIVELY activate for: (1) Green screen/chromakey removal, (2) Color grading with LUTs, (3) Color correction (levels, curves, white balance), (4) Colorkey/color removal effects, (5) Hue/saturation manipulation, (6) Color space conversions (BT.709, BT.2020, HDR), (7) Color isolation effects, (8) Teal and orange look, (9) Vintage/film looks, (10) Color keying for transparency. Provides: chromakey and colorkey filters, LUT application (lut3d), curves and levels adjustment, color balance, selective color manipulation, color space handling, HDR tone mapping, professional color grading chains.

David-Li0406/meta-skill-evloving

Convert files and office documents to Markdown. Supports PDF, DOCX, PPTX, XLSX, images (with OCR), audio (with transcription), HTML, CSV, JSON, XML, ZIP, YouTube URLs, EPubs and more.

David-Li0406/meta-skill-evloving

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

David-Li0406/meta-skill-evloving

Build with OpenAI's stateless APIs - Chat Completions (GPT-5, GPT-4o), Embeddings, Images (DALL-E 3), Audio (Whisper + TTS), and Moderation. Includes Node.js SDK and fetch-based approaches for Cloudflare Workers. Use when: implementing chat completions with GPT-5/GPT-4o, streaming responses with SSE, using function calling/tools, creating structured outputs with JSON schemas, generating embeddings for RAG (text-embedding-3-small/large), generating images with DALL-E 3, editing images with GPT-Image-1, transcribing audio with Whisper, synthesizing speech with TTS (11 voices), moderating content (11 safety categories), or troubleshooting rate limits (429), invalid API keys (401), function calling failures, streaming parse errors, embeddings dimension mismatches, or token limit exceeded.

David-Li0406/meta-skill-evloving

Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.

David-Li0406/meta-skill-evloving

Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks

David-Li0406/meta-skill-evloving

Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas

David-Li0406/meta-skill-evloving

Download YouTube videos with customizable quality and format options. Use this skill when the user asks to download, save, or grab YouTube videos. Supports various quality settings (best, 1080p, 720p, 480p, 360p), multiple formats (mp4, webm, mkv), and audio-only downloads as MP3.

David-Li0406/meta-skill-evloving

Best practices for Remotion - Video creation in React

David-Li0406/meta-skill-evloving

Provides bidirectional translation (Chinese/English), grammar checking, and sentence polishing. Supports specific tense constraints, context-aware tone adjustment, and natural expression optimization. Outputs direct text without formatting.

David-Li0406/meta-skill-evloving

指导如何通过自定义注解(如@Unicom)标识Dubbo接口,利用BeanDefinitionRegistryPostProcessor在启动时扫描并动态注册ReferenceBean,实现RPC调用的封装。

David-Li0406/meta-skill-evloving

生成Python脚本,利用FFmpeg将图片序列按3x3布局合并,或将合并图拆分。要求使用subprocess模块执行命令,并支持用户交互式输入路径。

David-Li0406/meta-skill-evloving

SOP for extracting and analyzing promotional activity details, handling time formatting, location mapping, payment logic, and step-by-step process validation.

David-Li0406/meta-skill-evloving

Specializes in creating TikTok short video scripts using an anthropomorphic 'Chef' perspective to explain wildlife food chains and survival environments, utilizing real field footage.

David-Li0406/meta-skill-evloving

针对TikTok平台,以拟人化视角(如动物作为厨师)创作系列短视频脚本。重点介绍野生动物、食物链及生态环境,要求使用野外实拍素材,风格幽默且具有教育意义。

David-Li0406/meta-skill-evloving

Generates KWL (Know, Want to know, Learned) charts for educational videos, specifically BrainPOP, using simple 7th-grade language and short, concise bullet points.

David-Li0406/meta-skill-evloving

Tracks complex, multi-session work using the Beads issue tracker and dependency graphs, and provides persistent memory that survives conversation compaction. Use when work spans multiple sessions, has complex dependencies, or needs persistent context across compaction cycles. Trigger with phrases like "create task for", "what's ready to work on", "show task", "track this work", "what's blocking", or "update status".

相关技能