Skip to content

Commit

Permalink
added version and many automatically generated doc files
Browse files Browse the repository at this point in the history
  • Loading branch information
Zulko committed Feb 22, 2014
1 parent eed0587 commit aa5f246
Showing 45 changed files with 397 additions and 236 deletions.
120 changes: 17 additions & 103 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
MoviePy
========

MoviePy is a Python module for script-based movie editing, which enables
basic operations (cuts, concatenations, title insertions) to be done
in a few lines. It can also be used for advanced compositing.

See the full documentation and demo videos here_, or have a look at this page of `animated GIFs made with MoviePy <http://zulko.github.io/blog/2014/01/23/making-animated-gifs-from-video-files-with-python/>`_.
MoviePy (full documentation here_) is a Python module for script-based movie editing.

It can read and write to many formats, `including animated GIFs <http://zulko.github.io/blog/2014/01/23/making-animated-gifs-from-video-files-with-python/>`_, and enables basic operations (cuts, concatenations, title insertions) to be done in a few lines. It can also be used for advanced compositing.

A typical MoviePy script looks like that: ::

@@ -27,116 +24,33 @@ A typical MoviePy script looks like that: ::



Contribute !
-------------
MoviePy is an open-source software originally written by Zulko_ and released under the MIT licence.
The project is hosted on Github_ and everyone is welcome to contribute ! Please give feedback if you are using it and encounter difficulties.

The project is hosted on Github_ , where everyone is welcome to contribute and give feedback.

Download and Installation
---------------------------

MoviePy requires the Python modules Numpy_, Decorator_, and tqdm_. All of these will all be automatically installed during MoviePy's installation.
You will also need a **recent version** of the software ffmpeg_ , preferably downloaded directly from the ffmpeg website.
If you intend to use advanced features you will also need a few other dependencies like ImageMagick_ , Pygame_ etc. (see `the docs <http://zulko.github.io/moviepy/install.html>`_).

Dependencies
~~~~~~~~~~~~~

MoviePy cannot run without these dependencies:

- The software ffmpeg_ is needed for writing, reading, converting the sound and the video.
- `Numpy`_ is needed for image and sound manipulation.
- The Decorator_ module is used in the MoviePy code for better code readability.

**Make sure to use a recent version of ffmpeg**.
You can either install it or save the binary files in any folder and specify the path to these folders before installing MoviePy (for the latter, see `Manual installation`_ below).

**Debian and Ubuntu users**, you certainly have an out-of-date version of ffmpeg, you *must* download a recent version from the ffmpeg_ website.

Normally Numpy and Decorator will be automatically installed when you install MoviePy. In case of doubt/problem they can also be installed manually.
Numpy can be installed with most software managers on Linux distributions. Both Numpy and Decorator can be installed as follows with pip: ::

(sudo) pip install decorator
(sudo) pip install numpy


(Not so) Optional dependencies
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You are not obliged to install these but for many uses MoviePy will scream at you and say that the package or the software is missing. All these dependencies can be installed any time after the installation of MoviePy.

- PyGame_ is needed for video and sound previews (really essential for advanced editing).
- imageMagick_ is needed for all text generation, GIF support, and much more in the future.

There are many packages for image manipulation/processing in python. Most effects are coded such that none of these packages are needed, or such that having at least one of these packages is sufficient. For instance, the feature ``clip.resize`` will be available if you have either Scikit Image *or* the PIL *or* OpenCV installed (PIL or OpenCV are to be prefered).

- Scipy is needed for many advanced functionalities (tracking, segmenting, etc.)
- `Scikit Image`_ may be needed for some advanced image manipulation.
- The Python Imaging Library can be used for resizing videos.
- `OpenCV 2.4.6`_ (which provides the python package ``cv2``) or more recent may be needed for some advanced image manipulation. See below for the installation of OpenCV.

If you are on linux, these will surely be in your repos.
Installation
--------------


Installation with PIP
~~~~~~~~~~~~~~~~~~~~~~~~~~

On Linux, if you have pip installed, just type this in a terminal ::
sudo pip install moviepy

Maybe it works with easy_install too, but it hasn't been fully tested yet.



.. _manual_install:


Manual installation
~~~~~~~~~~~~~~~~~~~~~~~~~~

You can install moviepy manually by downloading the sources, either on PYPI_ or (if you want the development version) on Github_ .

Then just unzip everything in one folder, open a terminal and type ::
First method : if you have ``pip`` installed, just type this in a terminal (sudo is optional on some systems) ::
sudo python setup.py install
(sudo) pip install moviepy

Before doing that, you should make sure that MoviePy can locate ffmpeg on your computer. To do that, run the script ``moviepy/conf.py``. It it fails, then you must enter the path in the first line of this file ::
Second method : by hand. Download the sources, either on PyPI_ or (if you want the development version) on Github_, unzip everything in one folder, open a terminal and type ::
FFMPEG_BINARY = path/to/your/ffmpeg

Installing OpenCV 2.4.6
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

OpenCV is very optional, its installation is not always simple and I found it to be unstable, be warned. The installation seems easy for Windows. On linux, here is what I found on the Internet:

- Remove any other version of OpenCV if you installed it through a package manager.
- Unzip the source code of `OpenCV 2.4.6`_ in some folder. open a terminal in this folder.
- Make a new directory and go into this directory: ::
mkdir release
cd release
- Run ``cmake``. Here is the line I used: ::
cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=OFF -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON ..
- Run ``make``. This may take a few minutes (15 minutes on my computer). ::
make
- Finally, install. ::
sudo make install
And voilà !

You can check if it worked by opeing a Python console and typing ::
(sudo) python setup.py install
import cv2
print cv2.__version__
Linking to ffmpeg
~~~~~~~~~~~~~~~~~~

Advice: do not throw your ``release`` folder away. If later you have strange bugs with OpenCV involving ``.so`` files, just redo the ``sudo make install`` step.
If you put have a ffmpeg binary in you executable folder (on Linux it will be ``/usr/bin``) it will be detected automatically by MoviePy. Else make sure that MoviePy can locate ffmpeg on your computer by running the script ``moviepy/conf.py`` that is in the sources. It it fails, then you must enter the path to the FFMPEG executable in the first line of this file ::
FFMPEG_BINARY = path/to/your/ffmpeg



@@ -153,4 +67,4 @@ Advice: do not throw your ``release`` folder away. If later you have strange bug


.. _ffmpeg: http://www.ffmpeg.org/download.html
.. _imageMagick: http://www.imagemagick.org/script/index.php
.. _ImageMagick: http://www.imagemagick.org/script/index.php
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXOPTS = -E
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = ../../docs
6 changes: 5 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -26,7 +26,11 @@
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo',
'sphinx.ext.viewcode', 'numpydoc', 'sphinx.ext.autosummary']
'sphinx.ext.viewcode', 'sphinx.ext.autosummary','numpydoc']

numpydoc_class_members_toctree= False
numpydoc_show_class_members= False
autosummary_generate= True

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Binary file added docs/crash_course/explanations.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 0 additions & 15 deletions docs/examples/logo.rst
Original file line number Diff line number Diff line change
@@ -15,19 +15,4 @@ MoviePy logo with a moving shadow

Here the logo is a picture, while the shadow is actually a black rectangle taking the whole screen, overlaid over the logo, but with a moving mask composed of a bi-gradient, such that only one (moving) part of the rectangle is visible. See :ref:`gradients` for the code of the function `biGradient`: ::
def f(t,size,duration, a = np.pi/3, thickness = 20):
w,h = size
v = thickness* np.array([np.cos(a),np.sin(a)])[::-1]
center = [int(t*w/duration),h/2]
return biGradientScreen(size,center,v,0.6,0.0)

w,h = moviesize = (720,380)
im = ImageClip("./logo_descr.png", transparent=True)
im = im.resize(width=w/2)

duration = 1
shade = ColorClip(moviesize,col=(0,0,0)).with_mask()
shade.mask.get_frame = lambda t : f(t,moviesize,duration)
cc = CompositeVideoClip(moviesize,[im.set_pos(2*["center"]),shade])

cc.subclip(0,duration).to_videofile("moviepy_logo.avi",fps=24)
2 changes: 1 addition & 1 deletion docs/examples/the_end.rst
Original file line number Diff line number Diff line change
@@ -21,4 +21,4 @@ that circle is so large that you see all the actual movie and you don't see
the "The End" clip. Then the circle becomes progressively smaller and as a
consequence you see less of the actual movie and more of the "The End" clip.

../../examples/the_end.py
.. literalinclude:: ../../examples/the_end.py
8 changes: 3 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
MoviePy
=======

MoviePy is a Python module for script-based movie editing. It enables basic operations (cuts, concatenations, title insertions) to be done in a few lines, and can be used for advanced compositing and special effects. It can read and save to many formats, including `animated GIFs <http://zulko.github.io/blog/2014/01/23/making-animated-gifs-from-video-files-with-python>`_.
MoviePy is a Python module for script-based movie editing. It enables basic operations (cuts, concatenations, title insertions) to be done in a few lines, and can be used for advanced compositing and special effects.

It can read and write to many formats, `including animated GIFs <http://zulko.github.io/blog/2014/01/23/making-animated-gifs-from-video-files-with-python>`_.

Let us put together a few demonstration clips (you will find the code for most of these in the :ref:`examples`): ::
@@ -58,10 +60,6 @@ User's Guide
ref/ref


.. raw:: html



.. _PyPI: https://pypi.python.org/pypi/moviepy
.. _Github: https://github.com/Zulko/moviepy
.. _Zulko: https://github.com/Zulko/
3 changes: 2 additions & 1 deletion docs/install.rst
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ First method : if you have ``pip`` installed, just type this in a terminal (sudo
(sudo) pip install moviepy

Second method : by hand. Download the sources, either on PYPI_ or (if you want the development version) on Github_, unzip everything in one folder, open a terminal and type ::
Second method : by hand. Download the sources, either on PyPI_ or (if you want the development version) on Github_, unzip everything in one folder, open a terminal and type ::
(sudo) python setup.py install
@@ -95,6 +95,7 @@ Advice: do not throw your ``release`` folder away. If later you have strange bug
.. _`Scikit Image`: http://scikit-image.org/download.html

.. _Github: https://github.com/Zulko/moviepy
.. _PyPI: https://pypi.python.org/pypi/moviepy
.. _`OpenCV 2.4.6`: http://sourceforge.net/projects/opencvlibrary/files/


24 changes: 15 additions & 9 deletions docs/ref/VideoClip.rst → docs/ref/VideoClip/VideoClip.rst
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
.. ref_VideoClip:
************
VideoClip
************
***********************
Classes of Video Clips
***********************


.. currentmodule:: moviepy

:class:`VideoClip`
==========================

.. autoclass:: moviepy.video.VideoClip.VideoClip
:members:
:show-inheritance:



:class:`VideoFileClip`
------------------------

.. autoclass:: moviepy.video.io.VideoFileClip.VideoFileClip
:members:
:show-inheritance:



:class:`ImageClip`
----------------------

.. autoclass:: moviepy.video.VideoClip.ImageClip
:members:
:show-inheritance:



:class:`ColorClip`
------------------
@@ -39,15 +47,13 @@ VideoClip
.. autoclass:: moviepy.video.VideoClip.TextClip
:members:
:show-inheritance:




:class:`CompositeVideoClip`
-------------------------------

.. autoclass:: moviepy.video.compositing.CompositeVideoClip.CompositeVideoClip
:members:
:show-inheritance:

Useful Methods
--------------

.. automodule:: moviepy.video.compositing.concatenate.concatenate
2 changes: 1 addition & 1 deletion docs/ref/ffmpeg.rst
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
FFMPEG tools
----------------------------

.. automodule:: moviepy.video.io.ffmpeg
.. automodule:: moviepy.video.io.ffmpeg_tools
:members:
:undoc-members:
:show-inheritance:
2 changes: 1 addition & 1 deletion docs/ref/ref.rst
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ The documentation may be a little messy for the moment, it will get better with
:maxdepth: 3

Clip
VideoClip
VideoClip/VideoClip
AudioClip
videofx
audiofx
47 changes: 40 additions & 7 deletions docs/ref/videofx.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,44 @@
.. ref_videofx:
************
video.fx
************
This module regroups functions meant to be used with ``videoclip.fx``. When you type ``from moviepy import *``, the module ``video.fx`` is loaded as ``vfx`` and you can use ``vfx.colorx``, ``vfx.resize``, etc.
***********************
moviepy.video.fx (vfx)
***********************
The module ``moviepy.video.fx`` regroups functions meant to be used with ``videoclip.fx``. When you type ::
from moviepy.editor import *

the module ``video.fx`` is loaded as ``vfx`` and you can use ``vfx.colorx``, ``vfx.resize``, etc.

.. automodule:: moviepy.video.fx
:members:
:show-inheritance:

.. currentmodule:: moviepy.video.fx

.. autosummary::
:toctree: videofx
:nosignatures:

blackwhite
blink
colorx
crop
fadein
fadeout
freeze_at_end
freeze_at_start
gamma_corr
headblur
loop
lum_contrast
make_loopable
margin
mirror_x
mirror_y
painting
resize
rotation
scroll
speedx
time_mirror
time_symetrize



6 changes: 6 additions & 0 deletions docs/ref/videofx/moviepy.video.fx.blackwhite.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
moviepy.video.fx.blackwhite
===========================

.. currentmodule:: moviepy.video.fx

.. autofunction:: blackwhite
6 changes: 6 additions & 0 deletions docs/ref/videofx/moviepy.video.fx.blink.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
moviepy.video.fx.blink
======================

.. currentmodule:: moviepy.video.fx

.. autofunction:: blink
6 changes: 6 additions & 0 deletions docs/ref/videofx/moviepy.video.fx.colorx.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
moviepy.video.fx.colorx
=======================

.. currentmodule:: moviepy.video.fx

.. autofunction:: colorx
Loading

0 comments on commit aa5f246

Please sign in to comment.