Use Whisper on Mac to Transcribe Audio and Video Files Instantly in Terminal

Use Whisper on Mac to Transcribe Audio and Video Files Instantly in Terminal

Turn your Mac into a strong transcription machine utilizing the identical AI that powers OpenAI’s ChatGPT. With only a few Terminal instructions, you’ll be able to convert audio and video recordsdata into correct textual content in minutes.

If you have by no means touched Terminal earlier than, don’t be concerned — establishing Whisper on macOS Sequoia 15 is less complicated than it seems and price it. Whether you are working with YouTube movies, interviews, lectures, or voice notes, Whisper can deal with all of the heavy lifting.

Whisper is a free, open-source speech-to-text neural community from OpenAI that runs totally in your machine — no web required after setup. Once you get it going, it is quick, safe, and lifeless easy — and it may chew by means of nearly any audio or video format you throw at it. And it is the proper instrument in the event you’re sick of glitchy web-based transcription providers, costly Mac apps, and clunky browser extensions with limitations, akin to file dimension caps, watermarks, adverts, or awful accuracy.

Yes, it lives within the Terminal — that black field of thriller most folk keep away from. But this is the factor: in the event you can copy and paste, you’ll be able to run Whisper. Once it is put in, transcribing a file is actually one line. There is not any bloated interface, no importing and ready, and no month-to-month charge.

And in the event you’re not able to mess with the command line? You nonetheless have choices. There are Mac apps like MacWhisper and Whisper Transcription that offer you a drag-and-drop interface powered by Whisper below the hood. Browser-based providers like Whisper demo on Hugging Face make it even simpler — although you may often commerce some privateness and suppleness for comfort. However, the command-line model continues to be essentially the most highly effective and versatile method to make use of Whisper, and it is the official implementation maintained by OpenAI. If you need full management, that is the model you need.

Or you’ll be able to skip all of it and simply ship ChatGPT the file through its net or desktop app — it may transcribe or translate it for you utilizing Whisper.

So in the event you’re bored with leaping by means of hoops simply to get clear transcripts — whether or not you are a pupil, podcaster, journalist, or simply somebody making an attempt to archive your Zoom calls — it is time to take 5 minutes and arrange one thing that simply works. Let’s dive in.

Requirements

Through the directions beneath, you may be putting in and utilizing the next instruments:

  • Whisper command-line instrument from OpenAI: The core transcription engine that converts speech to textual content.

  • FFmpeg: Required for Whisper to open, convert, and course of audio and video recordsdata.

  • Python 3.10 or later: The programming language Whisper is written in.

  • Homebrew: A bundle supervisor that makes putting in Whisper, FFmpeg, and Python straightforward.

To run these instruments efficiently, you may want:

  • A Mac operating macOS Monterey 12.3 or later: Preferably macOS Sequoia 15 or in a while an Apple Silicon chip for quicker efficiency.

  • At least 8 GB of RAM and a few free disk area: Larger Whisper fashions can use loads of reminiscence — particularly on lengthy recordsdata — however smaller fashions work positive on most setups.

  • Terminal app: Preinstalled on macOS — you may use it to enter the setup and transcription instructions.

Setting up Whisper on macOS

Follow these steps to put in every thing you want and begin transcribing recordsdata. If you have already got Homebrew, Python, and FFmpeg put in, it is nonetheless value checking these steps out to make sure every thing is updated.

Open Terminal in your Mac

Terminal is the command-line app constructed into macOS — it’s the way you’ll set up and run Whisper. You don’t must know code, simply paste in instructions. To open Terminal, press Command + Space, sort “Terminal,” and hit Return. You may discover it within the Utilities folder in your Applications listing or within the Other folder in Launchpad.

Install or replace Homebrew

Homebrew is a bundle supervisor for macOS — just like the App Store however for highly effective command-line instruments. It makes it straightforward to put in every thing Whisper wants behind the scenes.

If you do not have Homebrew put in, paste this command and press Return:

/bin/bash -c "$(curl -fsSL https://uncooked.githubusercontent.com/Homebrew/set up/HEAD/set up.sh)"

This command might look intimidating, however this is what all of it means:

  • /bin/bash -c tells your Mac to run a command within the Bash shell.

  • The half in quotes — "$(curl -fsSL https://uncooked.githubusercontent.com/Homebrew/set up/HEAD/set up.sh)" — makes use of curl (a instrument that fetches recordsdata from the web) to obtain Homebrew’s official installer script from GitHub.

  • Here’s what these flags imply:

    • -f = fail silently on errors.

    • -s = run silently (do not present the obtain progress bar).

    • -S = present errors if any happen (used with -s).

    • -L = observe redirects mechanically.

  • The entire script installs Homebrew safely and mechanically.

If Homebrew is already put in, replace it by operating:

brew replace

Install Python 3.10 (or newer)

Python is the programming language Whisper is written in. Apple consists of an older model on macOS, however Whisper wants a more moderen one to run correctly. Homebrew makes it straightforward to put in the right model.

Whisper requires Python 3.10 or above. Install it with:

brew set up python

If you have already got Python put in however aren’t positive if it is the correct model, verify it with:

python3 --version

If it is older than 3.10, you’ll be able to improve it with:

brew improve python

You’re good to go when you’re on Python 3.10 or newer.

Install FFmpeg

FFmpeg is a instrument for processing audio and video recordsdata. It helps Whisper deal with every kind of media codecs, akin to MP3, MP4, M4A, and WAV. Without FFmpeg, Whisper cannot learn or convert your recordsdata.

To set up it utilizing Homebrew:

brew set up ffmpeg

If you have already got FFmpeg put in, make sure that it is updated:

brew improve ffmpeg

You can confirm that FFmpeg is working by operating:

ffmpeg -version

If it prints model information, you are good.

Install Whisper through pip

Pip is Python’s built-in bundle supervisor — it is how you put in Python apps like Whisper. You’ll use pip to obtain and set up Whisper instantly from OpenAI’s GitHub repository.

First, make sure that pip is updated:

pip3 set up --upgrade pip

Then set up Whisper:

pip3 set up git+https://github.com/openai/whisper.git

Run a transcription with Whisper

Once Whisper is put in, you’ll be able to transcribe audio and video recordsdata (MP3, MP4, M4A, WAV, and extra) utilizing a single command. It helps a variety of pretrained fashions, from light-weight and quick to giant and extremely correct.

Audio recordsdata are transcribed a lot quicker than video recordsdata, so chances are you’ll need to extract the audio out of your movies and use that with Whisper as a substitute — particularly when working with a bigger mannequin. On a Mac, you’ll be able to shortly export audio from a video file utilizing QuickTime Player.

Basic utilization (auto-detects language)

The --model tiny choice runs the quickest and makes use of the least reminiscence, whereas the --model giant choice presents one of the best accuracy however requires considerably extra RAM and takes longer to course of.

whisper your_file.mp4 --model tiny
whisper your_file.mp4 --model base
whisper your_file.mp4 --model small
whisper your_file.mp4 --model medium
whisper your_file.mp4 --model giant

Specify language for quicker, extra correct outcomes

If your file is in English, you’ll be able to specify it utilizing --language en or --language English:

whisper your_file.mp4 --language English --model tiny
whisper your_file.mp4 --language English --model base
whisper your_file.mp4 --language English --model small
whisper your_file.mp4 --language English --model medium
whisper your_file.mp4 --language English --model giant

When utilizing one of many instructions above, the output will print instantly in the identical Terminal window.

However, Whisper can create .txt (plain transcript), .srt (commonplace subtitle format utilized by most video gamers and editors), and .vtt (Web Video Text Tracks format used for HTML5 video, YouTube, and so forth.) transcription recordsdata in the identical listing as the unique media file. If wanted, add flags like --output_format txt (to specify a particular format) or --task translate (which mechanically interprets overseas languages into English).

For instance, the next transcribes the file in English and outputs it to a .txt doc in the identical listing.

whisper your_file.mp4 --language en --model small --output_format txt

To generate subtitles for a foreign-language video in English, the next command will generate .txt, .srt, and .vtt transcription recordsdata in the identical folder as your video or audio file.

whisper your_file.mp4 --task translate --model medium

Want simply subtitle recordsdata (like .srt) and never the plain textual content transcript? Run:

whisper your_file.mp4 --language en --task translate --output_format srt

To see all accessible choices:

whisper --help

Final ideas

Whisper in Terminal is not only a transcription instrument — it is a secret weapon for creators, journalists, college students, and anybody who offers with spoken content material. The setup course of may really feel a bit technical the primary time, however as soon as it is up and operating, it is extremely easy to make use of.

That stated, Whisper fashions run domestically and may be sluggish, relying in your Mac’s {hardware}. If you’re employed with giant recordsdata and wish quicker outcomes, persist with the tiny or base fashions. If you want greater accuracy and do not thoughts the additional processing time, go for medium or giant.

Full checklist of Whisper arguments and choices

If you need to discover every thing Whisper can do — together with output codecs, language assist, and superior flags — you’ll be able to run whisper --help in Terminal. Here’s the entire checklist of obtainable choices for fast reference:

utilization: whisper [-h] [--model MODEL] [--model_dir MODEL_DIR] [--device DEVICE]
               [--output_dir OUTPUT_DIR]
               [--output_format {txt,vtt,srt,tsv,json,all}]
               [--verbose VERBOSE] [--task {transcribe,translate}]
               [--language {af,am,ar,as,az,ba,be,bg,bn,bo,br,bs,ca,cs,cy,da,de,el,en,es,et,eu,fa,fi,fo,fr,gl,gu,ha,haw,he,hi,hr,ht,hu,hy,id,is,it,ja,jw,ka,kk,km,kn,ko,la,lb,ln,lo,lt,lv,mg,mi,mk,ml,mn,mr,ms,mt,my,ne,nl,nn,no,oc,pa,pl,ps,pt,ro,ru,sa,sd,si,sk,sl,sn,so,sq,sr,su,sv,sw,ta,te,tg,th,tk,tl,tr,tt,uk,ur,uz,vi,yi,yo,yue,zh,Afrikaans,Albanian,Amharic,Arabic,Armenian,Assamese,Azerbaijani,Bashkir,Basque,Belarusian,Bengali,Bosnian,Breton,Bulgarian,Burmese,Cantonese,Castilian,Catalan,Chinese,Croatian,Czech,Danish,Dutch,English,Estonian,Faroese,Finnish,Flemish,French,Galician,Georgian,German,Greek,Gujarati,Haitian,Haitian Creole,Hausa,Hawaiian,Hebrew,Hindi,Hungarian,Icelandic,Indonesian,Italian,Japanese,Javanese,Kannada,Kazakh,Khmer,Korean,Lao,Latin,Latvian,Letzeburgesch,Lingala,Lithuanian,Luxembourgish,Macedonian,Malagasy,Malay,Malayalam,Maltese,Mandarin,Maori,Marathi,Moldavian,Moldovan,Mongolian,Myanmar,Nepali,Norwegian,Nynorsk,Occitan,Panjabi,Pashto,Persian,Polish,Portuguese,Punjabi,Pushto,Romanian,Russian,Sanskrit,Serbian,Shona,Sindhi,Sinhala,Sinhalese,Slovak,Slovenian,Somali,Spanish,Sundanese,Swahili,Swedish,Tagalog,Tajik,Tamil,Tatar,Telugu,Thai,Tibetan,Turkish,Turkmen,Ukrainian,Urdu,Uzbek,Valencian,Vietnamese,Welsh,Yiddish,Yoruba}]
               [--temperature TEMPERATURE] [--best_of BEST_OF]
               [--beam_size BEAM_SIZE] [--patience PATIENCE]
               [--length_penalty LENGTH_PENALTY]
               [--suppress_tokens SUPPRESS_TOKENS]
               [--initial_prompt INITIAL_PROMPT]
               [--condition_on_previous_text CONDITION_ON_PREVIOUS_TEXT]
               [--fp16 FP16]
               [--temperature_increment_on_fallback TEMPERATURE_INCREMENT_ON_FALLBACK]
               [--compression_ratio_threshold COMPRESSION_RATIO_THRESHOLD]
               [--logprob_threshold LOGPROB_THRESHOLD]
               [--no_speech_threshold NO_SPEECH_THRESHOLD]
               [--word_timestamps WORD_TIMESTAMPS]
               [--prepend_punctuations PREPEND_PUNCTUATIONS]
               [--append_punctuations APPEND_PUNCTUATIONS]
               [--highlight_words HIGHLIGHT_WORDS]
               [--max_line_width MAX_LINE_WIDTH]
               [--max_line_count MAX_LINE_COUNT]
               [--max_words_per_line MAX_WORDS_PER_LINE] [--threads THREADS]
               [--clip_timestamps CLIP_TIMESTAMPS]
               [--hallucination_silence_threshold HALLUCINATION_SILENCE_THRESHOLD]
               audio 

positional arguments:
  audio                 audio file(s) to transcribe

choices:
  -h, --help            present this assist message and exit
  --model MODEL         identify of the Whisper mannequin to make use of (default: turbo)
  --model_dir MODEL_DIR
                        the trail to avoid wasting mannequin recordsdata; makes use of ~/.cache/whisper by
                        default (default: None)
  --device DEVICE       gadget to make use of for PyTorch inference (default: cpu)
  --output_dir OUTPUT_DIR, -o OUTPUT_DIR
                        listing to avoid wasting the outputs (default: .)
  --output_format {txt,vtt,srt,tsv,json,all}, -f {txt,vtt,srt,tsv,json,all}
                        format of the output file; if not specified, all
                        accessible codecs shall be produced (default: all)
  --verbose VERBOSE     whether or not to print out the progress and debug messages
                        (default: True)
  --task {transcribe,translate}
                        whether or not to carry out X->X speech recognition
                        ('transcribe') or X->English translation ('translate')
                        (default: transcribe)
  --language {af,am,ar,as,az,ba,be,bg,bn,bo,br,bs,ca,cs,cy,da,de,el,en,es,et,eu,fa,fi,fo,fr,gl,gu,ha,haw,he,hello,hr,ht,hu,hy,id,is,it,ja,jw,ka,kk,km,kn,ko,la,lb,ln,lo,lt,lv,mg,mi,mk,ml,mn,mr,ms,mt,my,ne,nl,nn,no,oc,pa,pl,ps,pt,ro,ru,sa,sd,si,sk,sl,sn,so,sq,sr,su,sv,sw,ta,te,tg,th,tk,tl,tr,tt,uk,ur,uz,vi,yi,yo,yue,zh,Afrikaans,Albanian,Amharic,Arabic,Armenian,Assamese,Azerbaijani,Bashkir,Basque,Belarusian,Bengali,Bosnian,Breton,Bulgarian,Burmese,Cantonese,Castilian,Catalan,Chinese,Croatian,Czech,Danish,Dutch,English,Estonian,Faroese,Finnish,Flemish,French,Galician,Georgian,German,Greek,Gujarati,Haitian,Haitian Creole,Hausa,Hawaiian,Hebrew,Hindi,Hungarian,Icelandic,Indonesian,Italian,Japanese,Javanese,Kannada,Kazakh,Khmer,Korean,Lao,Latin,Latvian,Letzeburgesch,Lingala,Lithuanian,Luxembourgish,Macedonian,Malagasy,Malay,Malayalam,Maltese,Mandarin,Maori,Marathi,Moldavian,Moldovan,Mongolian,Myanmar,Nepali,Norwegian,Nynorsk,Occitan,Panjabi,Pashto,Persian,Polish,Portuguese,Punjabi,Pushto,Romanian,Russian,Sanskrit,Serbian,Shona,Sindhi,Sinhala,Sinhalese,Slovak,Slovenian,Somali,Spanish,Sundanese,Swahili,Swedish,Tagalog,Tajik,Tamil,Tatar,Telugu,Thai,Tibetan,Turkish,Turkmen,Ukrainian,Urdu,Uzbek,Valencian,Vietnamese,Welsh,Yiddish,Yoruba}
                        language spoken within the audio, specify None to carry out
                        language detection (default: None)
  --temperature TEMPERATURE
                        temperature to make use of for sampling (default: 0)
  --best_of BEST_OF     variety of candidates when sampling with non-zero
                        temperature (default: 5)
  --beam_size BEAM_SIZE
                        variety of beams in beam search, solely relevant when
                        temperature is zero (default: 5)
  --patience PATIENCE   non-obligatory endurance worth to make use of in beam decoding, as in
                        https://arxiv.org/abs/2204.05424, the default (1.0) is
                        equal to traditional beam search (default: None)
  --length_penalty LENGTH_PENALTY
                        non-obligatory token size penalty coefficient (alpha) as
                        in https://arxiv.org/abs/1609.08144, makes use of easy
                        size normalization by default (default: None)
  --suppress_tokens SUPPRESS_TOKENS
                        comma-separated checklist of token ids to suppress throughout
                        sampling; '-1' will suppress most particular characters
                        besides widespread punctuations (default: -1)
  --initial_prompt INITIAL_PROMPT
                        non-obligatory textual content to supply as a immediate for the primary
                        window. (default: None)
  --condition_on_previous_text CONDITION_ON_PREVIOUS_TEXT
                        if True, present the earlier output of the mannequin as a
                        immediate for the subsequent window; disabling might make the
                        textual content inconsistent throughout home windows, however the mannequin
                        turns into much less susceptible to getting caught in a failure loop
                        (default: True)
  --fp16 FP16           whether or not to carry out inference in fp16; True by default
                        (default: True)
  --temperature_increment_on_fallback TEMPERATURE_INCREMENT_ON_FALLBACK
                        temperature to extend when falling again when the
                        decoding fails to satisfy both of the thresholds beneath
                        (default: 0.2)
  --compression_ratio_threshold COMPRESSION_RATIO_THRESHOLD
                        if the gzip compression ratio is greater than this
                        worth, deal with the decoding as failed (default: 2.4)
  --logprob_threshold LOGPROB_THRESHOLD
                        if the common log likelihood is decrease than this
                        worth, deal with the decoding as failed (default: -1.0)
  --no_speech_threshold NO_SPEECH_THRESHOLD
                        if the likelihood of the <|nospeech|> token is greater
                        than this worth AND the decoding has failed on account of
                        `logprob_threshold`, think about the phase as silence
                        (default: 0.6)
  --word_timestamps WORD_TIMESTAMPS
                        (experimental) extract word-level timestamps and
                        refine the outcomes based mostly on them (default: False)
  --prepend_punctuations PREPEND_PUNCTUATIONS
                        if word_timestamps is True, merge these punctuation
                        symbols with the subsequent phrase (default: "'“¿([{-)
  --append_punctuations APPEND_PUNCTUATIONS
                        if word_timestamps is True, merge these punctuation
                        symbols with the previous word (default:
                        "'.。,,!!??::”)]}、)
  --highlight_words HIGHLIGHT_WORDS
                        (requires --word_timestamps True) underline every phrase
                        as it's spoken in srt and vtt (default: False)
  --max_line_width MAX_LINE_WIDTH
                        (requires --word_timestamps True) the utmost quantity
                        of characters in a line earlier than breaking the road
                        (default: None)
  --max_line_count MAX_LINE_COUNT
                        (requires --word_timestamps True) the utmost quantity
                        of traces in a phase (default: None)
  --max_words_per_line MAX_WORDS_PER_LINE
                        (requires --word_timestamps True, no impact with
                        --max_line_width) the utmost variety of phrases in a
                        phase (default: None)
  --threads THREADS     variety of threads utilized by torch for CPU inference;
                        supercedes MKL_NUM_THREADS/OMP_NUM_THREADS (default:
                        0)
  --clip_timestamps CLIP_TIMESTAMPS
                        comma-separated checklist begin,finish,begin,finish,...
                        timestamps (in seconds) of clips to course of, the place the
                        final finish timestamp defaults to the tip of the file
                        (default: 0)
  --hallucination_silence_threshold HALLUCINATION_SILENCE_THRESHOLD
                        (requires --word_timestamps True) skip silent durations
                        longer than this threshold (in seconds) when a
                        attainable hallucination is detected (default: None)

Don’t Miss: How to Remove or Add ‘Where from’ Metadata in Files on macOS

Cover picture, screenshots, and GIFs by Gadget Hacks.

HI-FI News

through macOS Tips – Gadget Hacks https://ift.tt/VmFIDt9

March 28, 2025 at 12:06AM