Spaces:
Running
Running
w1redch4d
commited on
examples : update usage/help in yt-wsp.sh (#3251)
Browse filesThis commit updates the usage/help message to be more readable and include the environment variables available to set options.
- examples/yt-wsp.sh +35 -9
examples/yt-wsp.sh
CHANGED
|
@@ -80,15 +80,41 @@ cleanup() {
|
|
| 80 |
}
|
| 81 |
|
| 82 |
print_help() {
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
}
|
| 93 |
|
| 94 |
check_requirements() {
|
|
|
|
| 80 |
}
|
| 81 |
|
| 82 |
print_help() {
|
| 83 |
+
cat << 'EOF'
|
| 84 |
+
Usage:
|
| 85 |
+
MODEL_PATH=<model> \
|
| 86 |
+
WHISPER_EXECUTABLE=<whisper-cli> \
|
| 87 |
+
WHISPER_LANG=en \
|
| 88 |
+
WHISPER_THREAD_COUNT=<int> \
|
| 89 |
+
./examples/yt-wsp.sh <video_url>
|
| 90 |
+
|
| 91 |
+
Description:
|
| 92 |
+
This script downloads a YouTube video, generates subtitles using Whisper,
|
| 93 |
+
and muxes them into an MP4 output file.
|
| 94 |
+
|
| 95 |
+
Output:
|
| 96 |
+
An MP4 file with embedded subtitles will be produced in the working directory.
|
| 97 |
+
The file will be named using the video title and ID.
|
| 98 |
+
Example:
|
| 99 |
+
Input: https://youtu.be/VYJtb2YXae8
|
| 100 |
+
Output: Why_we_all_need_subtitles_now-VYJtb2YXae8-res.mp4
|
| 101 |
+
|
| 102 |
+
Requirements:
|
| 103 |
+
- ffmpeg
|
| 104 |
+
- yt-dlp
|
| 105 |
+
- whisper.cpp
|
| 106 |
+
|
| 107 |
+
Environment Variables:
|
| 108 |
+
MODEL_PATH Path to the Whisper model (e.g., models/ggml-base.en.bin)
|
| 109 |
+
WHISPER_EXECUTABLE Path to the Whisper CLI executable
|
| 110 |
+
WHISPER_LANG Language code (e.g., 'en' for English)
|
| 111 |
+
WHISPER_THREAD_COUNT Number of CPU threads to use
|
| 112 |
+
|
| 113 |
+
Tip:
|
| 114 |
+
The script has many configurable environment variables.
|
| 115 |
+
Review the source code to explore all options.
|
| 116 |
+
|
| 117 |
+
EOF
|
| 118 |
}
|
| 119 |
|
| 120 |
check_requirements() {
|