A Python script that converts all WebM video files in a folder to MP4 format at the highest possible resolution.
- 🎥 Converts WebM files to MP4 at highest quality (visually lossless)
- 📁 Automatically creates an
mp4subfolder for output files - 🔧 Preserves original video resolution and quality
- 💾 Option to keep or delete original files
- 🖥️ Windows CMD/PowerShell compatible
- 📊 Shows conversion progress and summary
Download and install Python from python.org
FFmpeg is required for video conversion. Choose one installation method:
winget install ffmpeg- Download FFmpeg from ffmpeg.org/download.html
- Extract the files to a folder (e.g.,
C:\ffmpeg) - Add the
binfolder to your system PATH environment variable
choco install ffmpeg- Download all files to a folder
- No additional Python packages required (uses standard library)
- Double-click
convert_videos.bat - Enter the folder path containing WebM files when prompted
- Wait for conversion to complete
python video_converter.py "C:\Path\To\Your\WebM\Files"python video_converter.pyThen enter the folder path when prompted.
python video_converter.py "C:\Path\To\Your\WebM\Files" --keep-original- Input: You provide a folder path containing WebM files
- Processing: The script finds all
.webmfiles in the folder - Output: Creates a new
mp4subfolder and saves converted files there - Cleanup: Optionally deletes original WebM files (default behavior)
Your folder structure:
C:\Videos\
├── video1.webm
├── video2.webm
└── video3.webm
After conversion:
C:\Videos\
├── mp4\
│ ├── video1.mp4
│ ├── video2.mp4
│ └── video3.mp4
The script uses these FFmpeg settings for highest quality:
- Video codec: H.264 (libx264)
- Quality: CRF 18 (visually lossless)
- Preset: Slow (better compression)
- Audio codec: AAC at 192k bitrate
- Optimization: Fast start for streaming
- Install FFmpeg using one of the methods above
- Restart your command prompt/PowerShell after installation
- Make sure FFmpeg is in your system PATH
- Check that the folder path is correct
- Ensure files have
.webmextension (case insensitive) - Make sure you have read permissions for the folder
- Check that you have write permissions in the target folder
- Ensure there's enough disk space
- Try with a different WebM file to isolate the issue
To create a standalone .exe file:
- Install PyInstaller:
pip install pyinstaller- Create the executable:
pyinstaller --onefile --console video_converter.py- The .exe file will be in the
distfolder
This project is free to use and modify.
If you encounter issues:
- Check that Python and FFmpeg are properly installed
- Verify the folder path is correct
- Ensure you have proper file permissions
- Try running the script with a single test file first