Try It Out Here- https://caption-generator-mocha.vercel.app/
An AI-powered web application that automatically generates and applies captions to your videos using AWS Transcribe and FFmpeg. Upload a video, get automated transcription, customize the caption appearance, and download your captioned video - all in your browser!
- Automatic Video Transcription: Uses AWS Transcribe for accurate speech-to-text conversion
- Real-time Caption Overlay: Apply captions directly to your videos using FFmpeg WebAssembly
- Customizable Caption Styling:
- Choose primary text color
- Customize outline color
- Professional font rendering (Roboto)
- Progress Tracking: Real-time progress indicator during video processing
- Browser-based Processing: No server-side video processing needed
- File Upload & Management: Secure file upload with AWS S3 integration
- Responsive Design: Works seamlessly on desktop and mobile devices
- Frontend: Next.js 15, React 19, Tailwind CSS
- Video Processing: FFmpeg WebAssembly
- Transcription: AWS Transcribe
- Storage: AWS S3
- Styling: Tailwind CSS with custom components
- HTTP Client: Axios
Before running this project, make sure you have:
- Node.js 18+ installed
- AWS account with S3 and Transcribe services configured
- AWS credentials properly set up
-
Clone the repository
git clone https://github.com/yourusername/caption-generator.git cd caption-generator -
Install dependencies
npm install
-
Environment Setup Create a
.env.localfile in the root directory and add your AWS credentials:AWS_ACCESS_KEY_ID=your_access_key_id AWS_SECRET_ACCESS_KEY=your_secret_access_key AWS_REGION=your_aws_region AWS_S3_BUCKET_NAME=your_s3_bucket_name
-
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000 to see the application.
- Upload Video: Click the upload area and select your video file
- Wait for Transcription: The app will automatically upload to S3 and start transcription
- Review Captions: View the generated transcription items with timestamps
- Customize Appearance: Choose colors for caption text and outline
- Apply Captions: Click "Apply Captions" to process the video
- Download Result: Once processing is complete, download your captioned video
caption-generator/
├── src/
│ ├── app/
│ │ ├── [fileName]/ # Dynamic route for individual videos
│ │ │ └── page.js # Video processing and caption application
│ │ ├── api/
│ │ │ ├── proxy-video/ # Video streaming proxy
│ │ │ ├── transcribe/ # AWS Transcribe integration
│ │ │ └── upload/ # File upload to S3
│ │ ├── components/
│ │ │ ├── DemoSection.js # Demo/example section
│ │ │ ├── PageHeader.js # Header component
│ │ │ ├── UploadForm.js # File upload interface
│ │ │ └── transcriptionItem.js # Individual caption item
│ │ ├── fonts/ # Custom fonts (Roboto)
│ │ └── page.js # Main landing page
│ └── public/
│ └── ffmpeg/ # FFmpeg WebAssembly files
├── package.json
└── README.md
POST /api/upload- Upload video files to S3GET /api/transcribe?filename=xyz- Get transcription status and resultsGET /api/proxy-video?fileName=xyz- Stream video files from S3
You can modify caption appearance by adjusting the FFmpeg filter parameters in the transcode function:
- Font Size: Change
FontSize=30 - Position: Modify
MarginV=70 - Font Family: Update font files in
/fontsdirectory
The app uses Tailwind CSS for styling. Primary colors and themes can be customized in the component files.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- FFmpeg for video processing capabilities
- AWS Transcribe for speech-to-text services
- Next.js for the amazing React framework
- Tailwind CSS for beautiful styling
- FFmpeg Loading Issues: Ensure all FFmpeg WebAssembly files are in the
public/ffmpeg/directory - AWS Permissions: Make sure your AWS credentials have access to S3 and Transcribe services
- Video Upload Failures: Check your S3 bucket permissions and CORS configuration
If you encounter any issues, please open an issue on GitHub or contact the maintainers.