audio-extraction
БесплатноБез исполняемых скриптовНе проверенffmpeg patterns for extracting audio from video files and transcoding between formats
от jmagly★ 233 звезды на GitHubОб этом скилле
Audio Extraction
Patterns for extracting audio tracks from video files and transcoding between audio formats using ffmpeg.
Extract Audio from Video
To Opus (Recommended for collections)
# Standard quality (128k) - good balance of size and quality
ffmpeg -y -i input.mp4 -vn -acodec libopus -b:a 128k output.opus
# High quality (192k) - for studio sessions and interviews
ffmpeg -y -i input.mp4 -vn -acodec libopus -b:a 192k output.opus
# Lower quality (96k) - for long-form content like full concerts
ffmpeg -y -i input.mp4 -vn -acodec libopus -b:a 96k output.opus
To FLAC (Lossless preservation)
ffmpeg -y -i input.mp4 -vn -acodec flac output.flac
To MP3 (Maximum compatibility)
# VBR quality 2 (~190kbps, excellent quality)
ffmpeg -y -i input.mp4 -vn -acodec libmp3lame -q:a 2 output.mp3
# CBR 320kbps (maximum quality)
ffmpeg -y -i input.mp4 -vn -acodec libmp3lame -b:a 320k output.mp3
Batch Extraction
All Videos in Directory to Opus
for f in video/*.mp4; do
[ -f "$f" ] || continue
base=$(basename "${f%.mp4}")
[ -f "audio/${base}.opus" ] && continue # Skip existing
ffmpeg -y -i "$f" -vn -acodec libopus -b:a 128k "audio/${base}.opus"
done
Parallel Batch Extraction (GNU parallel)
find video/ -name "*.mp4" -print0 | \
xargs -0 -P 4 -I{} sh -c '
base=$(basename "${1%.mp4}")
[ -f "audio/${base}.opus" ] || \
ffmpeg -y -i "$1" -vn -acodec libopus -b:a 128k "audio/${base}.opus"
' _ {}
Format Transcoding
FLAC to Opus
ffmpeg -y -i input.flac -acodec libopus -b:a 128k output.opus
FLAC to MP3
ffmpeg -y -i input.flac -acodec libmp3lame -q:a 2 output.mp3
Opus to MP3 (when Opus not supported by target)
ffmpeg -y -i input.opus -acodec libmp3lame -q:a 2 output.mp3
M4A to Opus
ffmpeg -y -i input.m4a -acodec libopus -b:a 128k output.opus
Quality Verification
Check Audio Bitrate
ffprobe -v quiet -show_entries format=bit_rate \
-of default=noprint_wrappers=1:nokey=1 input.opus
Check Audio Format Details
ffprobe -v quiet -show_entries stream=codec_name,sample_rate,channels,bit_rate \
-of json input.opus
Detect Clipping/Distortion
ffmpeg -i input.opus -af "volumedetect" -f null /dev/null 2>&1 | grep max_volume
# If max_volume > 0 dB, audio is clipping
Check Duration
ffprobe -v quiet -show_entries format=duration \
-of default=noprint_wrappers=1:nokey=1 input.opus
Format Selection Guide
| Source Content | Extract To | Bitrate | Rationale |
|---|---|---|---|
| Music video (studio) | Opus | 128k | Good balance for music |
| Live performance | Opus | 128k | Crowd noise doesn't need more |
| Studio session | Opus | 192k | Preserve detail |
| Interview | Opus | 96k | Speech doesn't need high bitrate |
| Full concert (2+ hours) | Opus | 96k | Size management |
| Archival source (FLAC) | FLAC | Lossless | Preserve original quality |
Segment Handling
Concatenate Audio Segments
# Create file list
for f in segments/*.opus; do
echo "file '$f'" >> filelist.txt
done
# Concatenate without re-encoding
ffmpeg -f concat -safe 0 -i filelist.txt -c copy output.opus
Split Long Recording into Tracks
# Split at specific timestamps (from setlist)
ffmpeg -i concert.opus -ss 00:00:00 -to 00:04:30 -c copy "01 - Jumpsuit.opus"
ffmpeg -i concert.opus -ss 00:04:30 -to 00:08:15 -c copy "02 - Levitate.opus"
Thumbnail/Frame Extraction
Extract Video Thumbnail (for cover art)
# Extract frame at 5 seconds
ffmpeg -y -ss 5 -i video.mp4 -vframes 1 -q:v 2 cover.jpg
# Extract frame as WebP (smaller)
ffmpeg -y -ss 5 -i video.mp4 -vframes 1 cover.webp
References
- @$AIWG_ROOT/agentic/code/addons/aiwg-utils/rules/human-authorization.md — Seek explicit authorization before overwriting existing audio files
- @$AIWG_ROOT/agentic/code/frameworks/media-curator/skills/acquire/SKILL.md — Acquisition skill that invokes audio extraction via --extract-audio flag
- @$AIWG_ROOT/agentic/code/frameworks/media-curator/skills/integrity-verification/SKILL.md — Verify extracted audio file integrity after processing
- @$AIWG_ROOT/agentic/code/frameworks/media-curator/skills/metadata-tagging/SKILL.md — Tag extracted audio files with correct metadata after extraction
Установить audio-extraction в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл audio-extraction?
ffmpeg patterns for extracting audio from video files and transcoding between formats
Как установить скилл audio-extraction?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл audio-extraction запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic