A Python script to convert video files to MP3 audio files.
- Python 3.6 or higher
- ffmpeg
brew install ffmpeg
sudo apt-get install ffmpeg
Download and install from ffmpeg official website.
- Make the script executable (optional):
chmod +x video_to_mp3.py
- Run the script:
python3 video_to_mp3.py
Or:
./video_to_mp3.py
- Input:
.mov,.mp4,.avi,.mkv,.flv,.wmv,.m4v,.webm - Output:
.mp3(192kbps, 44.1kHz)
- Automatically detects video files in the
videofolder - Converts each video file to MP3 format
- Saves MP3 files to the
audiofolder - Skips files that already exist
.
├── video/ # Place your video files here
├── audio/ # Converted MP3 files will be saved here
└── video_to_mp3.py # The conversion script
MIT