Skip to content

Video editing with Python

Correction of the documentation (install, VideoClip...)

Zulko90129b894478
diff --git a/README.rst b/README.rst
index 01b61642..9e505922 100644
--- a/README.rst
+++ b/README.rst
@@ -39,22 +39,31 @@ MoviePy cannot run without these dependencies:
- `Numpy`_ is needed for image and sound manipulation
- The Decorator_ module is used in the MoviePy code for better code readability
-Numpy and Decorator will be automatically installed during MoviePy's installation if not present on your computer. As for ffmpeg, you can either install it or save the binary files in any folder and specify the path to these folders before installing MoviePy (see manual_install_).
+Numpy and Decorator will be automatically installed during MoviePy's installation if not present on your computer. As for ffmpeg, you can either install it or save the binary files in any folder and specify the path to these folders before installing MoviePy (see `Manual installation`_).
+
Installation with PIP
-~~~~~~~~~~~~~~~~~~~~~~
-Just type ::
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+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
-~~~~~~~~~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~~~~~~~~~~~
-If you want the cutting edge version you can `download MoviePy`_ on its Github repository.
+You can install moviepy manually by downloading the sources, either on PYPI_ or (if you want the development version) on Github_ .
-Just unzip everything in one folder, open a terminal and type ::
+Then just unzip everything in one folder, open a terminal and type ::
+
+ sudo python setup.py install
sudo python setup.py install
@@ -64,7 +73,7 @@ Before doing that, you should make sure that MoviePy can locate ffmpeg on your c
(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.
@@ -82,7 +91,7 @@ If you are on linux, these will surely be in your repos.
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:
@@ -117,7 +126,8 @@ Advice: do not throw your ``release`` folder away. If later you have strange bug
-
+.. _PYPI: https://pypi.python.org/pypi/moviepy
+.. _Github: https://github.com/Zulko/moviepy
.. _here: http://zulko.github.io/moviepy/
.. _`download MoviePy`: https://github.com/Zulko/moviepy
.. _`OpenCV 2.4.6`: http://sourceforge.net/projects/opencvlibrary/files/
diff --git a/docs/install.rst b/docs/install.rst
index 7119102e..00194e39 100644
--- a/docs/install.rst
+++ b/docs/install.rst
@@ -13,9 +13,16 @@ MoviePy cannot run without these dependencies:
Numpy and Decorator will be automatically installed during MoviePy's installation if not present on your computer. As for ffmpeg, you can either install it or save the binary files in any folder and specify the path to these folders before installing MoviePy (see manual_install_).
+.. _pip_install:
+
Installation with PIP
------------------------
-Coming soon.
+
+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:
@@ -23,9 +30,9 @@ Coming soon.
Manual installation
----------------------
-If you want the cutting edge version you can `download MoviePy`_ on its Github repository.
+You can install moviepy manually by downloading the sources, either on PYPI_ or (if you want the development version) on Github_ .
-Just unzip everything in one folder, open a terminal and type ::
+Then just unzip everything in one folder, open a terminal and type ::
sudo python setup.py install
@@ -89,8 +96,8 @@ Advice: do not throw your ``release`` folder away. If later you have strange bug
-
-.. _`download MoviePy`: https://github.com/Zulko/moviepy
+.. _PYPI https://pypi.python.org/pypi/moviepy
+.. _Github: https://github.com/Zulko/moviepy
.. _`OpenCV 2.4.6`: http://sourceforge.net/projects/opencvlibrary/files/
.. _Pygame: http://www.pygame.org/download.shtml
.. _`Numpy`: http://www.scipy.org/install.html
diff --git a/docs/ref/VideoClip.rst b/docs/ref/VideoClip.rst
index 708adb3c..f50e6d20 100644
--- a/docs/ref/VideoClip.rst
+++ b/docs/ref/VideoClip.rst
@@ -21,14 +21,14 @@ VideoClip
:class:`ImageClip`
==========================
-.. autoclass:: moviepy.video.ImageClip.ImageClip
+.. autoclass:: moviepy.video.VideoClip.ImageClip
:members:
:show-inheritance:
:class:`ColorClip`
------------------
-.. autoclass:: moviepy.video.ImageClip.ColorClip
+.. autoclass:: moviepy.video.VideoClip.ColorClip
:members:
:show-inheritance:
@@ -36,7 +36,7 @@ VideoClip
:class:`TextClip`
---------------------
-.. autoclass:: moviepy.video.ImageClip.TextClip
+.. autoclass:: moviepy.video.VideoClip.TextClip
:members:
:show-inheritance:
@@ -50,4 +50,4 @@ VideoClip
Useful Methods
--------------
-.. automethod:: moviepy.video.compositing.concatenate.concatenate
+.. automodule:: moviepy.video.compositing.concatenate
diff --git a/moviepy/video/VideoClip.py b/moviepy/video/VideoClip.py
index 34608fd5..6f4615fc 100644
--- a/moviepy/video/VideoClip.py
+++ b/moviepy/video/VideoClip.py
@@ -625,11 +625,15 @@ class ImageClip(VideoClip):
class ColorClip(ImageClip):
"""
An ImageClip showing just one color.
+
:param size: Size (width, height) in pixels of the clip
+
:param color: If argument ``ismask`` is False, ``color`` indicates
- the color in RGB of the clip (default is black). If `ismask``
- is True, ``color`` must be a float between 0 and 1 (default is 1)
+ the color in RGB of the clip (default is black). If `ismask``
+ is True, ``color`` must be a float between 0 and 1 (default is 1)
+
:param ismask: Is the clip a mask clip ?
+
"""
def __init__(self,size, col=(0, 0, 0), ismask=False):
w, h = size
diff --git a/moviepy/video/compositing/concatenate.py b/moviepy/video/compositing/concatenate.py
index b7e70a6e..421019a6 100644
--- a/moviepy/video/compositing/concatenate.py
+++ b/moviepy/video/compositing/concatenate.py
@@ -5,7 +5,7 @@ from moviepy.video.VideoClip import VideoClip
from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip
from moviepy.audio.AudioClip import CompositeAudioClip
-from on_color import on_color
+from moviepy.video.compositing.on_color import on_color
def concatenate(clipslist, method = 'chain', transition=None,
bg_color=(0, 0, 0), transparent=False, ismask=False, crossover = 0):
diff --git a/output.html b/output.html
deleted file mode 100644
index 3097f72a..00000000
--- a/output.html
+++ /dev/null
@@ -1,426 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.8.1: http://docutils.sourceforge.net/" />
-<title>MoviePy</title>
-<style type="text/css">
-
-/*
-:Author: David Goodger ([email protected])
-:Id: $Id: html4css1.css 7056 2011-06-17 10:50:48Z milde $
-:Copyright: This stylesheet has been placed in the public domain.
-
-Default cascading style sheet for the HTML output of Docutils.
-
-See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
-customize this style sheet.
-*/
-
-/* used to remove borders from tables and images */
-.borderless, table.borderless td, table.borderless th {
- border: 0 }
-
-table.borderless td, table.borderless th {
- /* Override padding for "table.docutils td" with "! important".
- The right padding separates the table cells. */
- padding: 0 0.5em 0 0 ! important }
-
-.first {
- /* Override more specific margin styles with "! important". */
- margin-top: 0 ! important }
-
-.last, .with-subtitle {
- margin-bottom: 0 ! important }
-
-.hidden {
- display: none }
-
-a.toc-backref {
- text-decoration: none ;
- color: black }
-
-blockquote.epigraph {
- margin: 2em 5em ; }
-
-dl.docutils dd {
- margin-bottom: 0.5em }
-
-object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
- overflow: hidden;
-}
-
-/* Uncomment (and remove this text!) to get bold-faced definition list terms
-dl.docutils dt {
- font-weight: bold }
-*/
-
-div.abstract {
- margin: 2em 5em }
-
-div.abstract p.topic-title {
- font-weight: bold ;
- text-align: center }
-
-div.admonition, div.attention, div.caution, div.danger, div.error,
-div.hint, div.important, div.note, div.tip, div.warning {
- margin: 2em ;
- border: medium outset ;
- padding: 1em }
-
-div.admonition p.admonition-title, div.hint p.admonition-title,
-div.important p.admonition-title, div.note p.admonition-title,
-div.tip p.admonition-title {
- font-weight: bold ;
- font-family: sans-serif }
-
-div.attention p.admonition-title, div.caution p.admonition-title,
-div.danger p.admonition-title, div.error p.admonition-title,
-div.warning p.admonition-title {
- color: red ;
- font-weight: bold ;
- font-family: sans-serif }
-
-/* Uncomment (and remove this text!) to get reduced vertical space in
- compound paragraphs.
-div.compound .compound-first, div.compound .compound-middle {
- margin-bottom: 0.5em }
-
-div.compound .compound-last, div.compound .compound-middle {
- margin-top: 0.5em }
-*/
-
-div.dedication {
- margin: 2em 5em ;
- text-align: center ;
- font-style: italic }
-
-div.dedication p.topic-title {
- font-weight: bold ;
- font-style: normal }
-
-div.figure {
- margin-left: 2em ;
- margin-right: 2em }
-
-div.footer, div.header {
- clear: both;
- font-size: smaller }
-
-div.line-block {
- display: block ;
- margin-top: 1em ;
- margin-bottom: 1em }
-
-div.line-block div.line-block {
- margin-top: 0 ;
- margin-bottom: 0 ;
- margin-left: 1.5em }
-
-div.sidebar {
- margin: 0 0 0.5em 1em ;
- border: medium outset ;
- padding: 1em ;
- background-color: #ffffee ;
- width: 40% ;
- float: right ;
- clear: right }
-
-div.sidebar p.rubric {
- font-family: sans-serif ;
- font-size: medium }
-
-div.system-messages {
- margin: 5em }
-
-div.system-messages h1 {
- color: red }
-
-div.system-message {
- border: medium outset ;
- padding: 1em }
-
-div.system-message p.system-message-title {
- color: red ;
- font-weight: bold }
-
-div.topic {
- margin: 2em }
-
-h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
-h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
- margin-top: 0.4em }
-
-h1.title {
- text-align: center }
-
-h2.subtitle {
- text-align: center }
-
-hr.docutils {
- width: 75% }
-
-img.align-left, .figure.align-left, object.align-left {
- clear: left ;
- float: left ;
- margin-right: 1em }
-
-img.align-right, .figure.align-right, object.align-right {
- clear: right ;
- float: right ;
- margin-left: 1em }
-
-img.align-center, .figure.align-center, object.align-center {
- display: block;
- margin-left: auto;
- margin-right: auto;
-}
-
-.align-left {
- text-align: left }
-
-.align-center {
- clear: both ;
- text-align: center }
-
-.align-right {
- text-align: right }
-
-/* reset inner alignment in figures */
-div.align-right {
- text-align: inherit }
-
-/* div.align-center * { */
-/* text-align: left } */
-
-ol.simple, ul.simple {
- margin-bottom: 1em }
-
-ol.arabic {
- list-style: decimal }
-
-ol.loweralpha {
- list-style: lower-alpha }
-
-ol.upperalpha {
- list-style: upper-alpha }
-
-ol.lowerroman {
- list-style: lower-roman }
-
-ol.upperroman {
- list-style: upper-roman }
-
-p.attribution {
- text-align: right ;
- margin-left: 50% }
-
-p.caption {
- font-style: italic }
-
-p.credits {
- font-style: italic ;
- font-size: smaller }
-
-p.label {
- white-space: nowrap }
-
-p.rubric {
- font-weight: bold ;
- font-size: larger ;
- color: maroon ;
- text-align: center }
-
-p.sidebar-title {
- font-family: sans-serif ;
- font-weight: bold ;
- font-size: larger }
-
-p.sidebar-subtitle {
- font-family: sans-serif ;
- font-weight: bold }
-
-p.topic-title {
- font-weight: bold }
-
-pre.address {
- margin-bottom: 0 ;
- margin-top: 0 ;
- font: inherit }
-
-pre.literal-block, pre.doctest-block, pre.math {
- margin-left: 2em ;
- margin-right: 2em }
-
-span.classifier {
- font-family: sans-serif ;
- font-style: oblique }
-
-span.classifier-delimiter {
- font-family: sans-serif ;
- font-weight: bold }
-
-span.interpreted {
- font-family: sans-serif }
-
-span.option {
- white-space: nowrap }
-
-span.pre {
- white-space: pre }
-
-span.problematic {
- color: red }
-
-span.section-subtitle {
- /* font-size relative to parent (h1..h6 element) */
- font-size: 80% }
-
-table.citation {
- border-left: solid 1px gray;
- margin-left: 1px }
-
-table.docinfo {
- margin: 2em 4em }
-
-table.docutils {
- margin-top: 0.5em ;
- margin-bottom: 0.5em }
-
-table.footnote {
- border-left: solid 1px black;
- margin-left: 1px }
-
-table.docutils td, table.docutils th,
-table.docinfo td, table.docinfo th {
- padding-left: 0.5em ;
- padding-right: 0.5em ;
- vertical-align: top }
-
-table.docutils th.field-name, table.docinfo th.docinfo-name {
- font-weight: bold ;
- text-align: left ;
- white-space: nowrap ;
- padding-left: 0 }
-
-h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
-h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
- font-size: 100% }
-
-ul.auto-toc {
- list-style-type: none }
-
-</style>
-</head>
-<body>
-<div class="document" id="moviepy">
-<h1 class="title">MoviePy</h1>
-
-<p>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.</p>
-<p>See the full documentation and demo videos <a class="reference external" href="http://zulko.github.io/moviepy/">here</a> .</p>
-<p>A typical MoviePy script looks like that:</p>
-<pre class="literal-block">
-from moviepy import *
-
-# Load myHolidays.mp4 and select the subclip 00:00:50 - 00:00:60
-clip =VideoFileClip(&quot;myHolidays.mp4&quot;).subclip(50,60)
-
-# Generate a text clip (many options available ! )
-txt_clip = TextClip(&quot;My Holidays 2013&quot;,fontsize=70,color='white')
-txt_clip = txt_clip.set_pos('center').set_duration(10)
-
-# Overlay the text clip above the first clip
-final_clip = CompositeVideoClip([clip, txt_clip])
-
-# write the result to a file in any format
-final_clip.to_videofile(&quot;myHolidays_edited.avi&quot;,fps=25, codec='mpeg4')
-</pre>
-<div class="section" id="download-and-installation">
-<h1>Download and Installation</h1>
-<div class="section" id="dependencies">
-<h2>Dependencies</h2>
-<p>MoviePy cannot run without these dependencies:</p>
-<ul class="simple">
-<li>The software <a class="reference external" href="http://www.ffmpeg.org/download.html">ffmpeg</a> is needed for writing, reading, converting the sound and the video. Normally any version of FFMPEG should work but it is recommended to use a recent version for better results.</li>
-<li><a class="reference external" href="http://www.scipy.org/install.html">Numpy</a> is needed for image and sound manipulation</li>
-<li>The <a class="reference external" href="https://pypi.python.org/pypi/decorator">Decorator</a> module is used in the MoviePy code for better code readability</li>
-</ul>
-<p>Numpy and Decorator will be automatically installed during MoviePy's installation if not present on your computer. As for ffmpeg, you can either install it or save the binary files in any folder and specify the path to these folders before installing MoviePy (see <a class="reference internal" href="#manual-install">manual_install</a>).</p>
-</div>
-<div class="section" id="installation-with-pip">
-<h2>Installation with PIP</h2>
-<p>Coming soon.</p>
-</div>
-<div class="section" id="manual-installation">
-<span id="manual-install"></span><h2>Manual installation</h2>
-<p>If you want the cutting edge version you can <a class="reference external" href="https://github.com/Zulko/moviepy">download MoviePy</a> on its Github repository.</p>
-<p>Just unzip everything in one folder, open a terminal and type</p>
-<pre class="literal-block">
-sudo python setup.py install
-</pre>
-<p>Before doing that, you should make sure that MoviePy can locate ffmpeg on your computer. To do that, run the script <tt class="docutils literal">moviepy/conf.py</tt>. It it fails, then you must enter the path in the first line of this file</p>
-<pre class="literal-block">
-FFMPEG_BINARY = path/to/your/ffmpeg
-</pre>
-</div>
-</div>
-<div class="section" id="not-so-optional-dependencies">
-<h1>(Not so) Optional dependencies</h1>
-<p>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.</p>
-<ul class="simple">
-<li><a class="reference external" href="http://www.pygame.org/download.shtml">PyGame</a> is needed for video and sound previews (really essential for advanced editing).</li>
-<li><a class="reference external" href="http://www.imagemagick.org/script/index.php">imageMagick</a> is needed for all text generation, GIF support, and much more in the future.</li>
-</ul>
-<p>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.</p>
-<ul class="simple">
-<li>Scipy is needed for many advanced functionalities (tracking, segmenting, etc.)</li>
-<li><a class="reference external" href="http://scikit-image.org/download.html">Scikit Image</a> may be needed for some advanced image manipulation.</li>
-<li>The Python Imaging Library is not used yet (I don't like the copyright) but it is coming.</li>
-<li><a class="reference external" href="http://sourceforge.net/projects/opencvlibrary/files/">OpenCV 2.4.6</a> (which provides the python package <tt class="docutils literal">cv2</tt>) or more recent may be needed for some advanced image manipulation. See below for the installation of OpenCV.</li>
-</ul>
-<p>If you are on linux, these will surely be in your repos.</p>
-</div>
-<div class="section" id="installing-opencv-2-4-6">
-<h1>Installing OpenCV 2.4.6</h1>
-<p>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:</p>
-<ul>
-<li><p class="first">Remove any other version of OpenCV if you installed it through a package manager.</p>
-</li>
-<li><p class="first">Unzip the source code of <a class="reference external" href="http://sourceforge.net/projects/opencvlibrary/files/">OpenCV 2.4.6</a> in some folder. open a terminal in this folder.</p>
-</li>
-<li><p class="first">Make a new directory and go into this directory:</p>
-<pre class="literal-block">
-mkdir release
-cd release
-</pre>
-</li>
-<li><p class="first">Run <tt class="docutils literal">cmake</tt>. Here is the line I used:</p>
-<pre class="literal-block">
-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 ..
-</pre>
-</li>
-<li><p class="first">Run <tt class="docutils literal">make</tt>. This may take a few minutes (15 minutes on my computer).</p>
-<pre class="literal-block">
-make
-</pre>
-</li>
-<li><p class="first">Finally, install.</p>
-<pre class="literal-block">
-sudo make install
-</pre>
-</li>
-</ul>
-<p>And voilà !</p>
-<p>You can check if it worked by opeing a Python console and typing</p>
-<pre class="literal-block">
-import cv2
-print cv2.__version__
-</pre>
-<p>Advice: do not throw your <tt class="docutils literal">release</tt> folder away. If later you have strange bugs with OpenCV involving <tt class="docutils literal">.so</tt> files, just redo the <tt class="docutils literal">sudo make install</tt> step.</p>
-</div>
-</div>
-</body>
-</html>