Video editing with Python
Delete outdated opencv install instructions and fixe english syntax (#1148)
Jonne Kaunisto103b2aa006f5
diff --git a/README.rst b/README.rstindex 62003b4f..c39d9b0f 100644--- a/README.rst+++ b/README.rst@@ -219,7 +219,7 @@ Maintainers.. Software, Tools, Libraries.. _Pillow: https://pillow.readthedocs.org/en/latest/.. _Scipy: https://www.scipy.org/-.. _`OpenCV 2.4.6`: https://sourceforge.net/projects/opencvlibrary/files/+.. _`OpenCV 2.4.6`: https://github.com/skvark/opencv-python.. _Pygame: https://www.pygame.org/download.shtml.. _Numpy: https://www.scipy.org/install.html.. _imageio: https://imageio.github.io/diff --git a/docs/FAQ.rst b/docs/FAQ.rstindex 6eaadf98..2ff04b07 100644--- a/docs/FAQ.rst+++ b/docs/FAQ.rst@@ -25,7 +25,7 @@ I can't seem to read any video with MoviePy""""""""""""""""""""""""""""""""""""""""""""""Known reason: you have a deprecated version of FFMPEG, install a recent version from the-website, not from your OS's repositories ! (see :ref:`install`).+website, not from your OS's repositories! (see :ref:`install`).Previewing videos make them slower than they are"""""""""""""""""""""""""""""""""""""""""""""""""diff --git a/docs/examples/compo_from_image.rst b/docs/examples/compo_from_image.rstindex c6f31fd0..d542adb3 100644--- a/docs/examples/compo_from_image.rst+++ b/docs/examples/compo_from_image.rst@@ -3,7 +3,7 @@ Placing clips according to a picture======================================-So how do you do some complex compositing like this ?+So how do you do some complex compositing like this?.. raw:: htmldiff --git a/docs/gallery.rst b/docs/gallery.rstindex fd74ed72..53473705 100644--- a/docs/gallery.rst+++ b/docs/gallery.rst@@ -4,7 +4,7 @@Gallery========-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 !+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---------------------------diff --git a/docs/getting_started/compositing.rst b/docs/getting_started/compositing.rstindex 082b576b..6447d40f 100644--- a/docs/getting_started/compositing.rst+++ b/docs/getting_started/compositing.rst@@ -103,7 +103,7 @@ There are many ways to specify the position: ::# clip2 is at 40% of the width, 70% of the height of the screen:clip2.set_position((0.4,0.7), relative=True)- # clip2's position is horizontally centered, and moving down !+ # clip2's position is horizontally centered, and moving down!clip2.set_position(lambda t: ('center', 50+t) )When indicating the position keep in mind that the ``y`` coordinate has its zero at the top of the picture:diff --git a/docs/getting_started/effects.rst b/docs/getting_started/effects.rstindex 923c3a15..1f6241b1 100644--- a/docs/getting_started/effects.rst+++ b/docs/getting_started/effects.rst@@ -13,7 +13,7 @@ All these effects have in common that they are **not inplace**: they do NOT modimy_clip = VideoFileClip("some_file.mp4")my_clip.set_start(t=5) # does nothing, changes are lost- my_new_clip = my_clip.set_start(t=5) # good !+ my_new_clip = my_clip.set_start(t=5) # good!Also, when you write ``clip.resize(width=640)``, it does not immediately applies the effect to all the frames of the clip, but only to the first frame: all the other frames will be resized only when required (that is, when you will write the whole clip to a file of when you will preview it). Said otherwise, creating a new clip is neither time nor memory hungry, all the computations happen during the final rendering.@@ -47,7 +47,7 @@ but this is not easy to read. To have a clearer syntax you can use ``clip.fx``:.fx( effect_2, args2).fx( effect_3, args3))-Much better ! There are already many effects implemented in the modules ``moviepy.video.fx`` and ``moviepy.audio.fx``. The fx methods in these modules are automatically applied to the sound and the mask of the clip if it is relevant, so that you don't have to worry about modifying these. For practicality, when you use ``from moviepy.editor import *``, these two modules are loaded as ``vfx`` and ``afx``, so you may write something like ::+Much better! There are already many effects implemented in the modules ``moviepy.video.fx`` and ``moviepy.audio.fx``. The fx methods in these modules are automatically applied to the sound and the mask of the clip if it is relevant, so that you don't have to worry about modifying these. For practicality, when you use ``from moviepy.editor import *``, these two modules are loaded as ``vfx`` and ``afx``, so you may write something like ::from moviepy.editor import *clip = (VideoFileClip("myvideo.avi")diff --git a/docs/getting_started/efficient_moviepy.rst b/docs/getting_started/efficient_moviepy.rstindex ea328c30..5a8f9138 100644--- a/docs/getting_started/efficient_moviepy.rst+++ b/docs/getting_started/efficient_moviepy.rst@@ -9,10 +9,10 @@ The best way to start with MoviePy is to use it with the IPython Notebook: it ma.. _should_i_use_moviepy_editor:-Should I use ``moviepy.editor`` ?+Should I use ``moviepy.editor``?~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-Most examples in this documentation use the submodule ``moviepy.editor``, but this submodule is not adapted to all needs so should *you* use it ? Short answer: if you use MoviePy to edit videos *by hand*, use it, but if you use MoviePy inside a larger library or program or webserver, it is better to avoid it and just load the functions that you need.+Most examples in this documentation use the submodule ``moviepy.editor``, but this submodule is not adapted to all needs so should *you* use it? Short answer: if you use MoviePy to edit videos *by hand*, use it, but if you use MoviePy inside a larger library or program or webserver, it is better to avoid it and just load the functions that you need.The module ``moviepy.editor`` can be loaded using one of the three following methods: ::diff --git a/docs/getting_started/quick_presentation.rst b/docs/getting_started/quick_presentation.rstindex 54884da4..2561e406 100644--- a/docs/getting_started/quick_presentation.rst+++ b/docs/getting_started/quick_presentation.rst@@ -5,7 +5,7 @@ Quick presentationThis section explains when MoviePy can be used and how it works.-Do I need MoviePy ?+Do I need MoviePy?~~~~~~~~~~~~~~~~~~~Here are a few reasons why you may want to edit videos in Python:@@ -56,7 +56,7 @@ In a typical MoviePy script, you load video or audio files, modify them, put the# Overlay the text clip on the first video clipvideo = CompositeVideoClip([clip, txt_clip])- # Write the result to a file (many options available !)+ # Write the result to a file (many options available!)video.write_videofile("myHolidays_edited.webm")diff --git a/docs/getting_started/videoclips.rst b/docs/getting_started/videoclips.rstindex 817f74fd..dbae04b8 100644--- a/docs/getting_started/videoclips.rst+++ b/docs/getting_started/videoclips.rst@@ -12,11 +12,11 @@ The following code summarizes the base clips that you can create with moviepy: :clip = VideoFileClip("my_video_file.mp4") # or .avi, .webm, .gif ...clip = ImageSequenceClip(['image_file1.jpeg', ...], fps=24)clip = ImageClip("my_picture.png") # or .jpeg, .tiff, ...- clip = TextClip("Hello !", font="Amiri-Bold", fontsize=70, color="black")+ clip = TextClip("Hello!", font="Amiri-Bold", fontsize=70, color="black")clip = ColorClip(size=(460,380), color=[R,G,B])# AUDIO CLIPS- clip = AudioFileClip("my_audiofile.mp3") # or .ogg, .wav... or a video !+ clip = AudioFileClip("my_audiofile.mp3") # or .ogg, .wav... or a video!clip = AudioArrayClip(numpy_array, fps=44100) # from a numerical arrayclip = AudioClip(make_frame, duration=3) # uses a function make_frame(t)@@ -170,8 +170,8 @@ Sometimes it is impossible for MoviePy to guess the ``duration`` attribute of th# Make a video showing a flower for 5 secondsmy_clip = Image("flower.jpeg") # has infinite duration- my_clip.write_videofile("flower.mp4") # Will fail ! NO DURATION !- my_clip.set_duration(5).write_videofile("flower.mp4") # works !+ my_clip.write_videofile("flower.mp4") # Will fail! NO DURATION!+ my_clip.set_duration(5).write_videofile("flower.mp4") # works!Animated GIFsdiff --git a/docs/index.rst b/docs/index.rstindex 1e8d2123..5007c37c 100644--- a/docs/index.rst+++ b/docs/index.rst@@ -27,15 +27,14 @@ User Guidegalleryexamples/examplesdocker- opencv_instructionsFAQadvanced_tools/advanced_toolsref/ref-Contribute !+Contribute!---------------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_ .+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:: htmldiff --git a/docs/install.rst b/docs/install.rstindex 6a9402fc..f5acd0f2 100644--- a/docs/install.rst+++ b/docs/install.rst@@ -19,7 +19,7 @@ If you have neither ``setuptools`` nor ``ez_setup`` installed the command above(sudo) python setup.py install-MoviePy depends on the Python modules NumPy_, Imageio_, Decorator_, and Proglog_, which will be automatically installed during MoviePy's installation. It should work on Windows/Mac/Linux, with Python 2.7+ and 3 ; if you have trouble installing MoviePy or one of its dependencies, please provide feedback !+MoviePy depends on the Python modules NumPy_, Imageio_, Decorator_, and Proglog_, which will be automatically installed during MoviePy's installation. It should work on Windows/Mac/Linux, with Python 2.7+ and 3 ; if you have trouble installing MoviePy or one of its dependencies, please provide feedback!MoviePy depends on the software FFMPEG for video reading and writing. You don't need to worry about that, as FFMPEG should be automatically downloaded/installed by ImageIO during your first use of MoviePy (it takes a few seconds). If you want to use a specific version of FFMPEG, you can set the FFMPEG_BINARY environment variable See ``moviepy/config_defaults.py`` for details.@@ -29,7 +29,7 @@ Other optional but useful dependenciesImageMagick_ is not strictly required, only if you want to write texts. It can also be used as a backend for GIFs but you can do GIFs with MoviePy without ImageMagick.-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/config_defaults.py`` file and provide the path to the ImageMagick binary called `magick`. It should look like this ::+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/config_defaults.py`` file and provide the path to the ImageMagick binary called `magick`. It should look like this ::IMAGEMAGICK_BINARY = "C:\\Program Files\\ImageMagick_VERSION\\magick.exe"@@ -65,6 +65,6 @@ If you are on linux, these packages will likely be in your repos... _Github: https://github.com/Zulko/moviepy.. _PyPI: https://pypi.python.org/pypi/moviepy-.. _`OpenCV 2.4.6`: https://sourceforge.net/projects/opencvlibrary/files/+.. _`OpenCV 2.4.6`: https://github.com/skvark/opencv-pythondiff --git a/docs/opencv_instructions.rst b/docs/opencv_instructions.rstdeleted file mode 100644index de161762..00000000--- a/docs/opencv_instructions.rst+++ /dev/null@@ -1,35 +0,0 @@-.. _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.diff --git a/examples/headblur.py b/examples/headblur.pyindex 4d3193ef..83cca724 100644--- a/examples/headblur.py+++ b/examples/headblur.py@@ -34,7 +34,7 @@ clip_blurred = clip.fx(vfx.headblur, fx, fy, 25)# Generate the text, put in on a grey backgroundtxt = TextClip(- "Hey you ! \n You're blurry!",+ "Hey you! \n You're blurry!",color="grey70",size=clip.size,bg_color="grey20",diff --git a/examples/star_worms.py b/examples/star_worms.pyindex 0117fffb..58c8d736 100644--- a/examples/star_worms.py+++ b/examples/star_worms.py@@ -115,7 +115,7 @@ final.set_duration(8).write_videofile("starworms.avi", fps=5)We will now code the video tutorial for this video.When you think about it, it is a code for a video explaining how to- make another video using some code (this is so meta !).+ make another video using some code (this is so meta!).This code uses the variables of the previous code (it should be placedafter that previous code to work).diff --git a/moviepy/audio/fx/all/__init__.py b/moviepy/audio/fx/all/__init__.pyindex fabfc41e..02453c49 100644--- a/moviepy/audio/fx/all/__init__.py+++ b/moviepy/audio/fx/all/__init__.py@@ -1,5 +1,5 @@"""-Loads all the fx !+Loads all the fx!Usage:import moviepy.audio.fx.all as afxaudio_clip = afx.volume_x(some_clip, .5)