Giter VIP home page Giter VIP logo

ffmpeg-python-wrapper's Introduction

ffmpeg-python-wrapper

ffmpeg-python-wrapper is a lightweight python binder built for the FFmpeg library. Unlike most of the other Ffmpeg python bindings, this project focuses on providing user friendly documentation and clear & simple syntax to perform music, image, and video editing tasks.

Example Creations

Prerequisites

You need FFmpeg to be installed on your computer. If not, please follow the instructions below to get it.

Installing FFmpeg in Windows

  1. Download a static build from here.
  2. Use 7-Zip to unpack it in the folder of your choice.
  3. Open a command prompt with administrator's rights.
    NOTE: Use CMD.exe, do not use Powershell! The syntax for accessing environment variables is different from the command shown in Step 4 - running it in Powershell will overwrite your System PATH with a bad value.
  4. Run the command (see note below; in Win7 and Win10, you might want to use the Environmental Variables area of the Windows Control Panel to update PATH):
    setx /M PATH "path\to\ffmpeg\bin;%PATH%"
    Do not run setx if you have more than 1024 characters in your system PATH variable. See this post on SuperUser that discusses alternatives. Be sure to alter the command so that path\to reflects the folder path from your root to ffmpeg\bin.
    (Here's another explanation with pictures.)

Installing FFmpeg in OS X

Here are a couple of links to instructions:
http://www.idiotinside.com/2016/05/01/ffmpeg-mac-os-x/
http://macappstore.org/ffmpeg/

Installing FFmpeg in Ubuntu

sudo add-apt-repository ppa:mc3man/trusty-media  
sudo apt-get update  
sudo apt-get install ffmpeg  
sudo apt-get install frei0r-plugins  

Helpful links for Ubuntu users: http://wiki.razuna.com/display/ecp/FFmpeg+Installation+for+Ubuntu#FFmpegInstallationforUbuntu-Installlibfdk-aac
http://www.webupd8.org/2014/11/ffmpeg-returns-to-official-ubuntu.html
http://linuxg.net/how-to-install-ffmpeg-2-6-1-on-ubuntu-15-04-ubuntu-14-10-ubuntu-14-04-and-derivative-systems/
http://ffmpeg.org/download.html
http://askubuntu.com/questions/432542/is-ffmpeg-missing-from-the-official-repositories-in-14-04

Usage Examples

Creating a subclip of a video

video = Media('path_to_video')
video.subclip(10,30)

Setting duration

music = Media('path_to_music')
music.set_duration(80)

Looping Video

video = Media('path_to_video')
target_duration = 120
video.loop(target_duration)

Reshaping Media

image = Media('path_to_image')
new_size = [720,360]
image.set_size(new_size)

Concatenating Clips

clip_list = ['path_to_video1', 'path_to_video2']
concatenate_clips(clip_list, 'output_name.mp4')

Contributing

This project is in the very early stages of development. Please feel free to fork the repository and mess around with it.

  • For small changes, please open a pull request
  • For larger changes, please start an issue so other people can weigh in. Otherwise, feel free to contact me at my email.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

ffmpeg-python-wrapper's People

Contributors

philipk19238 avatar

Watchers

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