From 2a4d6db7d90899aff3d58d70996916968e4e0d27 Mon Sep 17 00:00:00 2001 From: w1redch4d <106700035+w1redch4d@users.noreply.github.com> Date: Mon, 16 Jun 2025 15:51:16 +0530 Subject: [PATCH] examples : update usage/help in yt-wsp.sh (#3251) This commit updates the usage/help message to be more readable and include the environment variables available to set options. --- examples/yt-wsp.sh | 44 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/examples/yt-wsp.sh b/examples/yt-wsp.sh index 67097e59..835508cc 100755 --- a/examples/yt-wsp.sh +++ b/examples/yt-wsp.sh @@ -80,15 +80,41 @@ cleanup() { } print_help() { - echo "################################################################################" - echo "Usage: ./examples/yt-wsp.sh " - echo "# See configurable env variables in the script; there are many!" - echo "# This script will produce an MP4 muxed file in the working directory; it will" - echo "# be named for the title and id of the video." - echo "# passing in https://youtu.be/VYJtb2YXae8 produces a file named"; - echo "# 'Why_we_all_need_subtitles_now-VYJtb2YXae8-res.mp4'" - echo "# Requirements: ffmpeg yt-dlp whisper.cpp" - echo "################################################################################" + cat << 'EOF' +Usage: + MODEL_PATH= \ + WHISPER_EXECUTABLE= \ + WHISPER_LANG=en \ + WHISPER_THREAD_COUNT= \ + ./examples/yt-wsp.sh + +Description: + This script downloads a YouTube video, generates subtitles using Whisper, + and muxes them into an MP4 output file. + +Output: + An MP4 file with embedded subtitles will be produced in the working directory. + The file will be named using the video title and ID. + Example: + Input: https://youtu.be/VYJtb2YXae8 + Output: Why_we_all_need_subtitles_now-VYJtb2YXae8-res.mp4 + +Requirements: + - ffmpeg + - yt-dlp + - whisper.cpp + +Environment Variables: + MODEL_PATH Path to the Whisper model (e.g., models/ggml-base.en.bin) + WHISPER_EXECUTABLE Path to the Whisper CLI executable + WHISPER_LANG Language code (e.g., 'en' for English) + WHISPER_THREAD_COUNT Number of CPU threads to use + +Tip: + The script has many configurable environment variables. + Review the source code to explore all options. + +EOF } check_requirements() {