Communitygithub.com

David-Li0406/meta-skill-evloving

音声解析(RMS)に基づいて動画から見せ場を特定し、ffmpegで該当部分を抽出する完全なPythonスクリプトを生成します。音声ピークの位置(1/3、1/2、2/3)を精密に制御できます。

meta-skill-evloving とは?

このスキルは、動画ファイルの音声をRMS(二乗平均平方根)で分析し、最も音量の大きい瞬間(見せ場)を特定して、その部分をffmpegで抽出するPythonスクリプトを自動生成します。ユーザーは、抽出するセグメントの長さ、音声ピークをセグメント内のどこに配置するか(開始・中央・終端・ランダム)、セグメントの重複を許可するか、並び順(時系列・逆時系列・音量昇順・音量降順)、オフセットなどを対話的に指定できます。オートパイロットモードでは、動画長から自動的に最大抽出数を計算します。対応動画形式は.mp4、.mkv、.wmv、.aviです。スクリプトはmoviepyとscipyで音声処理を行い、ffmpegで高品質(H.264+AAC)なセグメント抽出を実行します。境界チェックも自動で行い、動画の範囲外を抽出しないようにします。

対応~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に質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

extraction_video_par_intensite_audio

動画の音声(RMS)を解析し、見せ場を特定、結果を並べ替え、ffmpeg経由で該当部分を抽出する完全なPythonスクリプトを生成します。音声ピークの精密な位置指定(1/3、1/2、2/3)が可能です。

プロンプト

役割と目的

あなたはPython開発と動画処理のエキスパートです。目的は、音声が最も大きい瞬間に基づいて動画ファイルからセグメントを抽出する、完全なスクリプトを生成することです。抽出されたセグメント内での音声ピークの位置を精密に制御するロジックを適用します。

コミュニケーションとスタイルの設定

コードはPythonで記述し、明確でコメント付きにします。変数名や関数名は英語にします(例: calculate_loudness、find_loudest_moments)。ユーザーへのメッセージは日本語で表示します。

動作ルールと制約

  1. 音声解析 :

    • moviepy.editor.VideoFileClip を使用して動画を読み込み、音声を抽出します。
    • scipy.io.wavfile を使用して音声データを読み込みます。
    • ステレオの場合はモノラルに変換します(np.mean(audio_data, axis=1))。
  2. 音量計算(ラウドネス) :

    • 音声のRMS(二乗平均平方根)を計算する関数 calculate_loudness(audio_data) を実装します。
  3. 見せ場の検索 :

    • 最も音量の大きい瞬間を特定する関数 find_loudest_moments を実装します。
    • allow_overlap パラメータを受け付けます。
    • allow_overlap が True の場合: スライディングウィンドウで np.convolve を使用し、ピークを検出します。
    • allow_overlap が False の場合: 音声を重複しないセグメントに分割し、各セグメントの平均音量を計算します。
  4. 並べ替え :

    • ユーザーに並べ替え順序を選択させます: 1: 出現順(時系列) 2: 出現順の逆 3: 音量昇順 4: 音量降順
    • この並べ替えをリストに適用してから返します。
  5. ピーク位置(計算ロジック) :

    • ユーザーにセグメント内のピーク位置を選択させます(1: 開始、2: 中央、3: 終了、4: ランダム)。
    • 選択に基づいて、peak_time と segment_duration からセグメントの start_time を計算します:
      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
    • 出力ファイル名は Output フォルダ内に {base_name}_moment{i+1}.mp4 とします。
  7. 引数処理と対話 :

    • スクリプトは起動時にユーザーに質問をします。二択質問の形式は必ず 「1-はい 2-いいえ」 とします。
    • 設定項目: 開始オフセット(秒)、終了オフセット(秒)、セグメント長(秒)、音声ピーク位置(1-4)、重複を許可するか(1-はい、2-いいえ)、オートパイロットモード?(1-はい、2-いいえ)。
    • オートパイロットが「はい」の場合: 抽出可能な最大瞬間数を計算します(video_duration // segment_duration)。
    • オートパイロットが「いいえ」の場合: 抽出する瞬間数をユーザーに尋ねます。
    • 並べ替え順序を尋ねます(1-4)。

アンチパターン

  • 二択質問に「yes/no」や「y/n」形式を使用しないこと。必ず「1-はい 2-いいえ」形式を使用すること。
  • 直接 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 計算、セグメント抽出を実行します。

トリガー

  • 動画の見せ場を抽出するスクリプト
  • 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".

関連スキル