This repository has been archived by the owner. It is now read-only.
MP3 to YouTube - converts MP3 files into an MP4 video suitable for uploading to YouTube
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
media
.gitattributes
.gitignore
generate.bat
generate.py
readme.md
thumbnail.png

readme.md

MP3 to Youtube

Description

Creates an MP4 file suitable for YouTube uploading from an MP3. The album art is automatically extracted and made into the video background.

An example thumbnail.

Requirements

The script runs on Python 3 (tested on 3.4) and requires FFmpeg and ImageMagick. It currently runs on Windows and OS X, but should be adaptable to anywhere the required libraries run.

OS X

Installing the required libraries on OS X can be done through Homebrew:

brew install ffmpeg

brew install imagemagick

Usage

On Windows

The default configuration has FFmpeg in the folder C:\Program Files\FFmpeg and ImageMagick in the folder C:\Program Files\ImageMagick. This probably won't match your configuration, so set ffmpegDir and imagemagickDir at the top of the script.

Once that's set up, drag an MP3 with cover art onto generate.bat and the MP4 will be generated as out.mp4 in the script directory by default.

On OS X or with custom options

For non-Windows OSes, both FFmpeg and ImageMagick are assumed to be in /usr/local/bin, which is often not their location. If necessary, set ffmpegDir and imagemagickDir at the top of the script.

The script is run manually by python generate.py inputFile.mp3 [-background image.png] [-noBlur] [-doText]

  • -background image.png specifies a custom image to use for the video, instead of using the album art. Use this when the MP3 is missing album art.
  • -noBlur results in the album art being placed on a dark background instead of a blurred out version of itself.
  • -doText prints the artist and track name on the resulting video. Note: this doesn't work with the -background option currently and won't work on non-Windows OSes unless you change the font.

Current Issues

  • artist/track labeling option has some issues with positioning
  • ImageMagick binaries are used instead of libraries
  • ImageMagick path is hardcoded
  • temporary images aren't deleted

Version History

2015-05-11 - v6

  • restructured the way arguments are passed to FFmpeg and ImageMagick
  • added some error checking
  • adjustments to readme

2014-05-25 - v5

  • OS X support
  • temp folder excluded from repository
  • used os.path.join() for some filename joining
  • adjusted some error messages

2014-04-25 - v4

  • converted to Python 3 script for more flexibility
  • added artist and title support (WIP) - background can be annotated

2014-04-23 - v3

  • added support for blurring the album art as the background

2014-02-25 - v2

  • added variant for manual backgrounds

2013-10-14 - v1

  • initial version