Giter Site home page Giter Site logo

img-to-mp4's Introduction

img-to-mp4

Python 3.6 License: MIT

Python 3 command line tool for converting images into mp4 video/slideshow with optional audio and frame titles.

Requirements

Tool has dependency on PIL image processing library, so it has to be installed on the system.

pip install pillow

Another dependency is ffmpeg command line tool, which can be installed from https://www.ffmpeg.org/download.html

Usage

Put all input images in one directory on the local filesystem and name them using following pattern:

<ORDER OF IMAGE IN VIDEO WITH LEADING ZEROES>-<DURATION OF FRAME IN SECONDS>-<TITLE YOU WANT TO APPEAR IN FRAME>.<FILE EXTENSION>.

Example of one such file name: 014-6-West side slopes in rain.jpg

Path to directory with input images is the only mandatory input argument with option -i or --input.

Other optional arguments are

  • -a or --audio, path to audio file on local disk in mp3 or m4a format that you want to play in resulting video. If ommited, no audio will be used to produce output.
  • -f or --font, path to TrueType font file on local disk to be used for frame title (appears in the lower left corner of each image). If ommited, frames will have no titles.
  • -o or --output, path to resulting mp4 video file on local disk. Defaults to out.mp4 in current directory.

Usage example

% python3 img_to_mp4.py -i /Users/username/Pictures/prepared_pictures/ -a /Users/username/Music/loop.mp3 -f /Library/Fonts/Arial.ttf -o /Users/username/Desktop/slideshow.mp4

img-to-mp4's People

Contributors

iblagojevic 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.