From 0523d3c613a008d5e5f5e0e7ad67b0fb93f0ca38 Mon Sep 17 00:00:00 2001 From: Alekz Date: Thu, 9 Apr 2020 18:58:20 -0500 Subject: [PATCH 1/8] Added encoding optional parameter to subtitle file loading feature (#1043) --- CHANGELOG.md | 1 + moviepy/video/tools/subtitles.py | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3f31bf63..ae1215e13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Support removed for Python versions 2.7, 3.4 & 3.5 [#1103, #1106] ### Added +- Optional `encoding` parameter in `SubtitlesClip` [#1043] ### Changed diff --git a/moviepy/video/tools/subtitles.py b/moviepy/video/tools/subtitles.py index 25a23a0df..d0ae3974c 100644 --- a/moviepy/video/tools/subtitles.py +++ b/moviepy/video/tools/subtitles.py @@ -20,6 +20,9 @@ class SubtitlesClip(VideoClip): subtitles Either the name of a file, or a list + encoding + Optional, specifies srt file encoding. + Any standard Python encoding is allowed (listed at https://docs.python.org/3.8/library/codecs.html#standard-encodings) Examples ========= @@ -28,18 +31,19 @@ class SubtitlesClip(VideoClip): >>> from moviepy.video.io.VideoFileClip import VideoFileClip >>> generator = lambda txt: TextClip(txt, font='Georgia-Regular', fontsize=24, color='white') >>> sub = SubtitlesClip("subtitles.srt", generator) + >>> sub = SubtitlesClip("subtitles.srt", generator, encoding='utf-8') >>> myvideo = VideoFileClip("myvideo.avi") >>> final = CompositeVideoClip([clip, subtitles]) >>> final.write_videofile("final.mp4", fps=myvideo.fps) """ - def __init__(self, subtitles, make_textclip=None): + def __init__(self, subtitles, make_textclip=None, encoding=None): VideoClip.__init__(self, has_constant_size=False) if isinstance(subtitles, str): - subtitles = file_to_subtitles(subtitles) + subtitles = file_to_subtitles(subtitles, encoding=encoding) # subtitles = [(map(cvsecs, tt),txt) for tt, txt in subtitles] self.subtitles = subtitles @@ -144,7 +148,7 @@ def write_srt(self, filename): f.write(str(self)) -def file_to_subtitles(filename): +def file_to_subtitles(filename, encoding=None): """ Converts a srt file into subtitles. The returned list is of the form ``[((ta,tb),'some text'),...]`` @@ -152,10 +156,11 @@ def file_to_subtitles(filename): Only works for '.srt' format for the moment. """ + times_texts = [] current_times = None current_text = "" - with open(filename, "r") as f: + with open(filename, "r", encoding=encoding) as f: for line in f: times = re.findall("([0-9]*:[0-9]*:[0-9]*,[0-9]*)", line) if times: From 02bcf1a00a912f184d46ea1589e8353d24cc1f0d Mon Sep 17 00:00:00 2001 From: Tom Burrows Date: Sat, 11 Apr 2020 12:52:12 +0100 Subject: [PATCH 2/8] Followup to TextClip.list() fix (#1119) (#1132) --- moviepy/video/VideoClip.py | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/moviepy/video/VideoClip.py b/moviepy/video/VideoClip.py index cce72c78a..b97db58cd 100644 --- a/moviepy/video/VideoClip.py +++ b/moviepy/video/VideoClip.py @@ -13,9 +13,9 @@ import proglog from imageio import imread, imsave -from ..Clip import Clip -from ..config import get_setting -from ..decorators import ( +from moviepy.Clip import Clip +from moviepy.config import get_setting +from moviepy.decorators import ( add_mask_if_none, apply_to_mask, convert_masks_to_RGB, @@ -24,14 +24,18 @@ requires_duration, use_clip_fps_by_default, ) -from ..tools import ( +from moviepy.tools import ( extensions_dict, find_extension, subprocess_call, ) -from .io.ffmpeg_writer import ffmpeg_write_video -from .io.gif_writers import write_gif, write_gif_with_image_io, write_gif_with_tempfiles -from .tools.drawing import blit +from moviepy.video.io.ffmpeg_writer import ffmpeg_write_video +from moviepy.video.io.gif_writers import ( + write_gif, + write_gif_with_image_io, + write_gif_with_tempfiles, +) +from moviepy.video.tools.drawing import blit class VideoClip(Clip): @@ -1231,14 +1235,20 @@ def list(arg): popen_params["creationflags"] = 0x08000000 process = sp.Popen( - [get_setting("IMAGEMAGICK_BINARY"), "-list", arg], **popen_params + [get_setting("IMAGEMAGICK_BINARY"), "-list", arg], + encoding="utf-8", + **popen_params, ) - result = process.communicate()[0].decode() + result = process.communicate()[0] lines = result.splitlines() if arg == "font": + # Slice removes first 8 characters: " Font: " return [l[8:] for l in lines if l.startswith(" Font:")] elif arg == "color": + # Each line is of the format "aqua srgb(0,255,255) SVG" so split on space and take + # the first item to get the color name. + # The first 5 lines are header information, not colors, so ignore return [l.split(" ")[0] for l in lines[5:]] else: raise Exception("Moviepy Error: Argument must equal 'font' or 'color'") From b606067833d95016937fb90732400d93ee5389e8 Mon Sep 17 00:00:00 2001 From: Tom Burrows Date: Tue, 14 Apr 2020 16:41:47 +0100 Subject: [PATCH 3/8] Fix for `ColorClip.rotate()` (#1139) --- CHANGELOG.md | 1 + moviepy/video/fx/rotate.py | 5 ++++- tests/test_fx.py | 10 ++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae1215e13..0069aef8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - When using `VideoClip.write_videofile()` with `write_logfile=True`, errors would not be properly reported [#890] - `TextClip.list("color")` now returns a list of bytes, not strings [#1119] - `TextClip.search("colorname", "color")` does not crash with a TypeError [#1119] +- Using `rotate()` with a `ColorClip` no longer crashes [#1139] ## [v1.0.2](https://github.com/zulko/moviepy/tree/v1.0.2) (2020-03-26) diff --git a/moviepy/video/fx/rotate.py b/moviepy/video/fx/rotate.py index e20623e70..3aeddba38 100644 --- a/moviepy/video/fx/rotate.py +++ b/moviepy/video/fx/rotate.py @@ -8,8 +8,11 @@ PIL_FOUND = True def pil_rotater(pic, angle, resample, expand): + # Ensures that pic is of the correct type return np.array( - Image.fromarray(pic).rotate(angle, expand=expand, resample=resample) + Image.fromarray(np.array(pic).astype(np.uint8)).rotate( + angle, expand=expand, resample=resample + ) ) diff --git a/tests/test_fx.py b/tests/test_fx.py index eb46b5ba7..8de4b6d27 100644 --- a/tests/test_fx.py +++ b/tests/test_fx.py @@ -6,6 +6,7 @@ from moviepy.audio.fx.audio_normalize import audio_normalize from moviepy.audio.io.AudioFileClip import AudioFileClip from moviepy.utils import close_all_clips +from moviepy.video.VideoClip import ColorClip from moviepy.video.fx.blackwhite import blackwhite # from moviepy.video.fx.blink import blink @@ -216,6 +217,15 @@ def test_rotate(): clip4 = rotate(clip, 360) # rotate 90 degrees assert clip4.size == tuple(clip.size) clip4.write_videofile(os.path.join(TMP_DIR, "rotate4.webm")) + + clip5 = rotate(clip, 50) + clip5.write_videofile(os.path.join(TMP_DIR, "rotate5.webm")) + + # Test rotate with color clip + clip = ColorClip([600, 400], [150, 250, 100]).set_duration(1).set_fps(5) + clip = rotate(clip, 20) + clip.write_videofile(os.path.join(TMP_DIR, "color_rotate.webm")) + close_all_clips(locals()) From 00693440aec790b3412088efbe59d358b671ab2c Mon Sep 17 00:00:00 2001 From: Jonne Kaunisto Date: Tue, 14 Apr 2020 12:16:28 -0700 Subject: [PATCH 4/8] Fix undefined variable in Clip.set_end() (#1146) --- moviepy/Clip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moviepy/Clip.py b/moviepy/Clip.py index fb3ea2cb7..51ec13976 100644 --- a/moviepy/Clip.py +++ b/moviepy/Clip.py @@ -262,7 +262,7 @@ def set_end(self, t): return if self.start is None: if self.duration is not None: - self.start = max(0, t - newclip.duration) + self.start = max(0, t - self.duration) else: self.duration = self.end - self.start From 0c0275c8c2f55dfea754f1284458f88c585fbb34 Mon Sep 17 00:00:00 2001 From: Tom Burrows Date: Wed, 15 Apr 2020 10:06:51 +0100 Subject: [PATCH 5/8] Add --diff to black check --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7dfb31cd1..bf126a35b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,4 +11,4 @@ jobs: - name: Black Code Formatter uses: lgeiger/black-action@v1.0.1 with: - args: "--check --target-version py36 $GITHUB_WORKSPACE" \ No newline at end of file + args: "--check --diff --target-version py36 $GITHUB_WORKSPACE" From c62c8b181a7cb9c0a4d89ddb859eee3c0ef6042f Mon Sep 17 00:00:00 2001 From: Roman Scher Date: Fri, 17 Apr 2020 05:44:45 -0400 Subject: [PATCH 6/8] Add test for detect_scenes (#589) --- tests/test_videotools.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/test_videotools.py b/tests/test_videotools.py index 2609341c7..0ed9dda3d 100644 --- a/tests/test_videotools.py +++ b/tests/test_videotools.py @@ -1,9 +1,11 @@ # -*- coding: utf-8 -*- """Video file clip tests meant to be run with pytest.""" import os -import sys +from moviepy.video.VideoClip import ColorClip +from moviepy.video.compositing.concatenate import concatenate_videoclips from moviepy.video.tools.credits import credits1 +from moviepy.video.tools.cuts import detect_scenes from .test_helper import TMP_DIR, FONT @@ -38,3 +40,16 @@ def test_credits(): image = image.set_duration(3) image.write_videofile(vid_location, fps=24) assert os.path.isfile(vid_location) + + +def test_detect_scenes(): + """ + Test that a cut is detected between concatenated red and green clips + """ + red = ColorClip((640, 480), color=(255, 0, 0)).set_duration(1) + green = ColorClip((640, 480), color=(0, 200, 0)).set_duration(1) + video = concatenate_videoclips([red, green]) + + cuts, luminosities = detect_scenes(video, fps=10, logger=None) + + assert len(cuts) == 2 From a996fbaf50ff09103cbd68e614f0d0e225f69336 Mon Sep 17 00:00:00 2001 From: Tom Burrows Date: Fri, 17 Apr 2020 10:48:36 +0100 Subject: [PATCH 7/8] Fix undefined name warning in ez_setup.py (#1149) --- ez_setup.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/ez_setup.py b/ez_setup.py index b0d6f2aab..29bbd6d0f 100644 --- a/ez_setup.py +++ b/ez_setup.py @@ -206,15 +206,7 @@ def _extractall(self, path=".", members=None): self.extract(tarinfo, path) # Reverse sort directories. - if sys.version_info < (2, 4): - - def sorter(dir1, dir2): - return cmp(dir1.name, dir2.name) - - directories.sort(sorter) - directories.reverse() - else: - directories.sort(key=operator.attrgetter("name"), reverse=True) + directories.sort(key=operator.attrgetter("name"), reverse=True) # Set correct owner, mtime and filemode on directories. for tarinfo in directories: From 103b2aa006f5dcc201abb343dc86b14c647d1b5d Mon Sep 17 00:00:00 2001 From: Jonne Kaunisto Date: Fri, 17 Apr 2020 17:54:29 -0700 Subject: [PATCH 8/8] Delete outdated opencv install instructions and fixe english syntax (#1148) --- README.rst | 2 +- docs/FAQ.rst | 2 +- docs/examples/compo_from_image.rst | 2 +- docs/gallery.rst | 2 +- docs/getting_started/compositing.rst | 2 +- docs/getting_started/effects.rst | 4 +-- docs/getting_started/efficient_moviepy.rst | 4 +-- docs/getting_started/quick_presentation.rst | 4 +-- docs/getting_started/videoclips.rst | 8 ++--- docs/index.rst | 5 ++- docs/install.rst | 6 ++-- docs/opencv_instructions.rst | 35 --------------------- examples/headblur.py | 2 +- examples/star_worms.py | 2 +- moviepy/audio/fx/all/__init__.py | 2 +- 15 files changed, 23 insertions(+), 59 deletions(-) delete mode 100644 docs/opencv_instructions.rst diff --git a/README.rst b/README.rst index 62003b4fb..c39d9b0f6 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.rst index 6eaadf980..2ff04b07e 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.rst index c6f31fd08..d542adb3d 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:: html diff --git a/docs/gallery.rst b/docs/gallery.rst index fd74ed72e..53473705c 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.rst index 082b576bb..6447d40fa 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.rst index 923c3a15f..1f6241b1f 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 modi my_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.rst index ea328c307..5a8f91383 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.rst index 54884da45..2561e4060 100644 --- a/docs/getting_started/quick_presentation.rst +++ b/docs/getting_started/quick_presentation.rst @@ -5,7 +5,7 @@ Quick presentation This 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 clip video = 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.rst index 817f74fd4..dbae04b8c 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 array clip = 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 seconds my_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 GIFs diff --git a/docs/index.rst b/docs/index.rst index 1e8d21234..5007c37cf 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -27,15 +27,14 @@ User Guide gallery examples/examples docker - opencv_instructions FAQ advanced_tools/advanced_tools ref/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:: html diff --git a/docs/install.rst b/docs/install.rst index 6a9402fcf..f5acd0f28 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 dependencies ImageMagick_ 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-python diff --git a/docs/opencv_instructions.rst b/docs/opencv_instructions.rst deleted file mode 100644 index de161762f..000000000 --- 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.py index 4d3193ef2..83cca724e 100644 --- a/examples/headblur.py +++ b/examples/headblur.py @@ -34,7 +34,7 @@ # Generate the text, put in on a grey background txt = 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.py index 0117fffb6..58c8d736a 100644 --- a/examples/star_worms.py +++ b/examples/star_worms.py @@ -115,7 +115,7 @@ def trapzWarp(pic, cx, cy, ismask=False): 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 placed after that previous code to work). diff --git a/moviepy/audio/fx/all/__init__.py b/moviepy/audio/fx/all/__init__.py index fabfc41e0..02453c497 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 afx audio_clip = afx.volume_x(some_clip, .5)