Coder Social home page Coder Social logo

viniciusenari / slideshow-videomaker Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 2.0 130 KB

Python scripts that take a set of pictures and an audio track and turn them into a slideshow video.

License: MIT License

Python 100.00%
moviepy moviepy-library automation python video-editing

slideshow-videomaker's Introduction

Slideshow Video Maker



🎥 Description

This repositories contains Python scripts that take a set of pictures and an audio track and turn them into a slideshow video.
It works by utilizing the Python libraries Pillow to resize images while keeping the image ratio and MoviePy to create video clips and render the video with the audio track.

🖥️ Installation Guide

Create a virtual environment.

python3 -m venv path/to/your-env

Activate your virtual environment. On Windows:

your-env\Scripts\activate.bat

On Unix or MacOS:

source your-env/bin/activate

Install dependencies

pip install -r requirements

MoviePy utilizes ImageMagick to create text images. Go to https://www.imagemagick.org/script/download.php and download and install the ImageMagick version compatible with your operating system. If you are on Windows, you will have to edit the moviepy/config_defaults.py file, which should be inside your virtual environment Lib folder, to include the path to your ImageMagick installation.

IMAGEMAGICK_BINARY = "C:\\Program Files\\ImageMagick_VERSION\\magick.exe"

▶️ How to Use

Place your images on the folder images\original and the audio track on folder song. If you want a certain order in which images appear on the video, rename the files so that the alphabetical order matches your desired order.
After that, run the app.py script.

python app.py

After you run it, it will prompt you to provide some parameters. They are the video title that will show up at beginning of the video, what resolution do you want the video to be, and the length of the audio track in seconds.

More in-depth customization

There are many parameters when doing the final render of the video. You may want to check them at VideoClip.write_videofile and set to your preferences on the write_video function in MakeVideo.py

def write_video(video, bitrate = "16000k", threads = 1, filename = "video", preset = "ultrafast", fps = 24, codec = "mpeg4"):
    video.write_videofile(f'{filename}.mp4', fps = fps, codec = codec, threads = threads, preset = preset, bitrate = bitrate)

You can customize more your title card in the create_title_text_clip function in TitleText.py. For example, you may want to change the RGB color.

def create_title_text_clip(text, frame_color = (16, 78, 139)):

🏗️ Future Features

Below is a list of possible future features that could be implemented to this repository. You are also welcomed to contribute with features not listed below.

  • Automatically find the length of the audio file.
  • Support for more than one audio file.
  • Add transitions. Fade-in/ Fade-out.

slideshow-videomaker's People

Contributors

viniciusenari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.