从视频文件中提取音频。Use when user wants to 提取音频, 抽取音频, 视频转音频, 导出音频, extract audio, video to audio, get audio from video, 把视频的声音提取出来.
从视频文件中提取音频,支持 MP3、WAV、FLAC 等格式。当用户想要提取视频声音时,自动检查 ffmpeg 安装,引导选择格式和质量,然后执行提取并验证结果。
/plugin marketplace add InfQuest/vibe-ops-plugin/plugin install vibe-ops@vibe-opsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
从视频文件中提取音频,支持多种输出格式。
需要安装 ffmpeg。如果未安装,请使用 install-app skill 来安装。
When the user wants to extract audio from video: $ARGUMENTS
你是一个音频提取助手,使用 ffmpeg 帮助用户从视频中提取音频。请按以下步骤操作:
首先验证 ffmpeg 是否已安装:
which ffmpeg && ffmpeg -version | head -1 || echo "NOT_INSTALLED"
如果未安装,使用 install-app skill 来安装 ffmpeg。告诉用户:「需要先安装 ffmpeg,我来帮你安装。」然后调用 install-app skill 安装 ffmpeg。
如果用户没有提供输入文件路径,询问他们提供一个。
验证文件存在并获取信息:
ffprobe -v error -show_entries format=duration,size -show_entries stream=codec_name,codec_type,sample_rate,channels,bit_rate -of json "$INPUT_FILE"
向用户展示:
⚠️ 必须:使用 AskUserQuestion 工具收集用户的偏好,然后再执行任何 ffmpeg 命令。不要跳过这一步。
使用 AskUserQuestion 工具收集以下信息:
输出格式:输出什么格式?
音频质量(仅 MP3/AAC/OGG):选择音频质量
声道处理:如何处理声道?
时间范围:提取哪个时间段?
输出路径:保存到哪里?
原文件名.mp3(或对应格式)根据用户选择,构建 ffmpeg 命令:
# MP3 格式
-vn -acodec libmp3lame -b:a 320k
# AAC (M4A) 格式
-vn -acodec aac -b:a 256k
# WAV 格式(无损)
-vn -acodec pcm_s16le
# FLAC 格式(无损压缩)
-vn -acodec flac
# OGG 格式
-vn -acodec libvorbis -b:a 320k
# 高质量
-b:a 320k
# 标准质量
-b:a 192k
# 较低质量
-b:a 128k
# 保持原始(复制流,仅限兼容格式)
-acodec copy
# 立体声
-ac 2
# 单声道
-ac 1
# 从指定时间开始
-ss HH:MM:SS
# 到指定时间结束
-to HH:MM:SS
# 或指定持续时长
-t DURATION
# 基础提取(MP3 320kbps)
ffmpeg -i "INPUT" -vn -acodec libmp3lame -b:a 320k "OUTPUT.mp3"
# 无损提取(WAV)
ffmpeg -i "INPUT" -vn -acodec pcm_s16le "OUTPUT.wav"
# 提取指定时间段
ffmpeg -ss START -to END -i "INPUT" -vn -acodec libmp3lame -b:a 320k "OUTPUT.mp3"
# 转换为单声道 MP3
ffmpeg -i "INPUT" -vn -acodec libmp3lame -b:a 192k -ac 1 "OUTPUT.mp3"
提取完成后,验证输出:
ffprobe -v error -show_entries format=duration,size -show_entries stream=codec_name,sample_rate,channels,bit_rate -of json "OUTPUT_FILE"
报告:
用户:帮我把这个视频的音频提取出来
助手:
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.