Skip to content
logo9minuti120x48
Menu
  • Home
  • Tutorial
    • Zaini
    • Stampa 3d
    • ebook
    • Informatica
  • Scritti
    • Racconti
    • Articoli
    • Temi
    • Storia
  • Video
  • Progetti
    • Progetto Carcere
    • Progetto Istruzione
    • Progetto Acque pulite
    • Progetto Tecnologia
    • Progetto Casa
    • Progetto Democrazia
    • Progetto Immigrazione
    • Storia
    • Progetto Storia
  • Chi siamo
    • LinkTree
  • Privacy Policy
    • Cookie Policy (EU)
  • Blog
  • Donazioni
Menu

Videogrep, how to extract a certain word from a video (or more)

Posted on 24 Novembre 2022 by Alessandro Oppo

In this post, we’ll see how to use video grep, an idea and a software made by Sam Lavigne.

Everything is well explained in his GitHub repository or on this page, but I think it could be easier to follow some easy steps for people that are not so confident with technology.

Link to Sam blog

This post will also serve as a reminder for me.

Download the videos with YT-DLP

Install YT-DLP with this command:

pip install yt-dlp

We are using YT-DLP to download videos. To do that just write this command with the link to the video or the playlist you want to download.

yt-dlp "https://www.youtube.com/watch?v=gxX8wZpc8ME&list=PLNlAEAan3IFU4UntqHaFtkVY501sF5awP" --sub-langs it --sub-format srt --format mp4 -f 137+140

Create subtitles with Vosk

To generate .srt we need Vosk transcriber, that is a speech to text (STT) open source software (GitHub repo). To install Vosk run

pip install vosk

If the YouTube video doesn’t have subtitles, you can create them with the Vosk speech to text.

The simplest command that you can use is this. It’s going to use the small modell.

vosk-transcriber -l it -i video.mp4 -t srt -o video.srt

If you want a more precise transcription, you can download the full model for your language. At the moment, you need to unzip the model before to use it.

vosk-transcriber -l it -i ./video.mp4 -m /home/ale/Downloads/vosk-model-it-0.22 -o ./video.srt -t srt

In this case, you have to specify where is the full model located. Note that you can transcribe also more videos at the same type, just leave ./ without specifying the name of the video.

If you are transcribing multiple videos with Vosk, in the actual version there is a bug that doesn’t allow spaces into videos.

In this way it will put – instead of spaces in every videos. Run this command once that you are in the folder where your videos are.

rename 's/\s+/-/g' *

Installing and using videogrep

To install videogrep run this.

pip install videogrep

Finally, we can use videogrep. Before cutting a video, it’s interesting to know how many times that word is repeated. To do that, we can use

-n 1

videogrep --input "./video.mp4" -n 1

Once that we know which word (or words!) we want to use we remove -n 1

videogrep --input "./video.mp4" --search 'ciao' -n 1

Dammi un 5 virtuale, clicca like e condividi.

  • Fai clic qui per condividere su LinkedIn (Si apre in una nuova finestra) LinkedIn
  • Fai clic per condividere su Facebook (Si apre in una nuova finestra) Facebook
  • Fai clic per condividere su X (Si apre in una nuova finestra) X
  • Fai clic qui per condividere su Reddit (Si apre in una nuova finestra) Reddit
  • Fai clic per condividere su WhatsApp (Si apre in una nuova finestra) WhatsApp
  • Fai clic per condividere su Telegram (Si apre in una nuova finestra) Telegram
  • Fai clic per inviare un link a un amico via e-mail (Si apre in una nuova finestra) E-mail

Related

Cosa ne pensi? Fammelo sapere con un messaggioAnnulla risposta

Questo sito utilizza Akismet per ridurre lo spam. Scopri come vengono elaborati i dati derivati dai commenti.

Scoprici sui social

  • YouTube
  • Telegram
  • Facebook
  • RSS Feed

    Ultimi post

    • Dave dei Vallanzaska: AI, Milano e venti di guerra – Riflessioni su 30 anni di cambiamenti
    • Libri e Social: Intervista a Sam di Rivista Matrioska | Come Creare un Progetto Culturale Online
    • Solo l’occidente conosce la Storia? Dialogo col Professor Adolfo Scotto Di Luzio
    • Ponti sospesi: cosa abbiamo sbagliato? cosa si potrebbe fare?
    • Siamo quel che facciamo? – racconto breve
    • Il limite è sempre la mente – Racconto breve
    • L’ultimo giorno del carcere – Racconto breve

    Newsletter

    • YouTube
    • Facebook
    • Telegram
    • Dave dei Vallanzaska: AI, Milano e venti di guerra – Riflessioni su 30 anni di cambiamenti
      di Alessandro Oppo
    • Libri e Social: Intervista a Sam di Rivista Matrioska | Come Creare un Progetto Culturale Online
      di Alessandro Oppo
    • Solo l’occidente conosce la Storia? Dialogo col Professor Adolfo Scotto Di Luzio
      di Alessandro Oppo
    • Ponti sospesi: cosa abbiamo sbagliato? cosa si potrebbe fare?
      di Alessandro Oppo
    • Siamo quel che facciamo? – racconto breve
      di Alessandro Oppo

    ©2025 9minuti | Design: Newspaperly WordPress Theme
    Manage Cookie Consent
    Usiamo cookie per ottimizzare il nostro sito web ed i nostri servizi.
    Cookie funzionali Sempre attivo
    The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
    Preferences
    The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
    Statistics
    The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
    Marketing
    The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
    Gestisci opzioni Gestisci servizi Gestisci {vendor_count} fornitori Per saperne di più su questi scopi
    Visualizza preference
    {title} {title} {title}