videogrep (https://github.com/antiboredom/videogrep) searches subtitle or transcript timestamps and joins the matching moments into one video: a "supercut". It can transcribe speech itself with Vosk (an offline speech recognizer), so no subtitle files are needed. The ffmpeg examples in timing/ and effects/ (slow motion, nervous jitter, Xvid crush) were used to process these supercuts further.
The command
# Transcribe every video in the folder
videogrep --input *.mp4 --transcribe
# Same, with a larger downloaded Vosk model
videogrep --input *.mp4 --transcribe --model /path/to/vosk-model
# The most frequent words, to choose what to search for
videogrep --input *.mp4 --ngrams 1
# Supercut of every "job", shuffled, with a quarter second of padding
videogrep --input *.mp4 --search 'job' --search-type fragment \
--padding 0.25 --randomize --output job.mp4 What each part does
--input / -i one or more video files
--transcribe / -tr transcribe with Vosk, writing a .json transcript
next to each video (reused on later runs)
--model / -mo a Vosk model folder (e.g. a large English model
from alphacephei.com/vosk/models) for better
accuracy than the bundled small one
--ngrams / -n 1 list the most common words across the transcripts
--search / -s the word or phrase to find
--search-type / -st sentence (default), fragment (word-level
timestamps, for single words) or mash
--padding / -p seconds to add before and after each clip
--randomize / -r shuffle the clips
--output / -o the supercut file When to use it
This is used when you have footage of people talking (interviews, lectures, news clips) and want every moment a word or phrase is spoken cut into one video. It's not an ffmpeg command: videogrep is a separate install, and it needs clear speech to transcribe. Music, heavy background noise or silent footage will give poor or empty results. The header explains each flag.
Work in three steps: transcribe once, look at the --ngrams 1 list to choose a word, then search. To keep clips in their original order, drop --randomize. For phrases rather than single words, use the default sentence search type instead of fragment. The finished supercut can go through ../timing/extreme-slowmo-12x.sh, ../effects/frei0r-nervous-slowmo-h264.sh or ../conversion/xvid-roundtrip-crush.sh.
If matches are missing, the transcript probably misheard them. Check how the word appears in the --ngrams list, or transcribe again with a larger --model. Transcripts are reused, so delete the old .json files first. If words sound clipped, raise --padding a little.
Notes
- Install
- pip install videogrep
- Source
- ffmpeg-utilities/videogrep.sh
- Changed
- -st word → --search-type fragment (current videogrep accepts only sentence, fragment or mash); -p 25 → --padding 0.25 (-p is in seconds, so 25 would add 25 s around each word); removed -t, which is no longer an option; the word-count pipeline over *.txt became --ngrams 1, since transcripts are now .json. The Vosk model path is a placeholder. Not tested here: videogrep is a separate install and needs speech to transcribe.