MoviePy is a Python library for video editing, can read and write all the most common audio and video formats

Overview

MoviePy

MoviePy page on the Python Package Index Discuss MoviePy on Gitter Build status on gh-actions Code coverage from coveralls.io

MoviePy (full documentation) is a Python library for video editing: cutting, concatenations, title insertions, video compositing (a.k.a. non-linear editing), video processing, and creation of custom effects. See the gallery for some examples of use.

MoviePy can read and write all the most common audio and video formats, including GIF, and runs on Windows/Mac/Linux, with Python 3.6+. Here it is in action in an IPython notebook:

[logo]

Example

In this example we open a video file, select the subclip between t=50s and t=60s, add a title at the center of the screen, and write the result to a new file:

from moviepy import *

video = VideoFileClip("myHolidays.mp4").subclip(50,60)

# Make the text. Many more options are available.
txt_clip = ( TextClip("My Holidays 2013",fontsize=70,color='white')
             .with_position('center')
             .with_duration(10) )

result = CompositeVideoClip([video, txt_clip]) # Overlay text on video
result.write_videofile("myHolidays_edited.webm",fps=25) # Many options...

Maintainers wanted!

As there are more and more people seeking support (270 open issues as of Jan. 2021!) and all the MoviePy maintainers seem busy, we'd love to hear about developers interested in giving a hand and solving some of the issues (especially the ones that affect you) or reviewing pull requests. Open an issue or contact us directly if you are interested. Thanks!

Installation

MoviePy depends on the Python modules NumPy, Imageio, Decorator, and Proglog, which will be automatically installed during MoviePy's installation. The software FFMPEG should be automatically downloaded/installed (by imageio) during your first use of MoviePy (installation will take a few seconds). If you want to use a specific version of FFMPEG, follow the instructions in config_defaults.py. In case of trouble, provide feedback.

Installation by hand: download the sources, either from PyPI or, if you want the development version, from GitHub, unzip everything into one folder, open a terminal and type:

$ (sudo) python setup.py install

Installation with pip: if you have pip installed, just type this in a terminal:

$ (sudo) pip install moviepy

If you have neither setuptools nor ez_setup installed, the command above will fail. In this case type this before installing:

$ (sudo) pip install setuptools

Optional but useful dependencies

You can install moviepy with all dependencies via:

$ (sudo) pip install moviepy[optional]

ImageMagick is not strictly required, but needed if you want to incorporate texts. It can also be used as a backend for GIFs, though you can also create GIFs with MoviePy without ImageMagick.

Once you have installed ImageMagick, MoviePy will try to autodetect the path to its executable. If it fails, you can still configure it by setting environment variables (see the documentation).

PyGame is needed for video and sound previews (not relevant if you intend to work with MoviePy on a server but essential for advanced video editing by hand).

For advanced image processing, you will need one or several of the following packages:

  • The Python Imaging Library (PIL) or, even better, its branch Pillow.
  • Scipy (for tracking, segmenting, etc.) can be used to resize video clips if PIL and OpenCV are not installed.
  • Scikit Image may be needed for some advanced image manipulation.
  • OpenCV 2.4.6 or a more recent version (one that provides the package cv2) may be needed for some advanced image manipulation.
  • Matplotlib

For instance, using the method clip.resize requires that at least one of Scipy, PIL, Pillow or OpenCV is installed.

Documentation

Building the documentation has additional dependencies that require installation.

$ (sudo) pip install moviepy[doc]

The documentation can be generated and viewed via:

$ python setup.py build_docs

You can pass additional arguments to the documentation build, such as clean build:

$ python setup.py build_docs -E

More information is available from the Sphinx documentation.

New in 1.0.0: Progress bars and messages with Proglog

Non-backwards-compatible changes were introduced in 1.0.0 to manage progress bars and messages using Proglog, which enables to display nice progress bars in the console as well as in a Jupyter notebook or any user interface, like a website.

To display notebook friendly progress bars, first install IPyWidgets:

sudo pip install ipywidgets
sudo jupyter nbextension enable --py --sys-prefix widgetsnbextension

Then at the beginning of your notebook enter:

import proglog
proglog.notebook()

Have a look at the Proglog project page for more options.

Contribute

MoviePy is open-source software originally written by Zulko and released under the MIT licence. The project is hosted on GitHub, where everyone is welcome to contribute, ask for help or simply give feedback. Please read our Contributing Guidelines for more information about how to contribute!

You can also discuss the project on Reddit or Gitter. These are preferred over GitHub issues for usage questions and examples.

Maintainers

Issues
  • add Dockerfile

    add Dockerfile

    for people that use docker, they will easily be able to install moviepy.

    feature 
    opened by earney 57
  • AttributeError: 'NoneType' object has no attribute 'stdout'

    AttributeError: 'NoneType' object has no attribute 'stdout'

    Notice

    If you have arrived here from google, you will probably find that updating your moviepy version to v1.0.3 or higher will fix the issue (pip install moviepy --upgrade). See #1185.


    Expected Behavior

    Expected to get an edited version of the inputted video.

    Actual Behavior

    Produces this error:

    Moviepy - Building video test.webm.
    MoviePy - Writing audio in testTEMP_MPY_wvf_snd.ogg
    chunk:   0%|          | 0/552 [00:00<?, ?it/s, now=None]Traceback (most recent call last):
      File "/home/tech/Developement/CrabRaveGenerator/Test.py", line 8, in <module>
        ]).write_videofile("test.webm", fps = 30)
      File "</usr/local/lib/python3.5/dist-packages/decorator.py:decorator-gen-51>", line 2, in write_videofile
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/decorators.py", line 54, in requires_duration
        return f(clip, *a, **k)
      File "</usr/local/lib/python3.5/dist-packages/decorator.py:decorator-gen-50>", line 2, in write_videofile
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/decorators.py", line 137, in use_clip_fps_by_default
        return f(clip, *new_a, **new_kw)
      File "</usr/local/lib/python3.5/dist-packages/decorator.py:decorator-gen-49>", line 2, in write_videofile
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/decorators.py", line 22, in convert_masks_to_RGB
        return f(clip, *a, **k)
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/video/VideoClip.py", line 317, in write_videofile
        logger=logger)
      File "</usr/local/lib/python3.5/dist-packages/decorator.py:decorator-gen-73>", line 2, in write_audiofile
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/decorators.py", line 54, in requires_duration
        return f(clip, *a, **k)
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/audio/AudioClip.py", line 209, in write_audiofile
        logger=logger)
      File "</usr/local/lib/python3.5/dist-packages/decorator.py:decorator-gen-70>", line 2, in ffmpeg_audiowrite
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/decorators.py", line 54, in requires_duration
        return f(clip, *a, **k)
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/audio/io/ffmpeg_audiowriter.py", line 169, in ffmpeg_audiowrite
        logger=logger):
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/audio/AudioClip.py", line 85, in iter_chunks
        fps=fps, buffersize=chunksize)
      File "</usr/local/lib/python3.5/dist-packages/decorator.py:decorator-gen-72>", line 2, in to_soundarray
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/decorators.py", line 54, in requires_duration
        return f(clip, *a, **k)
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/audio/AudioClip.py", line 126, in to_soundarray
        snd_array = self.get_frame(tt)
      File "</usr/local/lib/python3.5/dist-packages/decorator.py:decorator-gen-10>", line 2, in get_frame
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/decorators.py", line 89, in wrapper
        return f(*new_a, **new_kw)
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/Clip.py", line 95, in get_frame
        return self.make_frame(t)
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/audio/AudioClip.py", line 296, in make_frame
        for c, part in zip(self.clips, played_parts)
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/audio/AudioClip.py", line 297, in <listcomp>
        if (part is not False)]
      File "</usr/local/lib/python3.5/dist-packages/decorator.py:decorator-gen-10>", line 2, in get_frame
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/decorators.py", line 89, in wrapper
        return f(*new_a, **new_kw)
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/Clip.py", line 95, in get_frame
        return self.make_frame(t)
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/Clip.py", line 138, in <lambda>
        newclip = self.set_make_frame(lambda t: fun(self.get_frame, t))
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/Clip.py", line 190, in <lambda>
        return self.fl(lambda gf, t: gf(t_func(t)), apply_to,
      File "</usr/local/lib/python3.5/dist-packages/decorator.py:decorator-gen-10>", line 2, in get_frame
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/decorators.py", line 89, in wrapper
        return f(*new_a, **new_kw)
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/Clip.py", line 95, in get_frame
        return self.make_frame(t)
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/audio/io/AudioFileClip.py", line 78, in <lambda>
        self.make_frame = lambda t: self.reader.get_frame(t)
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/audio/io/readers.py", line 180, in get_frame
        self.buffer_around(fr_min)
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/audio/io/readers.py", line 238, in buffer_around
        array = self.read_chunk(chunksize)
      File "/usr/local/lib/python3.5/dist-packages/moviepy-1.0.0-py3.5.egg/moviepy/audio/io/readers.py", line 112, in read_chunk
        s = self.proc.stdout.read(L)
    AttributeError: 'NoneType' object has no attribute 'stdout'
                                                            
    

    Steps to Reproduce the Problem

    Run the following code:

    from moviepy.editor import CompositeVideoClip, VideoFileClip, TextClip
    
    CompositeVideoClip([
    
        VideoFileClip("template.webm").subclip(5, 30), 
        TextClip("Test Text", fontsize = 70, color = 'white').set_position('center').set_duration(10)
        
    ]).write_videofile("test.webm", fps = 30)
    

    Specifications

    • Python Version: 3.5.3
    • Moviepy Version: 1.0.0
    • Platform Name: Debian
    • Platform Version: 9.8
    video 
    opened by Technerder 40
  • Error: wrong indices in video buffer. Maybe buffer too small.

    Error: wrong indices in video buffer. Maybe buffer too small.

    The following code:

    wordSlide = ColorClip((1280,720), (228,232,111))
    wordText = TextClip(wordStr, font="Arial-Regular", color="YellowGreen", fontsize=90)
    wordAudio = AudioFileClip(path + "word.aif")
    wordClip = CompositeVideoClip([wordSlide.set_audio(wordAudio),
        wordText.set_pos('center')]).set_duration(wordAudio.duration)
    

    Produces:

    Error: wrong indices in video buffer. Maybe buffer too small.
    Exception in thread Thread-1:
    Traceback (most recent call last):
      File "/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
        self.run()
      File "/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
        self.__target(*self.__args, **self.__kwargs)
      File "<string>", line 2, in preview
      File "/usr/local/lib/python2.7/site-packages/moviepy/decorators.py", line 60, in requires_duration
        return f(clip, *a, **k)
      File "/usr/local/lib/python2.7/site-packages/moviepy/audio/io/preview.py", line 59, in preview
        sndarray = clip.to_soundarray(tt,nbytes)
      File "<string>", line 2, in to_soundarray
      File "/usr/local/lib/python2.7/site-packages/moviepy/decorators.py", line 60, in requires_duration
        return f(clip, *a, **k)
      File "/usr/local/lib/python2.7/site-packages/moviepy/audio/AudioClip.py", line 83, in to_soundarray
        snd_array = self.get_frame(tt)
      File "/usr/local/lib/python2.7/site-packages/moviepy/audio/AudioClip.py", line 189, in get_frame
        if (part is not False) ]
      File "/usr/local/lib/python2.7/site-packages/moviepy/audio/io/AudioFileClip.py", line 69, in <lambda>
        self.get_frame =  lambda t: self.reader.get_frame(t)
      File "/usr/local/lib/python2.7/site-packages/moviepy/audio/io/readers.py", line 173, in get_frame
        raise error
    IndexError: index 45785 is out of bounds for axis 0 with size 45784
    

    A little hack that kinda makes it go away is to do:

    wordSlide = ColorClip((1280,720), (228,232,111))
    wordText = TextClip(wordStr, font="Arial-Regular", color="YellowGreen", fontsize=90)
    wordAudio = AudioFileClip(path + "word.aif")
    wordClip = CompositeVideoClip([wordSlide.set_audio(wordAudio),
        wordText.set_pos('center')]).set_duration(wordAudio.duration - 0.01)
    

    Although this doesn't fix anything. It just happens to work in this case, but not for other clips. Why is it crashing?

    The wordAudio.duration is 1.04s in this case. On some audio files it crashes, on some it doesn't. Is this the accuracy problem with generating number of frames based on audio length?

    opened by Netherdrake 38
  • Implement multithreading

    Implement multithreading

    Implement multithreading

    Implement multithreaded clip rendering to file Allow for more CPU utilization especially on heavily edited clips

    Refs #584, #139

    feature 
    opened by MythicManiac 27
  • FFMPEG not downloaded

    FFMPEG not downloaded

    Until two days ago, imageio was downloading ffmpeg correctly. It is not doing so anymore.

    ERR Traceback (most recent call last):
    ERR   File "restapi.py", line 9, in <module>
    ERR     from modules.location_from_media_module import location_from_media
    ERR     from helpers.flicksys_audio_video import get_video, get_frame, make_url, delete_file
    ERR   File "/home/vcap/app/helpers/flicksys_audio_video.py", line 5, in <module>
    ERR   File "/app/.heroku/python/lib/python2.7/site-packages/moviepy/editor.py", line 22, in <module>
    ERR     from .video.io.VideoFileClip import VideoFileClip
    File "/app/.heroku/python/lib/python2.7/site-packages/moviepy/video/io/VideoFileClip.py", line 3, in <module>
    ERR     from moviepy.video.VideoClip import VideoClip
    ERR   File "/app/.heroku/python/lib/python2.7/site-packages/moviepy/video/VideoClip.py", line 20, in <module>
    ERR     from .io.ffmpeg_writer import ffmpeg_write_image, ffmpeg_write_video
    ERR   File "/app/.heroku/python/lib/python2.7/site-packages/moviepy/video/io/ffmpeg_writer.py", line 19, in <module>
    ERR   File "/app/.heroku/python/lib/python2.7/site-packages/moviepy/config.py", line 38, in <module>
    ERR     FFMPEG_BINARY = get_exe()
    ERR   File "/app/.heroku/python/lib/python2.7/site-packages/imageio/plugins/ffmpeg.py", line 86, in get_exe
    ERR     raise NeedDownloadError('Need ffmpeg exe. '
    ERR imageio.core.fetching.NeedDownloadError: Need ffmpeg exe. You can download it by calling:
    ERR   imageio.plugins.ffmpeg.download()
    

    Details of deployed server:

    IBM Bluemix CloudFoundry App Runs Ubuntu 14.04 LTS Server Moviepy installed via pip.

    Adding the line imagio.plugins.ffmpeg.download() to my python code has no effect. Also, I'm not sure why it is looking for ffmpeg exe when it is running on a linux server.

    3rd-party stale 
    opened by kartikarora 26
  • `error: string:` When trying to import from moviepy

    `error: string:` When trying to import from moviepy

    Refer to this line of code: https://github.com/Zulko/moviepy/blob/b93b3217f3acba7e5e4e37f295e4cff2ad2a821d/moviepy/video/io/ffmpeg_reader.py#L99

    I successfully installed moviepy and every dependency, for example: import moviepy and from moviepy.editor import * works, along with import pygame, etc. I also did sudo apt-get install libav-tools for the ffmpeg library.

    However, the line clip = VideoFileClip("some_video.mp4").subclip(0, 60) causes my terminal to blank into a new, unusual terminal console with one line of error: error: string:

    I am using Ubunu 12.04.3 Server.

    bug 
    opened by codelucas 24
  • Repo activity and pending PRs

    Repo activity and pending PRs

    Hello!

    First off, thank you for the repo @Zulko!

    Looking at the repository, it appears there are a good number of pull requests that are awaiting review and merging.

    Would it be possible to have some of these PRs merging into master or even a develop branch? Are you open to allowing contributor merging and/or automated builds?

    Thank you again!

    question 
    opened by mbeacom 23
  • AssertionError in ffmpeg_reader.py

    AssertionError in ffmpeg_reader.py

    I get this error when trying to use moviepy

    >>> from moviepy.editor import *
    >>> VideoFileClip("test.mp4")
    Traceback (most recent call last):
      File "<input>", line 1, in <module>
      File ".../local/lib/python2.7/site-packages/moviepy/v
    ideo/io/VideoFileClip.py", line 46, in __init__
        self.reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt)
      File ".../local/lib/python2.7/site-packages/moviepy/v
    ideo/io/ffmpeg_reader.py", line 33, in __init__
        self.lastread = self.read_frame()
      File .../local/lib/python2.7/site-packages/moviepy/v
    ideo/io/ffmpeg_reader.py", line 109, in read_frame
        assert len(s) == nbytes
    AssertionError
    

    (This line)

    Python version: 2.7.3 pip freeze: (I installed moviepy via pip)

    Pygments==1.6
    argparse==1.2.1
    bpython==0.12
    decorator==3.4.0
    moviepy==0.2.1.7
    numpy==1.8.0
    tqdm==1.0
    wsgiref==0.1.2
    

    ffmpeg version

    ffmpeg 0.8.10-4:0.8.10-0ubuntu0.12.04.1
    libavutil    51. 22. 2 / 51. 22. 2
    libavcodec   53. 35. 0 / 53. 35. 0
    libavformat  53. 21. 1 / 53. 21. 1
    libavdevice  53.  2. 0 / 53.  2. 0
    libavfilter   2. 15. 0 /  2. 15. 0
    libswscale    2.  1. 0 /  2.  1. 0
    libpostproc  52.  0. 0 / 52.  0. 0
    
    opened by kviktor 23
  • Some advice for improve CompositeVideoClip TextClip and the blit

    Some advice for improve CompositeVideoClip TextClip and the blit

    Since I was been stumped with the perfermance of my edit, I try to figure out the reason that slow down the program, and luckly I found couple of them. The first one is CompositeVideoClip, its blit all clip for every frame,so the speed is decreasing as the number of clips increased, speed comes 1s/it when there are 20 clips needs to be composited, one solution is using PIL.Image.paste, it much faster, create a bg image object and paste other clip on it, it's really fast,came up to 30it/s second one is blit func, I think PIL Image.paste is useful too. And last one is Textclip, I use PIL imagefont to gen text image, Its much faster than imagemagisk,maybe it is possible to escape imagemagisk.

    feature-request 3rd-party images imagemagick performance 
    opened by ODtian 22
  • I find that my README.md file example is not working on my enviroment.

    I find that my README.md file example is not working on my enviroment.

    Expected Behavior

    Thanks for your library. That's so nice library.

    I find something matter. I tried that use example code on my computer, and that didn't work.

    Actual Behavior

    from moviepy.editor import *
    BASE_DIR = './movie_files/'
    MOVIE_URL = 'puppies.mp4'
    
    video = VideoFileClip(BASE_DIR + MOVIE_URL).subclip(0, 10)
    
    # Make the text. Many more options are available.
    txt_clip = (TextClip("My Holidays 2013", fontsize=70, color='white')
                 .with_position('center')
                 .with_duration(10))
    
    result = CompositeVideoClip([video, txt_clip]) # Overlay text on video
    result.write_videofile(BASE_DIR + "myHolidays_edited.mp4", fps=25) # Many options...
    

    I confirm that import moivepy import * didn't work. I had to use import moviepy.editor import *. I think the version of moviepy is updated and that makes different.

    Steps to Reproduce the Problem

    Specifications

    • Python Version: 3.8.9
    • Moviepy Version: 1.0.3
    • Platform Name: Mac
    • Platform Version: Sierra 11.6
    bug 
    opened by melonicedlatte 0
  • Question: How to Avoid Stopping Video Writing Process When a SIGINT or SIGTERM is received.

    Question: How to Avoid Stopping Video Writing Process When a SIGINT or SIGTERM is received.

    I'm trying to write a video with moviepy on a temp dir.

    Here's a sample code:

    video_file_name = '{}/{}'.format(tempfile.mkdtemp(), 'somefile.mp4')
    clip.write_videofile(video_file_name, audio = False, threads =4,logger = None)
    

    This works perfectly fine. However In my app context I want to be able to catch SIGTERM or SIGINT signals and wait until this write finishes before actually killing the app.

    I do it this way:

    signal.signal(signal.SIGINT, self.exit_gracefully)
    signal.signal(signal.SIGTERM, self.exit_gracefully)
    
    def exit_gracefully():
        # Some logic to wait for video processing to finish, for now we'll wait 1 hour to give enough time.
        time.sleep(3600)
    

    The problem is that when I do this, moviepy raises an exception like this:

    /lib/python3.7/site-packages/moviepy/video/io/ffmpeg_writer.py", line 136, in write_frame
        self.proc.stdin.write(img_array.tobytes())
    BrokenPipeError: [Errno 32] Broken pipe
    
    During handling of the above exception, another exception occurred:
    
          File "<decorator-gen-55>", line 2, in write_videofile
          File "lib/python3.7/site-packages/moviepy/decorators.py", line 54, in requires_duration
            return f(clip, *a, **k)
          File "<decorator-gen-54>", line 2, in write_videofile
          File "lib/python3.7/site-packages/moviepy/decorators.py", line 135, in use_clip_fps_by_default
            return f(clip, *new_a, **new_kw)
          File "<decorator-gen-53>", line 2, in write_videofile
          File "lib/python3.7/site-packages/moviepy/decorators.py", line 22, in convert_masks_to_RGB
            return f(clip, *a, **k)
          File "lib/python3.7/site-packages/moviepy/video/VideoClip.py", line 307, in write_videofile
            logger=logger)
          File "lib/python3.7/site-packages/moviepy/video/io/ffmpeg_writer.py", line 228, in ffmpeg_write_video
            writer.write_frame(frame)
          File "lib/python3.7/site-packages/moviepy/video/io/ffmpeg_writer.py", line 180, in write_frame
            raise IOError(error)
        OSError: [Errno 32] Broken pipe
        
        MoviePy error: FFMPEG encountered the following error while writing file /tmp/tmpt0o8ae6e/1633997015.176414_re_saved.mp4:
        
         b''
    

    Is there a way I can go around this error and allow my write file to finish? Another context is that this write_videofile() function is executed on a separate thread, I'm not sure if that's useful but it might help to give more insights.

    Any ideas on how I can solve this?

    Thanks!

    question 
    opened by PJEstrada 0
  • concatenating videoclips result in laggy result video

    concatenating videoclips result in laggy result video

    Expected Behavior

    For short videoclips concatenation the resulted video is smooth containing all composing videos.

    Actual Behavior

    The resulting video has lag between the composing parts, some of the parts being completly missing and replaced with the freezed last frame of the previous composing video.

    We can see the results in the following amv video: https://www.youtube.com/watch?v=3ksI-EIphXY

    Steps to Reproduce the Problem

    I have the following code:

    beginTime = 10
    endTime = beginTime + intervals[0]
    for c,i in enumerate(intervals[1:-1]):
      print(f"beginTime{beginTime}")
      print(f"endTime{endTime}")
      output = "./sample%d.mp4" % (c)
      ffmpeg_extract_subclip(videoPath, beginTime, endTime, output)
      #beginTime = randint(intro_duration ,maxVideoDur) 
      beginTime = endTime + randint(1, maxRand) 
      endTime = beginTime + i 
    
    L =[]
    for root, dirs, files in os.walk("./"):
    	#files = natsorted(files)
    	for file in files:
    	    if os.path.splitext(file)[1] == '.mp4':
    	        filePath = os.path.join(root, file)
    	        video = VideoFileClip(filePath)
    	        L.append(video)
    
    video = concatenate_videoclips(L)
    video.to_videofile("./video/output.mp4", fps=30)
    

    Specifications

    • Python Version:3.9.2
    • Moviepy Version: 1/0/3
    bug 
    opened by coralexbadea 0
  • Rephrase/clarify description of concatenation in docs

    Rephrase/clarify description of concatenation in docs

    Issue:

    In the docs on this page, the description of how the concatenation works is not clear. It describes the non-default scenario where you are using method="compose" for the concatenate_videoclips function. Here is the sentence:

    " The final_clip is a clip that plays the clips 1, 2, and 3 one after the other. Note that the clips do not need to be the same size. If they arent’s they will all appear centered in a clip large enough to contain the biggest of them, with optionnally a color of your choosing to fill the borders. You have many other options there (see the doc of the function). You can for instance play a transition clip between the clips with the option transition=my_clip. "

    Notice where I marked bold is what I am referring to. This should just include the note that the parameter method should be set to "compose".

    I can implement, just making the issue for clarity and possible discussion.

    documentation 
    opened by PinkShnack 0
  • Facing issue while converting Video file to audio .

    Facing issue while converting Video file to audio .

    I am facing error while converting video file to audio files. The video file has beed chunked into many small video files and then it is converted to audio files.But, while my program wants to read from the last audio file which is audioless, the program throw the below error:

    OSError: MoviePy error: failed to read the first frame of video file video.mp4. That might mean that the file is corrupted. That may also mean that you are using a deprecated version of FFMPEG. On Ubuntu/Debian for instance the version in the repos is deprecated. Please update to a recent version from the website. How can i solve this error.

    bug 
    opened by sandeshchand 0
  • Moviepy FFMpeg error

    Moviepy FFMpeg error

    While running Moviepy on FFMpeg, i get the following error `Moviepy - Building video videos/tommyinnit: "I don't even write essays".mp4. MoviePy - Writing audio in tommyinnit: "I don't even write essays"TEMP_MPY_wvf_snd.mp3 chunk: 0%| | 0/668 [00:00<?, ?it/s, now=None]Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/moviepy/audio/io/ffmpeg_audiowriter.py", line 74, in write_frames self.proc.stdin.write(frames_array.tobytes()) BrokenPipeError: [Errno 32] Broken pipe

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "/Users/maheshwari782532/Desktop/Youtube-Bot/bot.py", line 80, in v.write_videofile("videos/" + clip["broadcaster_name"] + ": " + clip["title"] + ".mp4") File "", line 2, in write_videofile File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/moviepy/decorators.py", line 54, in requires_duration return f(clip, *a, **k) File "", line 2, in write_videofile File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/moviepy/decorators.py", line 135, in use_clip_fps_by_default return f(clip, *new_a, **new_kw) File "", line 2, in write_videofile File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/moviepy/decorators.py", line 22, in convert_masks_to_RGB return f(clip, *a, **k) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/moviepy/video/VideoClip.py", line 293, in write_videofile self.audio.write_audiofile(audiofile, audio_fps, File "", line 2, in write_audiofile File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/moviepy/decorators.py", line 54, in requires_duration return f(clip, *a, **k) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/moviepy/audio/AudioClip.py", line 206, in write_audiofile return ffmpeg_audiowrite(self, filename, fps, nbytes, buffersize, File "", line 2, in ffmpeg_audiowrite File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/moviepy/decorators.py", line 54, in requires_duration return f(clip, *a, **k) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/moviepy/audio/io/ffmpeg_audiowriter.py", line 170, in ffmpeg_audiowrite writer.write_frames(chunk) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/moviepy/audio/io/ffmpeg_audiowriter.py", line 117, in write_frames raise IOError(error) OSError: [Errno 32] Broken pipe

    MoviePy error: FFMPEG encountered the following error while writing file tommyinnit: "I don't even write essays"TEMP_MPY_wvf_snd.mp3:

    b'tommyinnit: "I don't even write essays"TEMP_MPY_wvf_snd.mp3: Protocol not found\n'

    In case it helps, make sure you are using a recent version of FFMPEG (the versions in the Ubuntu/Debian repos are deprecated). Exception ignored in: <function FFMPEG_AudioWriter.del at 0x7fa129cb0670> Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/moviepy/audio/io/ffmpeg_audiowriter.py", line 132, in del self.close() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/moviepy/audio/io/ffmpeg_audiowriter.py", line 121, in close self.proc.stdin.close() BrokenPipeError: [Errno 32] Broken pipe` how do i fix this?

    3rd-party ffmpeg 
    opened by gitcoder101 0
  • 8 Bit Depth Images Can't be Cropped

    8 Bit Depth Images Can't be Cropped

    Expected Behavior

    I expect the image to be cropped.

    Actual Behavior

    Following error is thrown: Traceback (most recent call last): File "E:\DegenVideos\Scripts\DegenVideo\VideoMaker.py", line 197, in clipList = getImageClipList(ImageDir) File "E:\DegenVideos\Scripts\DegenVideo\VideoMaker.py", line 77, in getImageClipList clip = crop(clip, width=finalSize[0], height=finalSize[1], x_center=clip.size[0]/2, y_center=clip.size[1]/2) File "C:\Users<user>\AppData\Local\Programs\Python\Python39\lib\site-packages\moviepy\video\fx\crop.py", line 53, in crop return clip.fl_image(lambda pic: pic[int(y1) : int(y2), int(x1) : int(x2)], apply_to=["mask"]) File "C:\Users<user>\AppData\Local\Programs\Python\Python39\lib\site-packages\moviepy\video\VideoClip.py", line 490, in fl_image return self.fl(lambda gf, t: image_func(gf(t)), apply_to) File "C:\Users<user>\AppData\Local\Programs\Python\Python39\lib\site-packages\moviepy\Clip.py", line 136, in fl newclip = self.set_make_frame(lambda t: fun(self.get_frame, t)) File "", line 2, in set_make_frame File "C:\Users<user>\AppData\Local\Programs\Python\Python39\lib\site-packages\moviepy\decorators.py", line 14, in outplace f(newclip, *a, **k) File "C:\Users<user>\AppData\Local\Programs\Python\Python39\lib\site-packages\moviepy\video\VideoClip.py", line 644, in set_make_frame self.size = self.get_frame(0).shape[:2][::-1] File "", line 2, in get_frame File "C:\Users<user>\AppData\Local\Programs\Python\Python39\lib\site-packages\moviepy\decorators.py", line 89, in wrapper return f(*new_a, **new_kw) File "C:\Users<user>\AppData\Local\Programs\Python\Python39\lib\site-packages\moviepy\Clip.py", line 93, in get_frame return self.make_frame(t) File "C:\Users<user>\AppData\Local\Programs\Python\Python39\lib\site-packages\moviepy\Clip.py", line 136, in newclip = self.set_make_frame(lambda t: fun(self.get_frame, t)) File "C:\Users<user>\AppData\Local\Programs\Python\Python39\lib\site-packages\moviepy\video\VideoClip.py", line 490, in return self.fl(lambda gf, t: image_func(gf(t)), apply_to) File "", line 2, in get_frame File "C:\Users<user>\AppData\Local\Programs\Python\Python39\lib\site-packages\moviepy\decorators.py", line 89, in wrapper return f(*new_a, **new_kw) File "C:\Users<user>\AppData\Local\Programs\Python\Python39\lib\site-packages\moviepy\Clip.py", line 93, in get_frame return self.make_frame(t) File "C:\Users<user>\AppData\Local\Programs\Python\Python39\lib\site-packages\moviepy\video\compositing\CompositeVideoClip.py", line 111, in make_frame f = c.blit_on(f, t) File "C:\Users<user>\AppData\Local\Programs\Python\Python39\lib\site-packages\moviepy\video\VideoClip.py", line 564, in blit_on return blit(img, picture, pos, mask=mask, ismask=self.ismask) File "C:\Users<user>\AppData\Local\Programs\Python\Python39\lib\site-packages\moviepy\video\tools\drawing.py", line 41, in blit new_im2[yp1:yp2, xp1:xp2] = blitted ValueError: could not broadcast input array from shape (1080,701) into shape (1080,701,3)

    Steps to Reproduce the Problem

    Input any image with a bit depth of 8. I used several files with a bit depth of 8 and those are the only files that errored out. They were also black and white, but other black and white images worked, however all files with a bit depth of 8 failed with the same error. Not sure why or how it is happening.

    from moviepy import *
    
    def getReflectedClip(clip, finalSize):
        # If the clip isn't the correct height, change it.
        if(clip.size[1] != finalSize[1]):
            clip = clip.resize(height=finalSize[1])
        # If the clip is less than the crop width, triple it and check again.
        if(clip.size[0] < finalSize[0]):
            reflectClip = clip.fx(vfx.mirror_x)
            clip = clips_array([[clip, clip, reflectClip]])
            return getReflectedClip(clip, finalSize)
        else:
            return clip
    
    def getImageClipList(ImageDir):
        imageList = os.listdir(ImageDir)
        #imageList = imageList[0:60]
        random.shuffle(imageList)
        clipList = []
        for media in imageList:
            filePath = ImageDir + media
            print(filePath)
            if(isdir(filePath)):
                continue
            clip = ImageClip(img=filePath, duration=testDuration)
            
            # Resize, reflect, and crop clips to fill the horizontal black space.
            clip = getReflectedClip(clip, finalSize)
            # If the clip is too small, this will not work correctly.
            print(clip.size)
            clip = crop(clip, width=finalSize[0], x_center=clip.size[0]/2)
    

    Specifications

    • Python Version: 3.9.7
    • Moviepy Version: 1.0.3
    • Platform Name: Windows
    • Platform Version: 10
    bug images 
    opened by DegenVideos 0
  • Allow for ffmpeg additional params when writing videoclip audio

    Allow for ffmpeg additional params when writing videoclip audio

    • [ ] I have provided code that clearly demonstrates the bug and that only works correctly when applying this fix
    • [x] I have added suitable tests demonstrating a fixed bug or new/changed feature to the test suite in tests/
    • [x] I have properly documented new or changed features in the documentation or in the docstrings
    • [ ] I have properly explained unusual or unexpected code in the comments around it

    I was searching for my first issue to contribute and have made an attempt on #1493 following the comments suggestions.

    Best

    enhancement audio ffmpeg 
    opened by zpavloudis 2
  • video stuck and audio repeats

    video stuck and audio repeats

    I created this script to download YouTube videos for me

    from seleniumwire.webdriver import Firefox
    from selenium.webdriver.firefox.webdriver import Options
    from moviepy.editor import VideoFileClip, AudioFileClip
    firefox_options = Options()
    firefox_options.set_headless()
    def download(id, outname='output.mp4', fps=60):
        driver = Firefox(options=firefox_options) # needed
        driver.get('https://www.youtube.com/watch?v=%s' % id)
        vid, aud = list(filter(lambda req: '---' in req and 'generate' not in req, map(lambda req: req.url, driver.requests)))[:2]
        VideoFileClip(vid).set_audio(AudioFileClip(aud)).write_videofile(outname,fps=fps)
    
    

    But the video just breaks at some point, from which the audio just repeats any idea why? (Might be because the next chunk from the URL is not being sent)

    bug 
    opened by donno2048 0
  • Cannot use monochrome images with ImageClip and CompositeVideoClip

    Cannot use monochrome images with ImageClip and CompositeVideoClip

    This code composes a video by applying and image on top of another video:

    clip = VideoFileClip('video.mp4')
    image = ImageClip('img.jpg', duration=1)
    clip = CompositeVideoClip([clip, image])
    
    clip.write_videofile('result.mp4')
    

    Expected Behavior

    I would expect the video to be rendered correctly with all types of images.

    Actual Behavior

    If img.jpg is a monochrome image, write_videofile crashes with the following error:

    Stracktrace
    File "./main.py", line 42, in <module>
      clip.write_videofile('result.mp4')
    File "<decorator-gen-55>", line 2, in write_videofile
    File "./venv/lib/python3.8/site-packages/moviepy/decorators.py", line 54, in requires_duration
      return f(clip, *a, **k)
    File "<decorator-gen-54>", line 2, in write_videofile
    File "./venv/lib/python3.8/site-packages/moviepy/decorators.py", line 135, in use_clip_fps_by_default
      return f(clip, *new_a, **new_kw)
    File "<decorator-gen-53>", line 2, in write_videofile
    File "./venv/lib/python3.8/site-packages/moviepy/decorators.py", line 22, in convert_masks_to_RGB
      return f(clip, *a, **k)
    File "./venv/lib/python3.8/site-packages/moviepy/video/VideoClip.py", line 300, in write_videofile
      ffmpeg_write_video(self, filename, fps, codec,
    File "./venv/lib/python3.8/site-packages/moviepy/video/io/ffmpeg_writer.py", line 220, in ffmpeg_write_video
      for t,frame in clip.iter_frames(logger=logger, with_times=True,
    File "./venv/lib/python3.8/site-packages/moviepy/Clip.py", line 472, in iter_frames
      frame = self.get_frame(t)
    File "<decorator-gen-11>", line 2, in get_frame
    File "./venv/lib/python3.8/site-packages/moviepy/decorators.py", line 89, in wrapper
      return f(*new_a, **new_kw)
    File "./venv/lib/python3.8/site-packages/moviepy/Clip.py", line 93, in get_frame
      return self.make_frame(t)
    File "./venv/lib/python3.8/site-packages/moviepy/video/compositing/CompositeVideoClip.py", line 111, in make_frame
      f = c.blit_on(f, t)
    File "./venv/lib/python3.8/site-packages/moviepy/video/VideoClip.py", line 564, in blit_on
      return blit(img, picture, pos, mask=mask, ismask=self.ismask)
    File "./venv/lib/python3.8/site-packages/moviepy/video/tools/drawing.py", line 41, in blit
      new_im2[yp1:yp2, xp1:xp2] = blitted
    ValueError: could not broadcast input array from shape (400,400) into shape (400,400,3)
    

    If img.jpg is a polychromatic (=regular) image, it works just fine.

    Steps to Reproduce the Problem

    Here is the image I used for reproducing this:

    Monocrome JPG

    img

    For comparison, this is a polychromatic image, which works just fine with the snippet:

    Polychrome JPG

    regular-image

    Here is a more complete code example that generates the base video using the image aswell (the first write_videofile works because the image is not composed with anything):

    from moviepy.editor import *
    
    image = ImageClip('img.jpg', duration=1)
    image.write_videofile('video.mp4', fps=30)
    
    clip = VideoFileClip('video.mp4')
    image = ImageClip('img.jpg', duration=1)
    clip = CompositeVideoClip([clip, image])
    
    clip.write_videofile('result.mp4')
    

    Hotfix

    I have fixed the problem for me by hacking in an fx function that transforms the image for me:

    import numpy as np
    from moviepy.editor import *
    
    
    def normalize_image(clip):
        def f(get_frame, t):
            if f.normalized_frame is not None:
                return f.normalized_frame
            else:
                frame = get_frame(t)
                f.normalized_frame = normalize_frame(frame)
                return f.normalized_frame
    
        f.normalized_frame = None
    
        return clip.fl(f)
    
    
    def normalize_frame(frame):
        shape = np.shape(frame)
        [dimensions, ] = np.shape(shape)
    
        if dimensions == 2:
            (height, width) = shape
            normalized_frame = np.zeros((height, width, 3))
            for y in range(height):
                for x in range(width):
                    grey_value = frame[y][x]
                    normalized_frame[y][x] = (grey_value, grey_value, grey_value)
            return normalized_frame
        else:
            return frame
    
    
    image = ImageClip('img.jpg', duration=1)
    image.write_videofile('video.mp4', fps=30)
    
    clip = VideoFileClip('video.mp4')
    image = ImageClip('img.jpg', duration=1).fx(normalize_image)
    clip = CompositeVideoClip([clip, image])
    
    clip.write_videofile('result.mp4')
    

    This is, of course, very inefficient, but it fixes the issue for me.

    Specifications

    • Python Version: 3.8.2
    • Moviepy Version: 1.0.3
    • Platform Name: MacOS (M1)
    • Platform Version: 11.4
    bug 
    opened by fjahn 0
Releases(v2.0.0.dev2)
  • v2.0.0.dev2(Oct 5, 2020)

    v2.0.0.dev2

    Full Changelog

    There are still no major breaking changes compared to v1.0.3. Expect them to come in the next dev update. Any new changes made to the master branch will now be instantly reflected at https://moviepy.readthedocs.io, which is where documentation for all versions will be in the future. [#1328] Install with pip install moviepy --pre --upgrade.

    Added

    • New pix_fmt parameter in VideoFileClip, VideoClip.write_videofile(), VideoClip.write_gif() that allows passing a custom pix_fmt parameter such as "bgr24" to FFmpeg [#1237]
    • New change_duration parameter in Clip.set_fps() that allows changing the video speed to match the new fps [#1329]

    Changed

    • ffmpeg_parse_infos() and VideoFileClip now have optional decode_file parameter that ensures that the detected duration is correct, but may take a long time to run [#1063, #1222]
    • ffmpeg_parse_infos() and VideoFileClip now use fps metadata instead of tbr to detect a video's fps value [#1222]
    • FFMPEG_AudioReader.close_proc() -> FFMPEG_AudioReader.close() for consistency with FFMPEG_VideoReader [#1220]

    Fixed

    • Fixed ffmpeg_tools.ffmpeg_extract_subclip creating clips with incorrect duration metadata [#1317]
    • OSError: MoviePy error: failed to read the first frame of video file... would occasionally occur for no reason [#1220]
    • Fixed warnings being suppressed [#1191]
    • Fixed UnicodeDecodeError crash when file metadata contained non-UTF8 characters [#959]
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0.dev1(Jun 4, 2020)

    v2.0.0.dev1 (2020-06-04)

    Full Changelog

    This development version introduces many bug-fixes and changes. Please note that there may be large backwards-incompatible changes between dev versions! The online documentation has not been updated to reflect the changes in the v2.0.0 branch, so for help on how to use the new features please refer to the docstrings in the source code. Install with pip install moviepy --pre --upgrade.

    Important Announcements

    • Support removed for Python versions 2.7, 3.4 & 3.5 [#1103, #1106]
    • If you were previously setting custom locations for FFmpeg or ImageMagick in config_defaults.py and MoviePy still cannot autodetect the binaries, you will need to switch to the new method using enviroment variables. [#1109]
    • All previously deprecated methods and parameters have been removed [#1115]

    Added

    • BitmapClip allows creating of custom frames using strings of letters
    • Clips can now be tested for equality with other clips using ==. This checks whether every frame of the two clips are identical
    • Support for path-like objects as an option wherever filenames are passed in as arguments [#1137]
    • Autodetect ImageMagick executable on Windows [#1109]
    • Optionally configure paths to FFmpeg and ImageMagick binaries with environment variables or a .env file [#1109]
    • Optional encoding parameter in SubtitlesClip [#1043]
    • Added new ffmpeg_stabilize_video() function in ffmpeg_tools
    • Optional temp_audiofile_path parameter in VideoClip.write_videofile() to specify where the temporary audiofile should be created [#1144]
    • VideoClip.set_layer() to specify the layer of the clip for use when creating a CompositeVideoClip [#1176]
    • ffmpeg_parse_infos additionally returns "video_bitrate" and "audio_bitrate" values [#930]
    • Access to the source video's bitrate in a VideoFileClip or AudioFileClip through videoclip.reader.bitrate and audioclip.reader.bitrate [#930]

    Changed

    • vfx.scroll arguments w and h have had their order swapped. The correct order is now w, h but it is preferable to explicitly use keyword arguments
    • Removed extra . in the output file name of ffmpeg_extract_subclip() when targetname is not specified [#939]

    Removed

    • Support removed for Python versions 2.7, 3.4 & 3.5
    • Setting paths to ImageMagick and FFMpeg binaries in config_defaults.py is no longer possible [#1109]
    • Removed config.get_setting() and config.change_settings() functions [#1109]
    • All previously deprecated methods and parameters [#1115]:
      • AudioClip.to_audiofile() -> use AudioClip.write_audiofile()
      • VideoClip.to_videofile() -> use VideoClip.write_videofile()
      • VideoClip.to_images_sequence() -> use VideoClip.write_images_sequence()
      • concatenate() -> use concatenate_videoclips()
      • verbose parameter in AudioClip.write_audiofile(), ffmpeg_audiowriter(), VideoFileClip(), VideoClip.write_videofile(), VideoClip.write_images_sequence(), ffmpeg_write_video(), write_gif(), write_gif_with_tempfiles(), write_gif_with_image_io() -> Instead of verbose=False, use logger=None
      • verbose_print() -> no replacement
      • col parameter in ColorClip() -> use color

    Fixed

    • 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]
    • vfx.even_size previously created clips with odd sizes [#1124]
    • IndexError in vfx.freeze, vfx.time_mirror and vfx.time_symmetrize [#1124]
    • Using rotate() with a ColorClip no longer crashes [#1139]
    • AudioFileClip would not generate audio identical to the original file [#1108]
    • Fixed TypeError when using filename instead of txt parameter in TextClip [#1201]
    • Several issues resulting from incorrect time values due to floating point errors [#1195], for example:
      • Blank frames at the end of clips [#210]
      • Sometimes getting IndexError: list index out of range when using concatenate_videoclips [#646]
    • Applying resize with a non-constant newsize to a clip with a mask would remove the mask [#1200]
    • Using color_gradient() would crash with ValueError: The truth value of an array with more than one element is ambiguous [#1212]
    Source code(tar.gz)
    Source code(zip)
  • v1.0.3(May 7, 2020)

  • v1.0.2(Mar 26, 2020)

    v1.0.2 (2020-03-26)

    Full Changelog

    Note that this is likely to be the last release before v2.0, which will drop support for Python versions 2.7, 3.4 & 3.5 and will introduce other backwards-incompatible changes.

    Notable bug fixes:

    • Fixed bug that meant that some VideoFileClips were created without audio [#968]
    • Fixed bug so now the slide_out effect works [#795]

    Fixed bugs:

    Merged pull requests

    Merged pull requests:

    Closed issues

    Closed issues:

    • ImageSequenceClip write_videofile #1098
    • Formatting code with Black #1097
    • Make effects be callable classes #1096
    • URGENT - Documentation is inaccessible #1086
    • Drop support for python < 3.6 #1081
    • TextClip filenotfounderror winerror2 #1080
    • unable to create video from images #1074
    • Crash on loading the video, windows 10 #1071
    • Audio Issue while concatenate_videoclips'ing ImageClip and VideoFileClip (contains audio already) #1064
    • AttributeError: 'NoneType' object has no attribute 'stdout' #1054
    • Overlay a video on top of an image with Moviepy #1053
    • get_frame fails if not an early frame #1052
    • from google.colab import drive drive.mount('/content/drive') import cv2 import numpy as np from skimage import morphology from IPython import display import PIL image = cv2.imread('/content/drive/My Drive/CAR3/11.JPG',cv2.IMREAD_COLOR) from google.colab.patches import cv2_imshow #image = cv2.resize(image,(384,192)) cv2_imshow(image) #1051
    • Segmentation fault (core dumped) #1048
    • zip over two iter_frames functions doesn't render proper result #1047
    • CompositeVideoClip([xxx]).rotate(90) ValueError: axes don't match array #1042
    • to_soundarray Index error #1034
    • write_videofile does not add audio #1032
    • moviepy.video.io.VideoFileClip.VideoFileClip.set_audio does not set audio #1030
    • loop for concatenate_videoclips #1027
    • How to resize ImageClip? #1004
    • Pygame pollutes stdio with spammy message #985
    • Issue with ffmpeg version #934
    • No release notes for 1.0.0? #917
    • Imageio's new use of imageio-ffmpeg #908
    • ModuleNotFound: No module named 'imageio\_ffmpeg', or imageio v2.5.0 is breaking ffmpeg detection in config #906
    • CompositeVideoClip has no audio #876
    • Handling of the ffmpeg dependency #859
    • 'ffmpeg-linux64-v3.3.1' was not found on your computer; downloading it now. #839
    • Typo in variable name in transitions.py(t_s instead of ts) #692
    • version 0.2.3.2 TypeError: must be str, not bytes #650
    • AWS Lambda - Moviepy Error - #638
    • Adding conda-forge package #616
    • Several YouTube examples in Gallery page are unable to load. #600
    • ffmpeg not installed on Mac #595
    • FFMPEG not downloaded #493
    • Fix documentation #482
    • Moviepy is producing garbled videos #356
    • Help with contributing to the documentation? #327
    • audio custom filter documentation? #267
    • Mistake in doc, clips.html part. #136

    Source code(tar.gz)
    Source code(zip)
  • v1.0.1(Oct 1, 2019)

    v1.0.1 (2019-10-01)

    Full Changelog

    New features

    • Added support for Windows CI
    • Lots of bug fixes

    Full details

    Merged pull requests

    Merged pull requests:

    Closed issues

    Closed issues:

    • Thoughts on re-routing tqdm progress bar for external use? #412
    • Progress bar #128
    • website video examples broken videos #1019
    • Audio glitches when using concatenate_videoclips. #1005
    • txt_clip = TextClip(filename='learn.srt') --bug:TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType #984
    • txt_clip = TextClip(filename='learn.srt') --bug:TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType #983
    • txt_clip = TextClip(filename='learn.srt')path should be string, bytes, os.PathLike or integer, not NoneType #982
    • write_videofile writes blank black when writing grayscale #973
    • i dont understand this question #967
    • Thank you guys! #957
    • Saving an opencv stream #953
    • Issue with reader not being defined #950
    • On Windows, ImageMagick needs to be installed with Utility mode for the convert.exe file to exist #937
    • extract subtitles #932
    • ffmpeg_parse_infos silently hangs on Windows when MP4 file contains enough metadata #926
    • crop missing from moviepy.video.fx.all #914
    • Segmentation Error on VPS #912
    • Error when installing with imageio #911
    • Backwards compatibility #889
    • frozen seconds in beginning of subclip using ffmpeg_extract_subclip() #847
    • [Errno 3] No such process : on Windows Sub Linux (ubuntu 16.x) #765
    • Progress bar newline error in Jupyter #740
    • Refer to magick on https://zulko.github.io/moviepy/install.html #689
    • Configure Appveyor support #628
    • tqdm progress bar write_videofile send to iterator #568
    • ffmpeg_extract_subclip returns black frames #508
    • Windows: specifying path to ImageMagick in config_defaults.py #378
    • AttributeError: 'NoneType' object has no attribute 'start' #191
    • ImageMagick write gif success but no file found #113

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Oct 1, 2019)

    v1.0.0 (2019-02-17)

    Full Changelog

    New features

    Moviepy now supports much better progress bars, using Proglog. Support for custom callbacks and more!

    Full details

    Merged pull requests

    Closed issues

    • Can't overlay gizeh animation onto video with transparency/mask #898
    • [0.2.4.0] Garbled audio when exporting mp3 from mp4? #891
    • Error with VideoFileClip(filePath) #868
    • I am trying to run this code #867
    • Out of memory exception #862
    • simple problem on the first step: importing moviepy.editor #852
    • MoviePy insert multiple images in a video #840
    • Videogrep can't works with Moviepy in Windows #834
    • File "<stdin>", line 1 error #832
    • ImageMagick error - Ubuntu 16.04 #831
    • Combining thousands of small clips into one file #827
    • TypeError: 'ImageClip' object is not iterable #824
    • OSError: [WinError 6] The handle is invalid... concatenating clips #823
    • How to add audio tracks. not to replace it. #822
    • Missing 'ffmpeg-win32-v3.2.4.exe' #821
    • No sound with an audio clip add to an video in quicktime #820
    • Pip fails when trying to install #812
    • PermissionError after trying to delete a file after it's purpose is done #810
    • video clip from URI #780
    • Fails on FreeBSD #756
    • inconsistent behaviour of clip.get_frame() #751
    • Error with write_videofile #727
    • Trying to use moviepy on lambda, but has problem with ffmpeg #642
    • Unexpected Behavior With negative t_start in Subclip #341
    • Could not find a format to read the specified file in mode 'i' #219
    • WindowsError[5] and AttributeError Exception #170
    • Can't make VideoFileClip 'utf8' #169
    • Rendered output missing first frame #155
    • Incorrect output when concatenate_videoclips two quicktime videos #144
    • a bytes object is recognised as a string #120

    Source code(tar.gz)
    Source code(zip)
  • v0.2.3.5(May 31, 2018)

    v0.2.3.5 (2018-05-31)

    Full Changelog

    New features

    Full details

    Merged pull requests

    Fixed bugs:

    • Removed Hz from audio_fps match in ffmpeg_parse_infos #665 (qmac)

    Merged pull requests:

    Closed issues

    Closed issues:

    • 100% of GIF does not convert to MP4, gets cut short. #802
    • How to add audio track to MP4? #794
    • ffmpeg 4.0 NVIDIA NVDEC-accelerated Support ? #790
    • Help!!!! errors during installation on Mac #788
    • Blink fx uses deprecated(?) method with\_mask\(\) #786
    • Built-in file downloader downloads files repeatedly? #779
    • Error in compositing video and SubtitlesClip by CompositeVideoClip #778
    • SubtitlesClip #777
    • Video Background #774

    Source code(tar.gz)
    Source code(zip)
  • v0.2.3.4(Apr 22, 2018)

    v0.2.3.4 (2018-04-22)

    Full Changelog

    New features

    • Added pcm_s24le codec for .wav files (#769)
    • Added fullscreen parameter to preview (#773)
    • Added support for closing previews with quit button (#773)

    Full details

    Merged pull requests

    Merged pull requests:

    Closed issues

    Closed issues:

    • fail to install #771
    • install moviepy #758
    • How to prepend hexadecimal data to a binary file? #757
    • It’s time for a new release #742
    • wrong video duration value when concatenating videos with method = compose #574

    Source code(tar.gz)
    Source code(zip)
  • v0.2.3.3(Apr 18, 2018)

    Change Log

    v0.2.3.3 (2018-04-17)

    Full Changelog

    Main Changes

    • Removed support for Python 3.3 (#688, #713)
    • Lots of bug fixes, including better support for Python 3.x and Windows
    • Some documentation updates
    • Test coverage increased from 53% to 65%
    • Credits tool fixed. Check it out here!
    Merged pull requests

    Fixed bugs:

    • Issue with nesting context managers #655
    • Is there one potential bug in FFMPEG_READER? #546
    • vfx.scroll giving TypeError: slice indices must be integers or None or have an __index__ method #527
    • IndexError when converting audio to_soundarray() #246
    • Unable to use unicode strings with Python 2 #76
    • Added ffmpeg download when importing moviepy.editor #731 (tburrows13)
    • Fixed bugs, neater code, changed docstrings in audiofiles #722 (tburrows13)
    • Resolve undefined name execfile in Python 3 #718 (cclauss)
    • Fix credits, added tests #716 (tburrows13)
    • res —> size to align with line 62 #710 (cclauss)
    • Add gap=0 to align with lines 40, 97, and 98 #709 (cclauss)
    • import numpy as np for lines 151 and 178 #708 (cclauss)
    • Convert advanced_tools.py to valid Python #707 (cclauss)
    • Added missing '%' operator for string formatting. #686 (taylorjdawson)
    • Addressing #655 #656 (gyglim)
    • initialize proc to None #637 (gyglim)
    • sometimes tempfile.tempdir is None, so use tempfile.gettempdir() function instead #633 (earney)
    • Issue629 #630 (Julian-O)
    • Fixed bug in Clip.set_duration() #613 (kencochrane)
    • Fixed typo in the slide_out transition #612 (kencochrane)
    • Exceptions do not have a .message attribute. #603 (Julian-O)
    • Issue #574, fix duration of masks when using concatenate(.., method="compose") #585 (earney)
    • Fix out of bounds error #570 (shawwn)
    • fixed ffmpeg error reporting on Python 3 #565 (narfdotpl)
    • Add int() wrapper to scroll to prevent floats #528 (tburrows13)
    • Fix issue #464, repeated/skipped frames in ImageSequenceClip #494 (neitzal)
    • fixes #248 issue with VideoFileClip() not reading all frames #251 (aldilaff)

    Implemented enhancements:

    • Use feature detection instead of version detection #721 (cclauss)
    • Fixed Optional Progress Bar in cuts/detect_scenes #587 (scherroman)
    • Fix travis build and enable pip caching #561 (mbeacom)
    • Avoid mutable default arguments #553 (mbeacom)
    • add ImageSequenceClip image size exception #550 (earney)

    Merged pull requests:

    Closed issues

    • Overly Restrictive Requirements #767
    • Using a gif as an ImageClip? #764
    • How can I include a moving 'arrow' in a clip? #762
    • How to call moviepy.video.fx.all.crop() ? #760
    • ImportError: Imageio Pillow requires Pillow, not PIL! #748
    • Fail to call VideoFileClip() because of WinError 6 #746
    • concatenate_videoclips with fadein fadeout #743
    • Ignore - sorry! #739
    • Image becomes blurr with high fps #735
    • Https protocol not found with ffmpeg #732
    • Storing Processed Video clip takes a long time #726
    • image corruption when concatenating images of different sizes #725
    • How to install MoviePy on OS High Sierra #706
    • Issue when running the first example of text overlay in ubuntu 16.04 with python3 #703
    • Extracting frames #702
    • Error - The handle is invalid - Windows Only #697
    • ImageMagick not detected by moviepy while using SubtitlesClip #693
    • Textclip is not working at all #691
    • Remove Python 3.3 testing ? #688
    • In idle, 25 % CPU #676
    • Audio error #675
    • Insert a ImageClip in a CompositeVideoClip. How to add nil audio #669
    • Output video is garbled, single frames output are fine #651
    • 'missing handle' error #644
    • issue with proc being None #636
    • Looping parameter is missing from write_gif_with_image_io() #629
    • would it be optionally possible to use pgmagick package ? (instead of ImageMagick binary) #625
    • concatenate_videoclips() can't handle TextClips #622
    • Writing movie one frame at a time #619
    • Fatal Python error: PyImport_GetModuleDict: no module dictionary! #618
    • line 54, in requires_duration return #601
    • test_duration() fails in test_TextClip() #598
    • Geting framesize from moviepy #571
    • Write_videofile results in 1930x1080 even when I force clip.resize(width=1920,height=1080) before write_videofile #547
    • AttributeError: AudioFileClip instance has no attribute 'afx' #513
    • ImageSequenceClip repeats frames depending on fps #464
    • manual_tracking format issue #373
    • resize video when time changed trigger a error #334
    • WindowsError: [Error 5] Access is denied #294
    • TypeError in Adding Soundtrack #279
    • Defaults fail for ImageSequenceClip() #218
    • audio normalization #32
    • Unclosed processes. #19

    Source code(tar.gz)
    Source code(zip)
  • v0.2.3.2(Apr 18, 2018)

    New

    • #300 progress_bar parameter added to write_images_sequence
    • #529 VideoFileClip objects now have a rotation attribute

    Bug Fixes

    • #336 ValueError: operands could not be broadcast together with shapes bug fixed (#334)

    Docs

    Full details

    Merged pull requests

    Closed issues

    • Requirements adjustments #530

    • Documentation build failures #525

    • Index is out of bounds - AudioFileClip #521

    • Youtube videos fail to load in documentation #536

    • unicodeDecoderError by running the setup.py during moviepy pip install #532

    • Should we push another version? #481

    • Add matplotlib example to the user guide? #421

    • Fails to list fx after freezing an app with moviepy #274

    • Documentation doesn't match ffmpeg presets #232

    • Minor Modifications #515 (gpantelis)

    Source code(tar.gz)
    Source code(zip)
  • v0.2.3.1(Apr 5, 2017)

    Merged pull requests

    Closed issues

    • concatenate_videoclips([clip1,clip2]) results in a clip where the second clip is skewed and has severe lines #520
    • FFMPEG crashes if the script is a .pyw #517
    • VideoFileClip instance has no attribute 'reader' #512
    • Adding emoji with moviepy #507
    • How to remove original audio from the video file ? #504
    • Duration Format With Moviepy #502
    • AttributeError: 'numpy.ndarray' object has no attribute 'tobytes' #499
    • New install... VideoFileClip("x.mp4").subclip(0,13) gives "reader not defined error" #461
    • Bytes-like object is required, not 'str' in version 0.2.2.13 #455
    • Can't import gifs into moviepy #452
    • AudioFileClip #448
    • Error with Pillow #445
    • Moviepy AttributeError: 'NoneType' object has no attribute 'shape' #439
    • This is what exception.... #437
    • when I from moviepy.editor import *, There cause exception,That's why....... #436
    • No available fonts in moviepy #426
    • Project maintenance, mgmt, workflow etc. #422
    • Cannot run in a django project on apache #420
    • error 'unicode' object has no attribute 'shape' #417
    • VideoClip has no attribute fps error when trying to concatenate #407
    • The Travis tester seems to be failing #406
    • Slow motion video massively sped up #404
    • moviepy not able to find installed ffmpeg bug? #396
    • Cannot open audio: AttributeError: 'NoneType' object has no attribute 'start' #393
    • DirectoryClip??? Where is it? #385
    • Minor Documentation typo in VideoFileClip #375
    • Documentation Update: VideoTools #372
    • ValueError: Invalid value for quantizer: 'wu' #368
    • Parameter color in ColorClip #366
    • Different size videos #365
    • Add support for dithering GIF output #358
    • VideoFileClip instance has no attribute 'coreader' #357
    • ffmpeg_parse_infos fails while parsing tbr #352
    • No audio when adding Mp3 to VideoFileClip MoviePy #350
    • ImportError: No module named tracking (OS: 10.11.6 "El Capitan", Python 2.7.12) #348
    • Moviepy not compatible with Python 3.2 #333
    • Attribute Error (Raspberry Pi) #332
    • ImageSequenceClip: Error when fps not provided but durations provided #326
    • CI Testing #325
    • Pythonanywhere Moviepy #324
    • Documentation for resize parameter is wrong #319
    • ImageClip's with default settings can not be concatenated #314
    • librelist does not work #309
    • Broken Gallery in Documentation #304
    • File IOError when trying to extract subclips from mov file on Ubuntu #303
    • write_gif failing #296
    • Resize not working #272
    • stretch image to size of frame #250
    • ffprobe metadata on video file clips #249
    • Credits1 is not working - gap missing, isTransparent flag not available #247
    • Generating Gif from images #240
    • permission denied #233
    • receive the video advancement mounting (Ex: in %) #224
    • Import of MoviePy and Mayavi causes a segfault #223
    • Video overlay (gauges...) #222
    • OSError: [WinError 193] %1 n’est pas une application Win32 valide #221
    • Warning: skimage.filter is deprecated #214
    • External FFmpeg issues #193
    • Video and Audio are out of sync after write #192
    • Broken image on PyPI #187
    • ImageSequenceClip from OpenEXR file sequence generate black Clip video #186
    • Loading video from url #185
    • Wrong number of frames in .gif file #181
    • Converting mp4 to ogv error in bitrate #174
    • embed clip in a jupyter notebook #160
    • How to create a video from a sequence of images without writing them on memory #159
    • LaTeX strings #156
    • UnboundLocalError in video/compositing/concatenate.py #145
    • Crop a Video with four different coodinate pairs #142
    • global name 'colorGradient' is not defined #141
    • rotating image animation producing error #130
    • bug introduced in 0.2.2.11? #129
    • Getting a TypeError in FramesMatch #126
    • moviepy is awesome #125
    • Concanate clips with different size #124
    • TextClip.list('font') raises TypeError in Python 3 #117
    • Attempt to Download freeimage failing #111
    • Invalid buffer size, packet size < expected frame_size #109
    • imageio has permission problems as WSGI user on Amazon Web Server #106
    • Possibility to avoid code duplication #99
    • Memory Leak In VideoFileClip #96
    • [Windows users: help !] Finding ImageMagick automatically on windows #80
    • Save to Amazon S3 #6
    • transparency bug in concatenate_videoclips() #103
    • Possible to create out of bounds subclip #470
    • TypeError: 'float' object cannot be interpreted as an integer #376
    • TextClip.list('color') failed to return color list #371
    • Bug in write_gif #359
    • crossfadeout "Attribute 'duration' not set" #354
    • AAC support for mp4 #344
    • Python2 unicode_literals errors #293
    • concatenate ImageClip #285
    • VideoFileClip instance has no attribute 'reader' #255
    • TextClip.list('color') fails #200

    Source code(tar.gz)
    Source code(zip)
  • v0.2.2.13(Feb 15, 2017)

    This release includes a few Python 3 compatibility fixes and bug fixes.

    • [x] Merged #244 - Resolving on_color function docstring has wrong parameter
    • [x] Merged #384 - Resolving #383 - ensures int arguments to np.reshape
    • [x] Merged #403 - Resolving #335 and #401 - Handle py3 compatibility for writers stdin error handling.
    • [x] Merged #405 - Add self.filename as a VideoFileClip attribute
    • [x] Merged #410 - Resolving #313 - Make concatenate_videoclips python 3 compatible
    Source code(tar.gz)
    Source code(zip)
  • v0.2.2.12(Feb 3, 2017)

  • v0.2.2(Dec 11, 2014)

    This is the first release of a trilogy that will include "The Dark MoviePy" and "The Dark MoviePy Rises". At this point I am not sure what releases are for.

    So let's say this release celebrates that MoviePy is quite stable around different platforms and Python 2/3, or people stopped reporting bugs.

    Major ideas for the next release:

    • Simplify MoviePy's binary dependencies installation. This could be done by using ImageIO for downloading ffmpeg.
    • Use better backends for GIF making, ImageMagick is too slow. This could also be done with ImageIO.
    • Make a file manager which maintains closed the connections to files that are not used, because file connextions take a lot of RAM. This would allow to have hundreds of VideoClips ImageClips and AudioClips open, but only a few really making a connection.

    It's going to be fun !

    Source code(tar.gz)
    Source code(zip)
OpenShot Video Editor is an award-winning free and open-source video editor for Linux, Mac, and Windows, and is dedicated to delivering high quality video editing and animation solutions to the world.

OpenShot Video Editor is an award-winning free and open-source video editor for Linux, Mac, and Windows, and is dedicated to delivering high quality v

OpenShot Studios, LLC 2.4k Oct 24, 2021
It is a simple python package to play videos in the terminal using characters as pixels

It is a simple python package to play videos in the terminal using characters as pixels

Joel Ibaceta 1.1k Oct 24, 2021
pygamevideo module helps developer to embed videos into their Pygame display

pygamevideo module helps developer to embed videos into their Pygame display. Audio playback doesn't use pygame.mixer.

Kadir Aksoy 7 Oct 10, 2021
Video Editor for Linux

Project on break until late March. NEW RELEASE 2.8 IS OUT NOW. INSTALLING: see here. RELEASE NOTES AVAILABLE here. Introduction Features Releases Inst

null 1.7k Oct 17, 2021
Cross-platform command-line AV1 / VP9 / HEVC / H264 encoding framework with per scene quality encoding

Av1an A cross-platform framework to streamline encoding Easy, Fast, Efficient and Feature Rich An easy way to start using AV1 / HEVC / H264 / VP9 / VP

Zen 473 Oct 15, 2021
plumi video sharing

December 2017 update We are moving tickets from the Plumi tracker (trac.plumi.org) here, for historical reasons. Plumi video sharing system Plumi is a

Plumi 108 Sep 25, 2021
Python and OpenCV-based scene cut/transition detection program & library.

Video Scene Cut Detection and Analysis Tool Latest Release: v0.5.6.1 (October 11, 2021) Main Webpage: py.scenedetect.com Documentation: manual.scenede

Brandon Castellano 1.4k Oct 15, 2021
Home Assistant custom component for viewing IP cameras RTSP stream in real time using WebRTC technology

WebRTC Camera Home Assistant custom component for viewing IP cameras RTSP stream in real time using WebRTC technology. Based on: Pion - pure Go implem

Alex X 350 Oct 22, 2021
Your self hosted Youtube media server

The Tube Archivist Your self hosted Youtube media server Core functionality Subscribe to your favourite Youtube channels Download Videos using yt-dlp

Simon 506 Oct 24, 2021
This is an example of building a video Question-Answer system using Jina.

example-video-search This is an example of building a video Question-Answer system using Jina. The index data is subtitle files of YouTube videos. Aft

Jina AI 2 Oct 18, 2021
Youtube as covert-channel - Control systems remotely and execute commands by uploading videos to Youtube

covert-tube A program to control systems remotely by uploading videos to Youtube using Python to create the videos and the listener, emulating some ma

Ricardo Ruiz 65 Oct 20, 2021
video streaming userbot (vsu) based on pytgcalls for streaming video trought the telegram video chat group.

VIDEO STREAM USERBOT ✨ an another telegram userbot for streaming video trought the telegram video chat. Environmental Variables ?? API_ID : Get this v

levina 6 Oct 17, 2021
Python application that can be used to generate video thumbnail for mp4 and mkv file types.

Thumbnail Generator ?? What is This This is a Python application that can be used to generate video thumbnail for mp4 and mkv file types. Installation

Tharindu N. 6 Jul 26, 2021
Video processing routines for SciPy

scikit-video Video Processing SciKit BETA Video processing algorithms, including I/O, quality metrics, temporal filtering, motion/object detection, mo

Alex Izvorski 105 Aug 18, 2021
Repository to create Ascii art in CMD based on video file.

Made to take any file format, and transform it into ascii art, displayed as a video in the cmd. If the cmd formatting is wrong, try zooming a little and remember to make cmd fullscreen. I made my cmd fullscreen, and zoomed out one tic. Written in Python 3.9

null 51 Aug 16, 2021
A python program which converts images and video into excel spreadsheets.

image2excel A program which converts images and video into Excel spreadsheets. Usage examples can be found in examples Videos can take a long time to

Oscar Peace 2 Aug 9, 2021
Convert lecture videos to slides in one line. Takes an input of a directory containing your lecture videos and outputs a directory containing .PDF files containing the slides of each lecture.

Convert lecture videos to slides in one line. Takes an input of a directory containing your lecture videos and outputs a directory containing .PDF files containing the slides of each lecture.

Sidharth Anand 6 Oct 22, 2021
A tool to fuck a video/audio quality using FFmpeg

Media quality fucker A tool to fuck a video/audio quality using FFmpeg How to use Download the source Download Python Extract FFmpeg Put what you want

Maizena 4 Sep 24, 2021