AI-powered ffmpeg command generator. Describe what you want to do with your video or audio, and get the exact ffmpeg command instantly.
- Natural language input — Describe your video/audio task in plain English
- AI-generated commands — Uses OpenRouter to generate optimal ffmpeg commands
- Command history — Save and reuse previously generated commands
- One-click copy — Copy commands to clipboard instantly
- Downvote & regenerate — Get alternative commands if the first isn't right
- Rate limiting — Built-in protection against abuse
- URL-shareable prompts — Share commands via query parameters
- Framework: Next.js 16 with App Router
- Styling: Tailwind CSS + shadcn/ui components
- AI: Vercel AI SDK + OpenRouter
- State Management: nuqs for URL state
- Icons: Phosphor Icons
- Node.js 20+
- pnpm (recommended)
- OpenRouter API key
- Clone the repository:
git clone <repo-url>
cd ffmpeg-ai- Install dependencies:
pnpm install- Create a
.env.localfile:
OPENROUTER_API_KEY=your_openrouter_api_key
MODEL=z-ai/glm-4.5-air:free # Optional: defaults to free model- Run the development server:
pnpm dev- Enter a description of your video/audio task (e.g., "convert mov to mp4 and compress")
- Press Enter or click the arrow button
- Copy the generated ffmpeg command
- Run it in your terminal
- "Convert a mov file to mp4 and compress it"
- "Extract audio from a video as mp3"
- "Trim a video from 00:30 to 01:30"
- "Resize video to 1080p and add a watermark"
- "Convert video to GIF with 15fps"
pnpm dev— Start development server with Turbopnpm build— Build for productionpnpm start— Start production serverpnpm lint— Run ESLint
app/
├── api/generate/ # API route for AI command generation
├── home-content.tsx # Main application logic
├── page.tsx # Root page component
├── layout.tsx # Root layout with providers
└── globals.css # Global styles
components/
├── prompt-input.tsx # User input component
├── command-display.tsx # Command output with actions
├── command-history.tsx # Saved commands list
├── example-chips.tsx # Example prompt buttons
└── ui/ # shadcn/ui components
lib/
├── sanitize.ts # Input sanitization
├── rate-limit.ts # Rate limiting logic
├── localstorage.ts # History persistence
└── prompt-cache.ts # Caching utilities
| Variable | Description | Required |
|---|---|---|
OPENROUTER_API_KEY |
Your OpenRouter API key | Yes |
MODEL |
OpenRouter model identifier | No |
MIT
