Extract relevant clips from YouTube videos or other media sources based on your topic of interest.
- Extract clips from YouTube videos or other media sources
- Process media files based on user-provided topics
- Provide extracted clips with timestamps and transcript
- Combine relevant clips into a single video file
- Chrome Extension: Extract clips directly while browsing YouTube. Tap on extracted content with its timestamp to play the video from that point. See Chrome Extension Setup
##Demo
clips_extractor_chrome_extension_webapp_demo.mp4
The application consists of:
- Frontend: Next.js React application with TypeScript and Tailwind CSS
- Backend: Python FastAPI application
- Media Processing: FFmpeg, OpenAI Whisper for transcription, and GPT-4 for topic extraction
- Storage: AWS S3 for media storage
- Chrome Extension: Integrates with YouTube to extract and play clips based on selected content
You can start both the backend and frontend development servers with a single command using the provided shell script.
- Python 3.9+ (with venv and all backend dependencies installed)
- Node.js 18+ and npm (with frontend dependencies installed)
- FFmpeg installed on your system
- Properly configured
.env
files for backend and frontend
From the project root directory, run:
./start-dev.sh
This will:
- Start the backend server (FastAPI) on port 8000
- Start the frontend server (Next.js) on port 3000
- Both processes will run in the background and shut down together when you stop the script (Ctrl+C)
- Node.js 18+ and npm
- Python 3.9+
- FFmpeg installed on your system
- AWS account with S3 bucket
- OpenAI API key (required for transcription and clip extraction)
-
Navigate to the backend directory:
cd backend
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.env
file based on.env.example
and fill in your credentials:cp .env.example .env # Edit .env file with your credentials
-
Required environment variables:
# OpenAI Configuration (Required) OPENAI_API_KEY=your_openai_api_key # For local LLMs (Optional) # OPENAI_BASE_URL=http://localhost:1234/v1 # AWS Configuration (Required for production, optional for development) AWS_ACCESS_KEY_ID=your_aws_access_key AWS_SECRET_ACCESS_KEY=your_aws_secret_key AWS_REGION=us-west-2 S3_BUCKET_NAME=clips-extractor-media
-
Run the backend server:
uvicorn app.main:app --reload
-
Navigate to the frontend directory:
cd frontend
-
Install dependencies:
npm install
-
Create a
.env.local
file:echo "NEXT_PUBLIC_API_URL=http://localhost:8000/api" > .env.local
-
Run the development server:
npm run dev
-
Open http://localhost:3000 with your browser to see the application.
The Chrome extension allows you to extract and play relevant clips directly on YouTube. Tapping on the extracted content with its timestamp will play the video from that point. For setup and usage instructions, see Chrome Extension Setup.
This application uses OpenAI's APIs for two key functions:
- Audio Transcription: Uses the
whisper-1
model to transcribe audio from videos - Clip Extraction: Uses the
gpt-4o-mini
model to identify relevant sections in the transcript
You must provide a valid OpenAI API key in the .env
file. Without this key, the application will not function properly.
For development with a local LLM, you can set the OPENAI_BASE_URL
environment variable to point to your local LLM API endpoint.
The backend includes Mangum for AWS Lambda deployment. You can use AWS SAM or Serverless Framework to deploy it.
You can deploy the Next.js frontend to Vercel, Netlify, or any other hosting service that supports Next.js.