A web application that converts video files to MP3 format using FFmpeg.

Video Demo:
final.mp4
- Upload video files (MP4, AVI, MOV, MKV, WebM, FLV, etc.)
- Convert videos to MP3 format only
- Real-time progress tracking with visual feedback
- Download converted MP3 files
- File size validation (max 500MB, configurable)
- Modern, responsive UI with drag & drop support
- Bun Runtime - Fast JavaScript runtime for server-side operations
- FFmpeg - Powerful multimedia framework for video/audio conversion
- Bash Scripting - Shell scripts for FFmpeg command execution
- Node.js APIs - File system operations and process management
- React - Modern UI framework with hooks
- TailwindCSS - A utility-first CSS framework
- TypeScript - Type-safe JavaScript development
- Bun Package Manager - Fast dependency management
- TypeScript Compiler - Static type checking
Note: This application currently only supports MP3 output format. The convert.sh
script is configured to:
- Extract audio from video files using FFmpeg
- Convert to MP3 using the
libmp3lame
codec with quality-q:a 4
- Remove video stream (
-vn
flag) - Handle large files up to 500MB (configurable)
- Generate unique filenames with timestamps
- Automatic cleanup of temporary files
- Clone the repository:
git clone <repository-url>
cd video-to-sound
- Install dependencies:
bun install
- Make sure FFmpeg is installed:
# On Ubuntu/Debian
sudo apt update && sudo apt install ffmpeg
# On macOS
brew install ffmpeg
# On Windows
# Download from https://ffmpeg.org/download.html
- Start the development server:
bun run dev
-
Open your browser and navigate to
http://localhost:3000
-
Select a video file and click "Convert to MP3"
-
Wait for the conversion to complete
-
Download your converted MP3 file
- File Upload: The frontend accepts video files through a file input or drag & drop
- Validation: Files are validated for type (video) and size (max 500MB, configurable)
- Upload: Video files are uploaded to the server and stored in the
uploads/
directory - Conversion: The server uses the
convert.sh
script with FFmpeg to convert the video to MP3 - Download: Converted MP3 files are stored in the
downloads/
directory and can be downloaded
POST /api/convert
- Upload and convert a video file to MP3GET /api/download/:filename
- Download a converted MP3 file
video-to-sound/
โโโ src/
โ โโโ VideoConverter.tsx # Main conversion component with drag & drop
โ โโโ App.tsx # Main app component and routing
โ โโโ index.tsx # Server entry point with API endpoints
โ โโโ index.css # Modern responsive styles
โ โโโ index.html # HTML template
โ โโโ logo.svg # Application logo
โ โโโ react.svg # React logo
โโโ uploads/ # Temporary video files storage
โโโ downloads/ # Converted MP3 files storage
โโโ convert.sh # FFmpeg conversion script (MP3 only)
โโโ temp_convert_*.sh # Temporary conversion scripts (auto-generated)
โโโ package.json # Dependencies and scripts
โโโ bun.lock # Bun lock file
โโโ tsconfig.json # TypeScript configuration
โโโ build.ts # Build configuration
โโโ README.md # Project documentation
The convert.sh
script uses FFmpeg with the following settings:
- Input: Any video format supported by FFmpeg
- Output: MP3 format only
- Audio codec:
libmp3lame
- Quality:
-q:a 4
(good quality, reasonable file size) - Video removal:
-vn
(extract audio only)
ffmpeg -i "input_video.mp4" \
-vn -acodec libmp3lame -q:a 4 \
"output_audio.mp3"
- Video Processing: Handles multiple video formats
- Audio Extraction: Converts video audio tracks to high-quality MP3
- Batch Processing: Can handle multiple files sequentially
- Error Handling: Comprehensive error handling with user-friendly messages
- Modern Interface: Drag & drop file upload with progress tracking
- File Validation: Automatic file type and size validation
- Responsive Design: Works on desktop, tablet, and mobile devices
- TypeScript: Full type safety throughout the application
- Modern React: Uses React 18 with hooks and modern patterns
- Server-Side Processing: FFmpeg runs on the server for better performance
- File Management: Automatic cleanup and organized file storage
- API Design: RESTful API with proper error handling and status codes
- Fast Runtime: Bun provides excellent performance for Node.js operations
- Efficient Conversion: FFmpeg optimized for audio extraction
- Memory Management: Proper file handling and cleanup
- Configurable Limits: Adjustable file size limits and quality settings
bun run dev
- Start development server with HMRbun run start
- Start production serverbun run build
- Build for production
- FFmpeg not found: Make sure FFmpeg is installed and accessible in your PATH
- Permission denied: Ensure the
convert.sh
script is executable:chmod +x convert.sh
- Large file uploads: The application limits file size to 500MB for performance
- Conversion fails: Check the server logs for FFmpeg error messages
- Format not supported: Currently only MP3 output is supported
To support additional audio formats, the convert.sh
script would need to be modified to:
- Accept format parameters
- Use different audio codecs (e.g.,
libvorbis
for OGG,aac
for M4A) - Adjust quality settings for different formats
- Add support for different audio quality presets
- Implement batch processing for multiple files
- Add audio format detection and automatic codec selection
MIT License