Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 

Repository files navigation

Timestamp-it

๐Ÿ—ฃ๏ธ Video Speech Timestamp Finder

A Python tool to find when a specific phrase is spoken in a video using OpenAIโ€™s Whisper.
It transcribes your video once (caching the result) and allows you to search for phrases laterโ€”fast!


โœจ Features

  • โœ… Transcribes video audio using Whisper (tiny model for speed)
  • ๐Ÿ“ฆ Caches transcript automatically for faster repeated queries
  • ๐Ÿ” Returns precise timestamps (seconds) where your query phrase is said
  • ๐Ÿง  Supports fuzzy/approximate matching for inexact phrases
  • ๐Ÿงน Includes utility to clear cached transcripts

๐Ÿ“ฆ Tech Stack

  • Python 3.x
  • openai/whisper
  • re (regular expressions)
  • difflib
  • pickle
  • OS

๐Ÿš€ Getting Started

๐Ÿ› ๏ธ Prerequisites

Install required Python packages:

pip install git+https://github.com/openai/whisper.git
pip install torch

๐Ÿ“ฅ Installation

Clone or download this repo, or just copy the script into your project.


๐Ÿง  How It Works

1๏ธโƒฃ First time:

  • Loads Whisper โ€œtinyโ€ model for fast transcription
  • Saves the transcript as a .pkl file for caching

2๏ธโƒฃ On later runs:

  • Loads the cached transcript instantly
  • Searches text segments for your query

3๏ธโƒฃ Matching:

  • Exact or substring matches
  • Fuzzy matching for long phrases
  • Partial word matches for multi-word queries

โš™๏ธ Usage Example

๐Ÿ‘‰ Import and call in Python:

from your_module_name import get_timestamp_for_query

video_path = "your_video.mp4"
query = "your search phrase"

timestamp = get_timestamp_for_query(video_path, query)
print(f"Found at: {timestamp} seconds")


๐Ÿ”„ Cache Management

If you want to clear the cached transcript:

from your_module_name import clear_cache

clear_cache("your_video.mp4")

๐ŸŽฅ Demo

โœ… See it in action (link your video here):

๐Ÿ‘‰ Watch Demo


๐Ÿ‘ค Author

Md Shahriar Rahman Bhuiyan
๐ŸŒ LinkedIn Profile


๐Ÿ’ฌ Feedback

If you have feedback or want to collaborate, feel free to reach out via LinkedIn!

About

This script returns the the timestamp of a sentence from a user queries that was said in a video

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages