Video editing with Python
Big changes in the docs
Zulko953cca9e5adc
diff --git a/docs/conf.py b/docs/conf.pyindex 3adc9ae4..7f78295f 100644--- a/docs/conf.py+++ b/docs/conf.py@@ -99,11 +99,12 @@ pygments_style = 'sphinx'# The theme to use for HTML and HTML Help pages. See the documentation for# a list of builtin themes.+import sphinx_rtd_themesys.path.append(os.path.abspath('_themes'))sys.path.append("../moviepy")-html_theme_path = ['_themes']-html_theme = 'kr'-+#html_theme_path = ['_themes']+html_theme = "sphinx_rtd_theme" # formerly 'kr'+html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]# Theme options are theme-specific and customize the look and feel of a theme# further. For a list of options available for each theme, see the# documentation.diff --git a/docs/gallery.rst b/docs/gallery.rstindex aa6606bb..d9862c61 100644--- a/docs/gallery.rst+++ b/docs/gallery.rst@@ -4,135 +4,120 @@Gallery========-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 !+Here are a few projects using MoviePy. The gallery will fill up as more people start using MoviePy (which is currently one year old). If you have a nice project using MoviePy let us know !Videos edited with Moviepy---------------------------+The Cup Song Covers Mix+~~~~~~~~~~~~~~~~~~~~~~~~-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`.+This mix of 60 covers of the Cup Song demonstrates the non-linear video editing capabilities of MoviePy. Here is `the (undocumented) MoviePy code <http://nbviewer.ipython.org/github/Zulko/--video-editing---Cup-Song-Covers-Mix/blob/master/CupSongsCovers.ipynb>`_ that generated the script... 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>-+ <div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden;+ display:block; margin-left: auto; margin-right: auto;">+ <iframe src="http://youtube.com/v/rIehsqqYFEM&hl?rel=0" frameborder="0" allowfullscreen+ style="position: absolute; top: 0; bottom: 10; width: 90%; height: 100%;">+ </iframe>+ </div>-The Cup Song Covers Mix-~~~~~~~~~~~~~~~~~~~~~~~~+The (old) MoviePy reel video.+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-This video is a mix of 60 covers of the Cup Song which demonstrates the non-linear video editing capabilities of MoviePy. The code that generated the script (not commented) can be found `here <http://nbviewer.ipython.org/github/Zulko/--video-editing---Cup-Song-Covers-Mix/blob/master/CupSongsCovers.ipynb>`_.+Made when MoviePy was a few weeks old and not as good as now. The code for most scenes can be found+in the :ref:`examples`... 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>+ <div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden;">+ <iframe src="http://youtube.com/v/zGhoZ4UBxEQ&hl?rel=0" frameborder="0" allowfullscreen+ style="position: absolute; top: 0; bottom: 10; left: 0; width: 90%; height: 100%;">+ </iframe>+ </div>+Gifs edited with MoviePy---------------------------An introductory tutorial-~~~~~~~~~~~~~~~~~~~~~~~~~+GIFs from video files+~~~~~~~~~~~~~~~~~~~~~~-If you want to make gifs from video files, this `tutorial-<http://zulko.github.io/blog/2014/01/23/making-animated-gifs-from-video-files-with-python/>`_ gives you the basics (cutting, croping, adding text...). In the last example you will see how remove the (still) background of a video to keep only the animated part, like that:+This `tutorial+<http://zulko.github.io/blog/2014/01/23/making-animated-gifs-from-video-files-with-python/>`_ gives you the basics to make gifs from video files (cutting, croping, adding text...). The last example shows how to remove a (still) background to keep only the animated part of a video... raw:: html-- <center>- <a href="http://imgur.com/Fo2BxBK"><img src="http://i.imgur.com/Fo2BxBK.gif" title="Hosted by imgur.com"/></a>- </center>-A few other GIFs made with MoviePy-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ <a href="http://imgur.com/Fo2BxBK"><img src="http://i.imgur.com/Fo2BxBK.gif" title="Hosted by imgur.com"+ style="max-width:50%; height:'auto'; display:block; margin-left: auto;margin-right: auto; margin-bottom:30px;" /></a>-With MoviePy and just a few lines of Python you can track objects, add subtitles, find correlations between pictures to make perfectly-looping gifs, use masks, etc.+Animations+~~~~~~~~~~~~~++This `tutorial+<http://zulko.github.io/blog/2014/09/20/vector-animations-with-python/>`_ shows how to combine MoviePy with Gizeh to create animations:.. raw:: html-- <center>- <iframe class="imgur-album" width="70%" height="380" frameborder="0" src="http://imgur.com/a/lgAwo/embed"></iframe>- </center>-Programs and Scripts using MoviePy------------------------------------+ <a href="http://imgur.com/2YdW9yf"><img src="http://i.imgur.com/2YdW9yf.gif"+ style="max-width:50%; height:'auto'; display:block; margin-left: auto;margin-right: auto; margin-bottom:30px;" /></a>-Videogrep-~~~~~~~~~~-Videogrep is a python script written by Sam Lavigne, that goes through the subtitle tracks of movies and makes supercuts based on what it finds. For instance, here is an automatic supercut of every time the White House press secretary tells us what he can tell us:+It is possible to combine MoviePy the same with many graphic librairies (like matplotlib, mayavi, pyopengl, etc.).-.. 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/D7pymdCU5NQ&hl=en_US&fs=1&rel=0"- type="application/x-shockwave-flash" allowscriptaccess="always"- allowfullscreen="true" width="490" height="390"></embed></object>- </center>+.. Rinconcam-Here are Videogrep's introductory `blog post-<http://lav.io/2014/06/videogrep-automatic-supercuts-with-python/>`_ and the Github project `page <https://github.com/antiboredom/videogrep/>`_.+.. aaa~~~~~~~~~~~-If you liked it, also have a look at these two Videogrep-inspired projects:+.. 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.-- This `blog post <http://zulko.github.io/blog/2014/06/21/some-more-videogreping-with-python/>`_ attempts to cut a video precisely at the beginning and end of sentences or words.-- This `other post <http://zulko.github.io/blog/2014/07/04/automatic-soccer-highlights-compilations-with-python/>`_ uses MoviePy to automatically cut together all the highlights of a soccer game, based on the fact that the crowd cheers louder when something interesting happens.+Scientific or technological projects+--------------------------------------MoviePy online---------------+Piano rolls transcription to sheet music+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-Websites using MoviePy for video editing automation (to be written).+This `blog post <http://zulko.github.io/blog/2014/02/12/transcribing-piano-rolls/>`_ explains how to transform a video of a piano roll performance into playable sheet music. MoviePy is used for the frame-by-frame analysis of the piano roll video. The last video is also edited with MoviePy:-.. Rinconcam-.. aaa~~~~~~~~~~~+.. raw:: html-.. 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.-MoviePy in sciences and technology-------------------------------------+ <div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; margin-bottom:30px; overflow: hidden;">+ <iframe src="http://youtube.com/v/V2XCJNZjm4w&hl?rel=0" frameborder="0" allowfullscreen+ style="position: absolute; top: 0; bottom: 10; left: 0; width: 90%; height: 100%;">+ </iframe>+ </div>-Piano rolls transcription to sheet music-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-This `blog post <http://zulko.github.io/blog/2014/02/12/transcribing-piano-rolls/>`_ explains how to transform a video of a piano roll performance into playable sheet music. MoviePy is used for the frame-by-frame analysis of the piano roll video. The last video is also edited with MoviePy:+Misc. Programs and Scripts using MoviePy+------------------------------------------++Videogrep+~~~~~~~~~~++Videogrep is a python script written by Sam Lavigne, that goes through the subtitle tracks of movies and makes supercuts based on what it finds. For instance, here is an automatic supercut of every time the White House press secretary tells us what he can tell us:.. raw:: html- <center>- <object><param name="movie"- value="http://www.youtube.com/v/V2XCJNZjm4w&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/V2XCJNZjm4w&hl=en_US&fs=1&rel=0"- type="application/x-shockwave-flash" allowscriptaccess="always"- allowfullscreen="true" width="490" height="390"></embed></object>- </center>+ <div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden;">+ <iframe src="http://youtube.com/v/D7pymdCU5NQ&hl?rel=0" frameborder="0" allowfullscreen+ style="position: absolute; top: 0; bottom: 10; left: 0; width: 90%; height: 100%;">+ </iframe>+ </div>++Here are Videogrep's introductory `blog post+<http://lav.io/2014/06/videogrep-automatic-supercuts-with-python/>`_ and the Github project `page <https://github.com/antiboredom/videogrep/>`_.++If you liked it, also have a look at these two Videogrep-inspired projects:++- This `blog post <http://zulko.github.io/blog/2014/06/21/some-more-videogreping-with-python/>`_ attempts to cut a video precisely at the beginning and end of sentences or words.+- This `other post <http://zulko.github.io/blog/2014/07/04/automatic-soccer-highlights-compilations-with-python/>`_ uses MoviePy to automatically cut together all the highlights of a soccer game, based on the fact that the crowd cheers louder when something interesting happens.diff --git a/docs/getting_started/advanced_tools.py b/docs/getting_started/advanced_tools.pynew file mode 100644index 00000000..11deade6--- /dev/null+++ b/docs/getting_started/advanced_tools.py@@ -0,0 +1,10 @@+Advanced tools+===============++This section briefly presents a few functions of the submodule ``moviepy.video.tools``+that can help you edit videos. See the documentation for each modu++Subtitles+----------++Credits\ No newline at end of filediff --git a/docs/getting_started/advanced_tools.rst b/docs/getting_started/advanced_tools.rstnew file mode 100644index 00000000..f0272bf2--- /dev/null+++ b/docs/getting_started/advanced_tools.rst@@ -0,0 +1,17 @@+Advanced tools+===============++This section briefly presents a few functions of the submodule ``moviepy.video.tools`` that can help you edit videos. See the reference manual for more details on how to use each functionality.+++Tracking+~~~~~~~~~++Cuts+~~~~~~~~++Subtitles+~~~~~~~~~~++Credits+~~~~~~~~\ No newline at end of filediff --git a/docs/crash_course/crash_course.rst b/docs/getting_started/clips.rstsimilarity index 75%rename from docs/crash_course/crash_course.rstrename to docs/getting_started/clips.rstindex 1cbdbc1c..82d8c90a 100644--- a/docs/crash_course/crash_course.rst+++ b/docs/getting_started/clips.rst@@ -1,50 +1,7 @@-.. _crashcourse:+Clips in MoviePy+==================-A MoviePy crash-course---------------------------This section presents the basics of video editing with MoviePy.---Example code-~~~~~~~~~~~~~~--In a typical MoviePy script, you load some clips from video files, then modify them, put them together, and write the result to a video file. As an example, let us load a movie of my last holidays, lower the volume, add a title in the center of the video for the first ten seconds, and write the result in a file: ::-- # Import everything needed to edit video clips- from moviepy.editor import *-- # Load myHolidays.mp4 and select the subclip 00:00:50 - 00:00:60- clip = VideoFileClip("myHolidays.mp4").subclip(50,60)-- # Reduce the audio volume (volume x 0.8)- clip = clip.volumex(0.8)-- # Generate a text clip. You can customize the font, color, etc.- txt_clip = TextClip("My Holidays 2013",fontsize=70,color='white')-- # Say that you want it to appear 10s at the center of the screen- txt_clip = txt_clip.set_pos('center').set_duration(10)-- # Overlay the text clip on the first video clip- video = CompositeVideoClip([clip, txt_clip])-- # Write the result to a file- video.write_videofile("myHolidays_edited.avi",fps=24, codec='mpeg4')---What powers MoviePy-~~~~~~~~~~~~~~~~~~~~~--MoviePy uses the software ``ffmpeg`` to read frames from video and audio files. The code to edit and put these frames together relies mainly on the Python library Numpy. The edited frames are assembled in a video file using once again ``ffmpeg``. The software ImageMagick can also be used to generate texts or export an animation in GIF format.--.. image:: explanations.jpeg- :width: 570px- :align: center--The clip objects-~~~~~~~~~~~~~~~~~~~+In this section we see how to create clips, (for instance from video or audio files), how to mix them together, and how to write them to a file.The most common objects in MoviePy are called clips. A clip (let's call it ``my_clip``) can be either an audio clip or a video clip. It has different attributes, like ``my_clip.duration`` (indicating its duration in seconds), ``clip.start`` (indicating the time in seconds where the clip should start playing when mixed with other videos), ``my_clip.w`` (the width in pixel of the clip), etc.@@ -187,17 +144,4 @@ For an example, you can refer to :ref:`soundexample`. Like video clips, sound claudioclip.preview() # default fps: 22050audioclip.preview(fps=44100)- audioclip.to_audiofile('my_clip.mp3',fps=44100) #default fps: 22050---To go further-~~~~~~~~~~~~~~--The best way to start with moviepy is to use it with the IPython Notebook, as it has autocompletion which will help you find all you need and discover all the available methods.--Advanced features of MoviePy that cannot be expressed as an ``fx`` are placed in :module:`moviepy.video.tools` (currently this module contains methods for tracking objects, segmenting, drawing, making credits, dealing with subtitles) and `moviepy.audio.tools` (currently empty, will contain denoisers and utilities for synchronization).--To go further and learn about all the available options and-functionalities of MoviePy, see the :ref:`examples` and the :ref:`reference_manual`.-You can also browse the code of the different video effects in-``moviepy/video/fx`` to give you ideas on how to code your own effects.\ No newline at end of file+ audioclip.to_audiofile('my_clip.mp3',fps=44100) #default fps: 22050\ No newline at end of filediff --git a/docs/getting_started/effects.rst b/docs/getting_started/effects.rstnew file mode 100644index 00000000..7078c318--- /dev/null+++ b/docs/getting_started/effects.rst@@ -0,0 +1,2 @@+Clips transformations and effects+===================================\ No newline at end of filediff --git a/docs/getting_started/efficient_moviepy.rst b/docs/getting_started/efficient_moviepy.rstnew file mode 100644index 00000000..e09d35ca--- /dev/null+++ b/docs/getting_started/efficient_moviepy.rst@@ -0,0 +1,19 @@+How to be efficient with MoviePy+================================++This section gathers tips and tricks to make the most of what is already known worldwide as *the MoviePy experience*.+++The best way to start with MoviePy is to use it with the IPython Notebook, as it has autocompletion which will help you find all you need and discover all the available methods.+++Should I use ``moviepy.editor`` ?+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+++Use the IPython Notebook !+~~~~~~~~~~~~~~~~~~~~~~~~~~~+++The many ways of previewing a clip+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~diff --git a/docs/crash_course/explanations.jpeg b/docs/getting_started/explanations.jpegsimilarity index 100%rename from docs/crash_course/explanations.jpegrename to docs/getting_started/explanations.jpegdiff --git a/docs/getting_started/getting_started.rst b/docs/getting_started/getting_started.rstnew file mode 100644index 00000000..ac7a26c6--- /dev/null+++ b/docs/getting_started/getting_started.rst@@ -0,0 +1,16 @@+.. _getting_started:++These pages give you everything you need to start editing with MoviePy. Then the best way to learn is to have a look at the provided :ref:`examples` or the different ressources presented in the :ref:`gallery`.++Getting started with MoviePy+------------------------------+++.. toctree::+ :maxdepth: 1++ quick_presentation+ clips+ effects+ advanced_tools+ efficient_moviepy\ No newline at end of filediff --git a/docs/getting_started/quick_presentation.rst b/docs/getting_started/quick_presentation.rstnew file mode 100644index 00000000..5b91cee3--- /dev/null+++ b/docs/getting_started/quick_presentation.rst@@ -0,0 +1,77 @@+Quick presentation+===================++This section explains when MoviePy can be used, how it can be used, and how it works.++Do I need MoviePy ?+~~~~~~~~~~~~~~~~~~~++There are already many good free video editing softwares out there with nice graphical interfaces (my favorites being OpenShot and KDEnlive). So why write videos using scripts ? Here are a few reasons:++- You have many videos to process or to compose in a complicated way.+- You want to automatize the creation of videos or GIFs on a web server (Django, Flask, etc.)+- You want to automatize tedious tasks, like title insertions tracking objects, cuting scenes, making end credits, subtitles, etc...+- You want to code your own video effects to do something no existing video editor can.+- You want to create animations from images generated by another python library (Matplotlib, Mayavi, Gizeh...)++MoviePy has been developed with the following goals in mind:++- **Simple an intuitive**. Basic operations can be done in one line. The code is easy to learn and easy to understand for newcomers.+- **Flexible**. You have total control over the frames of the video and audio, and creating your own effects is easy as Py.+- **Portable**. The code uses very common software (Numpy and FFMPEG) and can run on (almost) any machine with (almost) any version of Python.++Now for the limitations: MoviePy cannot stream videos (read from a webcam, or render a video live on a distant machine), it cannot do 3D effects (by lack of a nice 3D library for Python) and is not well designed for video processing involving successive frames of a movie (like video stabilization, you'll need another software for that). Also, if you only need to do frame-by-frame video analysis (with face detection or other fancy stuff) you may want to use the libraries OpenCV and SimpleCV instead.+++Example code+~~~~~~~~~~~~~~++In a typical MoviePy script, you load some video or audio files, modify them, put them together, and write the result to a new video file. As an example, let us load a video of my last holidays, lower the volume, add a title in the center of the video for the first ten seconds, and write the result in a file: ::++ # Import everything needed to edit video clips+ from moviepy.editor import *++ # Load myHolidays.mp4 and select the subclip 00:00:50 - 00:00:60+ clip = VideoFileClip("myHolidays.mp4").subclip(50,60)++ # Reduce the audio volume (volume x 0.8)+ clip = clip.volumex(0.8)++ # Generate a text clip. You can customize the font, color, etc.+ txt_clip = TextClip("My Holidays 2013",fontsize=70,color='white')++ # Say that you want it to appear 10s at the center of the screen+ txt_clip = txt_clip.set_pos('center').set_duration(10)++ # Overlay the text clip on the first video clip+ video = CompositeVideoClip([clip, txt_clip])++ # Write the result to a file+ video.write_videofile("myHolidays_edited.avi",fps=24, codec='mpeg4')+++How MoviePy works+~~~~~~~~~~~~~~~~~~~++MoviePy uses the software ``ffmpeg`` to read and to export video and audio files. It also (optionally) uses ImageMagick to generate texts and write GIF files. The processing of the different media is ensured by Python's fast numerical library Numpy, and advanced effects and enhancements can be done using some of Python's numerous image processing library (PIL, Scikit-image, scipy, etc.).++.. image:: explanations.jpeg+ :width: 570px+ :align: center++Basic concepts+~~~~~~~~~~~~~~~++The central objects of MoviePy are *clips*, which can be ``AudioClips`` or ``VideoClips``. They can be modified (cut, slowed down, darkened...) or put mixed with clips to form new clips, they can be previewed (using either PyGame or the IPython Notebook) and rendered to a file (as a MP4, a GIF, a MP3, etc.). ``VideoClips`` for instance can be created from a video file, an image, a text, or a custom animation. They can have an audio track (which is an ``AudioClip``) and a mask (a special ``VideoClip`` indicating which parts of the clip to hide when the clip is mixed with other clips). See :ref:`clips` for more details.++A clip can be modified using one of moviepy's numerous effects (like in ``clip.resize(width="360")``, ``clip.subclip(t1,t2)``, or ``clip.fx(vfx.black_white)``) or using a user-implemented effect. MoviePy implements many functions (like ``clip.fl``, ``clip.fx``, etc.) which make it very easy to code your own effect in a few lines. See :ref:`effects` for more.++You will also find a few advanced goodies in ``moviepy.video.tools`` to track objects in a video, draw simple shapes and color gradients (very useful for masks), generate subtitles and end credits, etc. See :ref:`advanced_tools` for a description of these.++Finally, although MoviePy has no graphical user interface, there are many ways to preview a clip which allow you to fine-tune your scripts and be sure that everything is perfect when you render you video in high quality. See :ref:`efficient`.++++++diff --git a/docs/crash_course/videoWH.jpeg b/docs/getting_started/videoWH.jpegsimilarity index 100%rename from docs/crash_course/videoWH.jpegrename to docs/getting_started/videoWH.jpegdiff --git a/docs/index.rst b/docs/index.rstindex 954fa80e..d30b8166 100644--- a/docs/index.rst+++ b/docs/index.rst@@ -1,24 +1,29 @@-MoviePy-=======++.. image:: logo.png+ :width: 50%+ :align: center++.. 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 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.-User's Guide---------------+User Guide+------------.. toctree:::maxdepth: 1install- crash_course/crash_course- advanced/advanced_uses+ getting_started/getting_startedgalleryexamples/examplesFAQref/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_ .+MoviePy is an open source software originally written by Zulko_ and released under the MIT licence. It works on Windows, Mac, and Linux, with Python 2 or Python 3. The code 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_ ... raw:: html@@ -33,10 +38,10 @@ It is hosted on Github_, where you can push improvements, report bugs and ask fo<iframe src="http://ghbtns.com/github-btn.html?user=Zulko&repo=moviepy&type=watch&count=true&size=large"allowtransparency="true" frameborder="0" scrolling="0" width="152px" height="30px"></iframe>- <a href="https://github.com/Zulko/moviepy">- <img style="position: absolute; top: 0; right: 0; border: 0;"- src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"- alt="Fork me on GitHub"></a>+.. <a href="https://github.com/Zulko/moviepy">+.. <img style="position: absolute; top: 0; right: 0; border: 0;"+.. src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"+.. alt="Fork me on GitHub"></a>.. _PyPI: https://pypi.python.org/pypi/moviepy.. _Zulko: https://github.com/Zulko/diff --git a/docs/logo.png b/docs/logo.pngnew file mode 100644index 00000000..29d9b34cBinary files /dev/null and b/docs/logo.png differdiff --git a/docs/ref/code_origanization.rst b/docs/ref/code_origanization.rstnew file mode 100644index 00000000..502e6635--- /dev/null+++ b/docs/ref/code_origanization.rst@@ -0,0 +1,24 @@+Organization of MoviePy's code+===============================++This reviews the folders and files in moviepy's code. It's very easy:++At the root of the project you have everything required for the packaging and installation of moviepy (README, setup.py, LICENCE) etc. Then you the ``docs/`` folder with the source code of the documentation (see :ref:`updating_docs`), a folder for some :ref:`examples`, and the main folder ``moviepy/`` for the source code of the library itself.++The folder ``moviepy/`` the classes and modules relative to the video and the audio are clearly separated into two subfolders ``video/`` and ``audio/``. In ``moviepy/`` you will find all the classes, functions and decorations which are useful to both submodules ``audio`` and ``video``:++- ``Clip.py`` defines the base object for ``AudioClip`` and ``VideoClip`` and the simple methods that can be used by both, like ``clip.subclip``, ``clip.set_duration``, etc.+- Files ``config.py`` and ``config_defaults.py`` store the default paths to the external programs FFMPEG and ImageMagick.+- ``decorators.py`` provides very useful decorators that automatize some tasks, like the fact that some effects, when applied to a clip, should also be applied to it's mask, or to its audio track.+- ``tools.py`` provides misc. functions that are useful everywhere in the library, like a standardized call to subprocess, a time converter, a standardized way to print messages in the console, etc.+- ``editor.py`` is a helper module to easily load and initiate many functionalities of moviepy (see :ref:`efficient` for more details)++The submodules ``moviepy.audio`` and ``moviepy.video`` are organized approximately the same way: at their root they implement base classes (respectively ``AudioClip`` and ``VideoClip``) and they have the following submodules:++- ``io`` contains everything required to read files, write files, preview the clip or use a graphical interface of any sort. It contains the objects that speak to FFMEG and ImageMagick, the classes AudioFileClip and VideoFileClip, the functions used to preview a clip with pygame or to embed a video in HTML5 (for instance in the IPython Notebook).+- ``fx`` contains a collection of effects and filters (like turning a video black and white, correcting luminosity, zooming or creating a scrolling effect). To add an effect to MoviePy, you simply add a new file ``my_effect.py`` to this folder, and in the file you define the function ``my_effect(clip, *other_parameters)``.+- ``compositing`` contains functions and classes to compose videoclips (CompositeVideoClip, concatenate, clips_array)+- ``tools`` contains advanced tools that are not effects but can help edit clips or generate new clips (tracking, subtitles, etc.)+++The Clip object and some basic methods\ No newline at end of filediff --git a/docs/ref/ref.rst b/docs/ref/ref.rstindex 25e8351c..32a372eb 100644--- a/docs/ref/ref.rst+++ b/docs/ref/ref.rst@@ -5,6 +5,8 @@ Reference Manual================The documentation may be a little messy for the moment, it will get better with time.+If you want to hack into the code, read :ref:`code_organization`.+.. toctree:::maxdepth: 3