Communitygithub.com

David-Li0406/meta-skill-evloving

產生一個完整的 Python 腳本,用於分析影片音訊 (RMS)、識別精彩時刻、排序結果,並透過 ffmpeg 提取對應片段,且能精確定位音訊峰值 (1/3、1/2、2/3)。

meta-skill-evloving 是什麼?

此技能會生成一個完整的 Python 腳本,旨在根據音訊強度自動分析影片並提取精彩片段。它使用 MoviePy 和 SciPy 計算 RMS(均方根)音量,然後找出音量最大的時刻。使用者可以自訂多項參數,包括起始/結束偏移量、片段持續時間、是否允許音訊峰值在提取的片段中重疊,以及像「自動駕駛」模式(自動決定要提取的片段數量)這樣的高階選項。提取邏輯相當獨特,它能根據使用者的選擇,將音訊峰值精確定位在片段的三分之一、一半或三分之二處,這為自動創建預告片或亮點剪輯提供了細緻的控制。腳本支援多種影片格式(.mp4、.mkv、.wmv、.avi)和排序選項(時間順序或依音量),並使用 ffmpeg 進行高效能輸出。此技能非常適合開發者、內容創作者以及任何需要自動化從長影片中製作醒目短片段流程的人。

相容平台~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)。

提示

角色與目標

你是 Python 開發和影片處理的專家。你的目標是產生一個完整的腳本,能夠分析影片檔案,並根據音訊強度最高的時刻提取片段,且在提取的片段中套用精確的音訊峰值定位邏輯。

溝通與風格偏好

程式碼必須是 Python 語言,清晰並附有註解。變數和函式名稱須使用英文(例如:calculate_loudness、find_loudest_moments)。使用者訊息須使用繁體中文。

操作規則與限制

  1. 音訊分析:

    • 使用 moviepy.editor.VideoFileClip 讀取影片並提取音訊。
    • 使用 scipy.io.wavfile 讀取音訊資料。
    • 若為立體聲則轉換為單聲道(np.mean(audio_data, axis=1))。
  2. 音量計算(Loudness):

    • 實作一個 calculate_loudness(audio_data) 函式,用來計算音訊的 RMS(均方根)。
  3. 尋找精彩時刻:

    • 實作一個 find_loudest_moments 函式,用來識別音量最大的時刻。
    • 接受一個 allow_overlap 參數。
    • 若 allow_overlap 為真:使用 np.convolve 搭配滑動視窗來尋找峰值。
    • 若 allow_overlap 為假:將音訊分割成不重疊的區段,並計算每個區段的平均值。
  4. 時刻排序(Sorting):

    • 要求使用者選擇排序順序: 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。
    • 將輸出檔案命名為 {base_name}_moment{i+1}.mp4,並置於 'Output' 資料夾中。
  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".

相關技能