Skip to content

Video editing with Python

Big rewrite of the docs

Valentinaebcc37bf649
diff --git a/docs/Makefile b/docs/Makefile
index a1f83541..c077a760 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -2,7 +2,7 @@
#
# You can set these variables from the command line.
-SPHINXOPTS = -E
+SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = ../../docs
diff --git a/docs/_themes/kr/layout.html b/docs/_themes/kr/layout.html
index 44a64fe8..368f4abe 100644
--- a/docs/_themes/kr/layout.html
+++ b/docs/_themes/kr/layout.html
@@ -8,13 +8,14 @@
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
{% endblock %}
-{% block sidebar %}
-{% endblock %}
-
-{% block sidebar2 %}
- {{ sidebar() }}
-{% endblock %}
+{% if pagename != 'index' %}
+ {% block sidebar %}
+ {% endblock %}
+ {% block sidebar2 %}
+ {{ sidebar() }}
+ {% endblock %}
+{% endif %}
{% block header %}
{{ super() }}
diff --git a/docs/conf.py b/docs/conf.py
index 98480948..3adc9ae4 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -46,7 +46,7 @@ master_doc = 'index'
# General information about the project.
project = u'MoviePy'
-copyright = u'2013, Zulko'
+copyright = u'2014, Zulko'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
diff --git a/docs/crash_course/crash_course.rst b/docs/crash_course/crash_course.rst
index 232145b4..baee5bd7 100644
--- a/docs/crash_course/crash_course.rst
+++ b/docs/crash_course/crash_course.rst
@@ -1,3 +1,5 @@
+.. _crashcourse:
+
A MoviePy crash-course
-----------------------
diff --git a/docs/gallery.rst b/docs/gallery.rst
index 80cfd30b..6a43c18a 100644
--- a/docs/gallery.rst
+++ b/docs/gallery.rst
@@ -1,17 +1,50 @@
+.. _gallery:
+
+
Gallery
========
-The gallery will certainly fill up as more people start using MoviePy (which is currently less than one year old).
-
+Here are a few projects using MoviePy. The gallery will fill up as more people start using MoviePy (which is currently less than one year old). If you have a nice project with MoviePy let us know !
Videos edited with Moviepy
---------------------------
+
+The (old) MoviePy reel video.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This video was made when MoviePy was a few weeks old, it has gotten betten since. The code for most of these scenes can be found
+in the :ref:`examples` section.
+
+.. raw:: html
+
+ <center>
+ <object><param name="movie"
+ value="http://www.youtube.com/v/zGhoZ4UBxEQ&hl=en_US&fs=1&rel=0">
+ </param><param name="allowFullScreen" value="true"></param><param
+ name="allowscriptaccess" value="always"></param><embed
+ src="http://www.youtube.com/v/zGhoZ4UBxEQ&hl=en_US&fs=1&rel=0"
+ type="application/x-shockwave-flash" allowscriptaccess="always"
+ allowfullscreen="true" width="490" height="390"></embed></object>
+ </center>
+
+
The Cup Song Covers Mix
~~~~~~~~~~~~~~~~~~~~~~~~
-This video (link) is a mix of 60 covers of the Cup Song which demonstrates non-linear video editing capabilities of MoviePy. The code that generated the script (not commented) can be found here.
+This video is a mix of 60 covers of the Cup Song which demonstrates non-linear video editing capabilities of MoviePy. The code that generated the script (not commented) can be found here.
+
+.. raw:: html
+ <center>
+ <object><param name="movie"
+ value="http://www.youtube.com/v/rIehsqqYFEM&hl=en_US&fs=1&rel=0">
+ </param><param name="allowFullScreen" value="true"></param><param
+ name="allowscriptaccess" value="always"></param><embed
+ src="http://www.youtube.com/v/rIehsqqYFEM&hl=en_US&fs=1&rel=0"
+ type="application/x-shockwave-flash" allowscriptaccess="always"
+ allowfullscreen="true" width="490" height="390"></embed></object>
+ </center>
Gifs edited with MoviePy
--------------------------
@@ -27,17 +60,17 @@ Programs and Scripts using MoviePy
Videogrep
~~~~~~~~~~
-If you liked it there is also [this blog post] which attempts to cut a video precisely at the beginning and end of sentences or words, and this blog post in which MoviePy automatically cuts together all the highlights of a soccer game, based on the fact that the crowd cheers louder when something interesting happens.
+If you liked it there is also this blog post which attempts to cut a video precisely at the beginning and end of sentences or words, and this blog post in which MoviePy automatically cuts together all the highlights of a soccer game, based on the fact that the crowd cheers louder when something interesting happens.
MoviePy online
----------------
-Rinconcam
-~~~~~~~~~~~
+ Rinconcam
+ ~~~~~~~~~~~
-Rincomcam (link) is a camera which films surfers on the Californian beach of Point Rincon. At the end of each day it cuts together a video and puts it online. Everything is entirely automatized with Python. MoviePy is used to add transitions, titles and music to the videos.
+ Rincomcam (link) is a camera which films surfers on the Californian beach of Point Rincon. At the end of each day it cuts together a video and puts it online. Everything is entirely automatized with Python. MoviePy is used to add transitions, titles and music to the videos.
diff --git a/docs/index.rst b/docs/index.rst
index 9812e0b7..09d43927 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,30 +1,20 @@
MoviePy
=======
-MoviePy is a Python module for script-based video editing. It enables basic operations (cuts, concatenations, title insertions) to be done in a few lines, and can be used for advanced compositing and video processing. It can read and write all the most common video formats.
+MoviePy is a Python module for script-based video editing. It enables basic operations (cuts, concatenations, title insertions) to be done in a few lines, and can be used for video compositing (a.k.a. non-linear editing), video processing, or to create advanced effects. It can read and write all the most common video formats, including GIF.
-It can be used to edit your personal videos, or to automatize the creation of videos, for instance on a webserver. See the :ref:`gallery` for examples of projects using MoviePy.
-
-Let us put together a few demonstration clips (you will find the code for most of these in the :ref:`examples`): ::
-
- import os
- from moviepy.editor import VideoFileClip, concatenate
- files = sorted( os.listdir("clips/") )
- clips = [ VideoFileClip('clips/%s'%f) for f in files]
- video = concatenate(clips, transition = VideoFileClip("logo.avi"))
- video.to_videofile("demos.mp4",fps=25) # many options available !
-
-.. raw:: html
+User's Guide
+--------------
- <center>
- <object><param name="movie"
- value="http://www.youtube.com/v/zGhoZ4UBxEQ&hl=en_US&fs=1&rel=0">
- </param><param name="allowFullScreen" value="true"></param><param
- name="allowscriptaccess" value="always"></param><embed
- src="http://www.youtube.com/v/zGhoZ4UBxEQ&hl=en_US&fs=1&rel=0"
- type="application/x-shockwave-flash" allowscriptaccess="always"
- allowfullscreen="true" width="490" height="390"></embed></object>
- </center>
+.. toctree::
+ :maxdepth: 1
+
+ install
+ crash_course/crash_course
+ gallery
+ examples/examples
+ FAQ
+ ref/ref
MoviePy is an open source software originally written by Zulko_ and released under the MIT licence.
It is hosted on Github_, where you can push improvements, report bugs and ask for help. There is also a MoviePy forum on Reddit_ and a mailing list on librelist_ .
@@ -47,20 +37,6 @@ It is hosted on Github_, where you can push improvements, report bugs and ask fo
src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"
alt="Fork me on GitHub"></a>
-
-User's Guide
---------------
-
-.. toctree::
- :maxdepth: 1
-
- install
- crash_course/crash_course
- examples/examples
- FAQ
- ref/ref
-
-
.. _PyPI: https://pypi.python.org/pypi/moviepy
.. _Zulko: https://github.com/Zulko/
.. _Stackoverflow: http://stackoverflow.com/
diff --git a/docs/install.rst b/docs/install.rst
index 9d632c52..489496ab 100644
--- a/docs/install.rst
+++ b/docs/install.rst
@@ -1,94 +1,52 @@
Download and Installation
==========================
-Core dependencies
--------------------
-
-MoviePy requires the Python modules Numpy_, Decorator_, and tqdm_. All
-of these will 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.
-
Installation
--------------
-First method : if you have ``pip`` installed, just type this in a terminal (sudo is optional on some systems) ::
+**Method with pip:** if you have ``pip`` installed, just type this in a terminal (sudo is optional on some systems) ::
(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 ::
+**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
+
+MoviePy depends on the Python modules Numpy_, Decorator_, and tqdm_, which will be automatically installed during MoviePy's installation.
+
Linking to ffmpeg
~~~~~~~~~~~~~~~~~~
-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
-
-Linking to ImageMagick (Windows only)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+MoviePy requires a **recent version** of the software ffmpeg_ preferably downloaded directly from the ffmpeg website**.
-For the moment MoviePy cannot detect ImageMagick on Windows. You need
-to go into the ``moviepy/conf.py`` file and provide the path, it
-should look something like this ::
-
- IMAGEMAGICK_BINARY = "C:\Program Files\ImageMagick_VERSION\convert"
+**Installed ffmpeg:** when you have installed ffmpeg, or (for linux users) when you have a ffmpeg binary in the ``/usr/bin`` folder, it will be detected automatically by MoviePy.
+
+**Non-installed ffmpeg:** you can also simply place the ffmpeg binary somewhere on your computer and specify its path in the file `moviepy/conf.py` before installing MoviePy by hand.
+Linking to ImageMagick
+~~~~~~~~~~~~~~~~~~~~~~~~
-(Not so) Optional dependencies
--------------------------------
+ImageMagick_ is not strictly required, but some important features of MoviePy, like the creation of texts or animated GIFs, depend on it.
+
+Once you have installed it, ImageMagick will be automatically detected by MoviePy, **except on Windows !**. Windows user, before installing MoviePy by hand, go into the ``moviepy/conf.py`` file and provide the path to the ImageMagick binary called `convert`. It should look like this ::
+
+ IMAGEMAGICK_BINARY = "C:\\Program Files\\ImageMagick_VERSION\\convert.exe"
-PyGame_ is needed for video and sound previews (useless if you intend to work with MoviePy on a server but really essential for advanced video editing).
-ImageMagick_ is needed for all text generation, GIF import/export, and much more .
+Other optional but useful dependencies
+----------------------------------------
+
+PyGame_ is needed for video and sound previews (useless if you intend to work with MoviePy on a server but really essential for advanced video editing *by hand*).
For advanced image processing you will need one or several of these packages. for instance ``clip.resize`` requires that at least one of Scipy, PIL, Pillow or OpenCV are installed.
- The Python Imaging Library (PIL) or, better, its branch Pillow_ .
- Scipy_ (for tracking, segmenting, etc.), and can be used for resizing video clips if PIL and OpenCV aren't installed on your computer.
- `Scikit Image`_ may be needed for some advanced image manipulation.
-- `OpenCV 2.4.6`_ (provides the package ``cv2``) or more recent may be needed for some advanced image manipulation. See below.
-
-If you are on linux, these softwares will surely be in your repos.
-
-
-So you want to install 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 ::
-
- import cv2
- print cv2.__version__
+- `OpenCV 2.4.6`_ (provides the package ``cv2``) or more recent may be needed for some advanced image manipulation. See :ref:`opencv`
-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 are on linux, these softwares will surely be in your repos.
.. _`Numpy`: http://www.scipy.org/install.html
.. _Decorator: https://pypi.python.org/pypi/decorator
diff --git a/docs/opencv_instructions.rst b/docs/opencv_instructions.rst
new file mode 100644
index 00000000..888c1788
--- /dev/null
+++ b/docs/opencv_instructions.rst
@@ -0,0 +1,35 @@
+.. _opencv:
+
+So you want to install 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 ::
+
+ import cv2
+ print cv2.__version__
+
+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.
\ No newline at end of file