1. Presentation

transcript is a small utility that converts the speech in a video to a
text file named transcript.txt.

2. Dependencies

pip to set up a venv virtual environment
yt-dlp to download the audio from a video stored on the web
ffmpeg to convert it to a suitable format for Whisper
Whisper to convert the audio to text

3. Initial set up for a given user (to be done only once for each user)

ffmpeg, pip and yt-dlp are included in Slint by default.
To setup the virtual environment and install Whisper in it, as regular
user, type these commands:
python3 -m venv ~/.venvs/whisper
. ~/.venvs/whisper/bin/activate
pip install --upgrade pip
pip install faster-whisper"

Or just type:
/usr/libexec/transcript/setup_whisper

4. Usage:

[MODEL_SIZE=<whisper_model>] transcript <url> [two letters language]
whisper_model can be tiny, base, small, medium or large.
The default is small for a good balance of speed and accuracy if you do
not have a dedicated GPU.
If the language is not set it will be auto-detected.

5. Recommended Whisper model sizes:

tiny – fastest, smallest, low accuracy; ideal for quick CPU transcription
or low-resource systems.
base – fast, slightly more accurate; still very CPU-friendly.
small – balanced speed and accuracy; good default for CPU use.
medium – high accuracy; slower on CPU, faster on GPU.
large – highest accuracy; very slow on CPU, GPU recommended.

Rule of thumb:
Use tiny/base/small if running on CPU.
Use medium/large if you have a GPU and want better accuracy.

6. Supported languages

This tool supports all languages provided by OpenAI Whisper.
Languages are specified using two-letter ISO 639-1 codes.

If no language is specified, the language is automatically detected.

The list below comes from OpenAI Whisper.

Available languages, listed alphabetically by language name:

Afrikaans – af
Albanian – sq
Amharic – am
Arabic – ar
Armenian – hy
Assamese – as
Azerbaijani – az
Bashkir – ba
Basque – eu
Belarusian – be
Bengali – bn
Bosnian – bs
Breton – br
Bulgarian – bg
Burmese (Myanmar) – my
Catalan – ca
Chinese – zh
Croatian – hr
Czech – cs
Danish – da
Dutch – nl
English – en
Estonian – et
Faroese – fo
Finnish – fi
French – fr
Galician – gl
Georgian – ka
German – de
Greek – el
Gujarati – gu
Haitian Creole – ht
Hausa – ha
Hebrew – he
Hindi – hi
Hungarian – hu
Icelandic – is
Indonesian – id
Italian – it
Japanese – ja
Javanese – jw
Kannada – kn
Kazakh – kk
Khmer – km
Korean – ko
Lao – lo
Latin – la
Latvian – lv
Lingala – ln
Lithuanian – lt
Luxembourgish – lb
Macedonian – mk
Malagasy – mg
Malay – ms
Malayalam – ml
Maltese – mt
Maori – mi
Marathi – mr
Mongolian – mn
Nepali – ne
Norwegian – no
Norwegian Nynorsk – nn
Occitan – oc
Pashto – ps
Persian – fa
Polish – pl
Portuguese – pt
Punjabi – pa
Romanian – ro
Russian – ru
Sanskrit – sa
Serbian – sr
Shona – sn
Sindhi – sd
Sinhala – si
Slovak – sk
Slovenian – sl
Somali – so
Spanish – es
Sundanese – su
Swahili – sw
Swedish – sv
Tagalog – tl
Tajik – tg
Tamil – ta
Tatar – tt
Telugu – te
Thai – th
Tibetan – bo
Turkish – tr
Turkmen – tk
Ukrainian – uk
Urdu – ur
Uzbek – uz
Vietnamese – vi
Welsh – cy
Yiddish – yi
Yoruba – yo