Initial commit
This commit is contained in:
23
skills/video-to-article/scripts/extract-audio.sh
Executable file
23
skills/video-to-article/scripts/extract-audio.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# extract-audio.sh - Extract audio from video file for lecture transcription
|
||||
# Usage: extract-audio.sh <video-file>
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
VIDEO_FILE="$1"
|
||||
|
||||
if [ ! -f "$VIDEO_FILE" ]; then
|
||||
echo "Error: Video file '$VIDEO_FILE' not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v ffmpeg >/dev/null 2>&1; then
|
||||
echo "Error: ffmpeg not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Extract audio to audio.mp3
|
||||
ffmpeg -i "$VIDEO_FILE" -vn -acodec libmp3lame -q:a 2 audio.mp3 -y 2>&1 | grep -v "^frame="
|
||||
|
||||
echo "Audio extracted: audio.mp3"
|
||||
Reference in New Issue
Block a user