Skip to content

real-ds/Video-to-mp3-converter-runlocally

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Video to MP3 Audio Extractor 🎡

A simple yet powerful Python script to automatically extract audio from multiple video files and save them as high-quality MP3s.

πŸ“ Overview

This script uses the moviepy library to process a list of video files (.mp4, .mov, .avi, etc.) and extracts their audio tracks, saving each one as a separate .mp3 file in a designated output folder. It's designed to be easy to configure and run, even for users with minimal programming experience.

✨ Features

  • Batch Processing: Convert multiple videos in a single run.
  • Simple Configuration: Just paste your video file paths into a list.
  • Organized Output: All extracted MP3 files are saved in a clean, separate directory.
  • Error Handling: Gracefully skips missing files and handles videos that have no audio track.
  • Cross-Platform: Works on Windows, macOS, and Linux.

πŸš€ Getting Started

Follow these instructions to get the project up and running on your local machine.

βœ… Prerequisites

Make sure you have Python 3 installed on your system. You can download it from python.org.

You will also need pip, the Python package installer, which is usually included with Python installations.

βš™οΈ Installation & Setup

  1. Clone the Repository Open your terminal or Git Bash and clone this repository to your local machine:

    git clone https://github.com/real-ds/Video-to-mp3-converter-runlocally
    cd Video-to-mp3-converter-runlocally
  2. Create and Activate a Virtual Environment It's highly recommended to create a virtual environment to keep project dependencies isolated.

    # Create the virtual environment
    python -m venv venv
    
    # Activate the environment
    # On Windows:
    .\venv\Scripts\activate
    # On macOS/Linux:
    source venv/bin/activate
  3. Install Required Libraries First, Find a file named requirements.txt in the main project folder with the following content which should include all the dependencies needed to run this locally.

    pip install -r requirements.txt

USAGE

  1. Add Your Video Files Open the app.py file in a text editor. Locate the video_paths list and replace the placeholder paths with the full paths to your video files.

    # --- User Configuration ---
    
    # 1. Add the full paths to your video files here.
    video_paths = [
        r"C:\Users\YourUser\Videos\video1.mp4",
        r"D:\Family\Vacation\IMG_1234.mov",
        r"/home/user/media/another_video.avi"
    ]
    
    # 2. Specify the folder where the converted MP3 files will be saved.
    output_directory = "extracted_audio"

    πŸ’‘ Tip: On Windows, you can right-click a file, select "Copy as path," and paste it directly. Remember to keep the r before the quotes to handle backslashes correctly.

  2. Run the Script Make sure your virtual environment is activated. Then, run the script from the project directory:

    python app.py
  3. Find Your Audio Files The script will create a new folder named extracted_audio. Inside this folder, you will find all your converted .mp3 files.

    Your-Project-Folder/
    β”œβ”€β”€ extracted_audio/
    β”‚   β”œβ”€β”€ video1.mp3
    β”‚   β”œβ”€β”€ IMG_1234.mp3
    β”‚   └── another_video.mp3
    β”œβ”€β”€ app.py
    └── requirements.txt
    

🀝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

πŸ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Video to MP3 Audio Extractor 🎡 A simple yet powerful Python script to automatically extract audio from multiple video files and save them as high-quality MP3s.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages