Skip to content

Latest commit

 

History

History
115 lines (71 loc) · 2.24 KB

File metadata and controls

115 lines (71 loc) · 2.24 KB

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!