Skip to content

Efficiently transform MP3 audio files into MP4 videos with static imagery, perfect for content creators aiming to upload on platforms like YouTube. Simple and direct audio to video converter to run locally in your machine without the need to upload files.

devfel/mp3-to-mp4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevFel

🎵 MP3 to MP4 Converter 🎬

Convert your favorite MP3 files into MP4 videos with static images, perfect for uploading to platforms like YouTube.

🌟 Features

  • Convert any MP3 file into an MP4 video.
  • Add a static image to your audio, ideal for music uploads on video platforms.
  • (Optional) Specify a start and end time to convert only a segment of your audio.

⚙️ Installation and Setup

  1. Clone the Repository: Begin by cloning the repository to your local machine:

    git clone https://github.com/devfel/mp3-to-mp4.git
  2. Navigate to the Directory:

    cd mp3-to-mp4
  3. Install the Required Libraries: Ensure you have the required libraries installed:

    pip install moviepy pillow

🚀 Getting Started

  1. Place your MP3 files and the desired image inside the input directory.
  2. Run main.py to initiate the conversion.
  3. Collect the converted MP4 files from the output directory.

📖 Usage Examples

  • Basic Conversion: Convert an entire MP3 file with a static image:

    mp3_to_mp4("sample.mp3", "background-image.jpg")
  • Segmented Conversion: Convert a specific segment of the MP3 file:

    mp3_to_mp4("sample.mp3", "background-image.jpg", "1:30:00", "1:35:00")
    mp3_to_mp4("sample.mp3", "background-image.jpg", "H:MM:SS", "H:MM:SS")
  • Entire Folder Conversion: To convert all MP3 files present in the input directory at once using a single background image, you can use the mp3_to_mp4_folder function:

    Simply call the mp3_to_mp4_folder function with the desired background image:

    mp3_to_mp4_folder("background-image.jpg")

    This will convert all MP3 files in the input directory using the specified image as the background, and save the resulting MP4 files in the output directory.

🔥 Execution

To run the program, navigate to the project's main directory and execute:

python main.py

🔧 Requirements

  • Python 3.x
  • moviepy library
  • Pillow (PIL)
  • (Optional) ImageMagick for advanced image processing.

📂 Directory Structure

  • input/: Place your MP3 and image files here.
  • output/: Find your converted MP4 files here.
  • main.py: Main script to run the conversion.

🙌 Contribution

Feel free to fork the project, open issues, and provide pull requests.

📜 License

This project is licensed under the MIT License.

About

Efficiently transform MP3 audio files into MP4 videos with static imagery, perfect for content creators aiming to upload on platforms like YouTube. Simple and direct audio to video converter to run locally in your machine without the need to upload files.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages