├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.md │ ├── feature-request.md │ └── question.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── build-docs.yml │ ├── codeql-analysis.yml │ ├── formatting_linting.yml │ ├── publish.yml │ └── test_suite.yml ├── .gitignore ├── .pre-commit-config.yaml ├── .readthedocs.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Dockerfile ├── LICENCE.txt ├── MANIFEST.in ├── README.md ├── appveyor.yml ├── docs ├── Makefile ├── _static │ ├── code │ │ ├── getting_started │ │ │ ├── moviepy_10_minutes │ │ │ │ └── trailer.py │ │ │ └── quick_presentation │ │ │ │ └── basic_example.py │ │ └── user_guide │ │ │ ├── compositing │ │ │ ├── CompositeAudioClip.py │ │ │ ├── CompositeVideoClip.py │ │ │ ├── concatenate.py │ │ │ ├── crossfadein.py │ │ │ ├── juxtaposing.py │ │ │ ├── with_position.py │ │ │ └── with_start.py │ │ │ ├── effects │ │ │ ├── custom_effect.py │ │ │ ├── image_transform.py │ │ │ ├── modify_copy_example.py │ │ │ ├── time_transform.py │ │ │ ├── transform.py │ │ │ ├── using_effects.py │ │ │ └── using_with_methods.py │ │ │ ├── loading │ │ │ ├── AudioArrayClip.py │ │ │ ├── AudioClip.py │ │ │ ├── AudioFileClip.py │ │ │ ├── ColorClip.py │ │ │ ├── DataVideoClip.py │ │ │ ├── ImageClip.py │ │ │ ├── ImageSequenceClip.py │ │ │ ├── TextClip.py │ │ │ ├── UpdatedVideoClip.py │ │ │ ├── VideoClip.py │ │ │ ├── VideoFileClip.py │ │ │ ├── closing.py │ │ │ ├── loading.py │ │ │ └── masks.py │ │ │ └── rendering │ │ │ ├── display_in_notebook.py │ │ │ ├── preview.py │ │ │ ├── save_frame.py │ │ │ ├── show.py │ │ │ ├── write_gif.py │ │ │ ├── write_images_sequence.py │ │ │ ├── write_videofile.py │ │ │ └── write_videofile_duration.py │ ├── medias │ │ ├── accel_decel-fx-params.png │ │ ├── getting_started │ │ │ ├── explanations.jpeg │ │ │ └── moviepy_10_minutes │ │ │ │ ├── moviepy_10_minutes.zip │ │ │ │ └── trailer_bbb.mp4 │ │ ├── index_api.svg │ │ ├── index_contribute.svg │ │ ├── index_getting_started.svg │ │ ├── index_user_guide.svg │ │ ├── logo.png │ │ ├── logo_small.jpeg │ │ └── user_guide │ │ │ ├── circle.gif │ │ │ ├── demo_preview.jpeg │ │ │ ├── stacked.jpeg │ │ │ └── videoWH.jpeg │ └── moviepy.css ├── _templates │ └── custom_autosummary │ │ ├── class.rst │ │ └── module.rst ├── _themes │ └── .gitignore ├── conf.py ├── developer_guide │ ├── contribution_guidelines.rst │ ├── developers_install.rst │ ├── index.rst │ └── maintainers_publish.rst ├── getting_started │ ├── FAQ.rst │ ├── docker.rst │ ├── index.rst │ ├── install.rst │ ├── moviepy_10_minutes.rst │ ├── quick_presentation.rst │ └── updating_to_v2.rst ├── index.rst ├── make.bat ├── makehtml.sh ├── reference │ ├── index.rst │ └── reference │ │ ├── moviepy.Clip.Clip.rst │ │ ├── moviepy.Clip.rst │ │ ├── moviepy.Effect.rst │ │ ├── moviepy.audio.AudioClip.AudioArrayClip.rst │ │ ├── moviepy.audio.AudioClip.AudioClip.rst │ │ ├── moviepy.audio.AudioClip.CompositeAudioClip.rst │ │ ├── moviepy.audio.AudioClip.concatenate_audioclips.rst │ │ ├── moviepy.audio.AudioClip.rst │ │ ├── moviepy.audio.fx.AudioDelay.rst │ │ ├── moviepy.audio.fx.AudioFadeIn.rst │ │ ├── moviepy.audio.fx.AudioFadeOut.rst │ │ ├── moviepy.audio.fx.AudioLoop.rst │ │ ├── moviepy.audio.fx.AudioNormalize.rst │ │ ├── moviepy.audio.fx.MultiplyStereoVolume.rst │ │ ├── moviepy.audio.fx.MultiplyVolume.rst │ │ ├── moviepy.audio.fx.rst │ │ ├── moviepy.audio.io.AudioFileClip.AudioFileClip.rst │ │ ├── moviepy.audio.io.AudioFileClip.rst │ │ ├── moviepy.audio.io.ffmpeg_audiowriter.FFMPEG_AudioWriter.rst │ │ ├── moviepy.audio.io.ffmpeg_audiowriter.ffmpeg_audiowrite.rst │ │ ├── moviepy.audio.io.ffmpeg_audiowriter.rst │ │ ├── moviepy.audio.io.ffplay_audiopreviewer.FFPLAY_AudioPreviewer.rst │ │ ├── moviepy.audio.io.ffplay_audiopreviewer.ffplay_audiopreview.rst │ │ ├── moviepy.audio.io.ffplay_audiopreviewer.rst │ │ ├── moviepy.audio.io.readers.FFMPEG_AudioReader.rst │ │ ├── moviepy.audio.io.readers.rst │ │ ├── moviepy.audio.io.rst │ │ ├── moviepy.audio.rst │ │ ├── moviepy.audio.tools.cuts.find_audio_period.rst │ │ ├── moviepy.audio.tools.cuts.rst │ │ ├── moviepy.audio.tools.rst │ │ ├── moviepy.config.check.rst │ │ ├── moviepy.config.rst │ │ ├── moviepy.config.try_cmd.rst │ │ ├── moviepy.decorators.add_mask_if_none.rst │ │ ├── moviepy.decorators.apply_to_audio.rst │ │ ├── moviepy.decorators.apply_to_mask.rst │ │ ├── moviepy.decorators.audio_video_effect.rst │ │ ├── moviepy.decorators.convert_masks_to_RGB.rst │ │ ├── moviepy.decorators.convert_parameter_to_seconds.rst │ │ ├── moviepy.decorators.convert_path_to_string.rst │ │ ├── moviepy.decorators.outplace.rst │ │ ├── moviepy.decorators.preprocess_args.rst │ │ ├── moviepy.decorators.requires_duration.rst │ │ ├── moviepy.decorators.requires_fps.rst │ │ ├── moviepy.decorators.rst │ │ ├── moviepy.decorators.use_clip_fps_by_default.rst │ │ ├── moviepy.rst │ │ ├── moviepy.tools.close_all_clips.rst │ │ ├── moviepy.tools.convert_to_seconds.rst │ │ ├── moviepy.tools.cross_platform_popen_params.rst │ │ ├── moviepy.tools.deprecated_version_of.rst │ │ ├── moviepy.tools.find_extension.rst │ │ ├── moviepy.tools.no_display_available.rst │ │ ├── moviepy.tools.rst │ │ ├── moviepy.tools.subprocess_call.rst │ │ ├── moviepy.video.VideoClip.BitmapClip.rst │ │ ├── moviepy.video.VideoClip.ColorClip.rst │ │ ├── moviepy.video.VideoClip.DataVideoClip.rst │ │ ├── moviepy.video.VideoClip.ImageClip.rst │ │ ├── moviepy.video.VideoClip.TextClip.rst │ │ ├── moviepy.video.VideoClip.UpdatedVideoClip.rst │ │ ├── moviepy.video.VideoClip.VideoClip.rst │ │ ├── moviepy.video.VideoClip.rst │ │ ├── moviepy.video.compositing.CompositeVideoClip.CompositeVideoClip.rst │ │ ├── moviepy.video.compositing.CompositeVideoClip.clips_array.rst │ │ ├── moviepy.video.compositing.CompositeVideoClip.concatenate_videoclips.rst │ │ ├── moviepy.video.compositing.CompositeVideoClip.rst │ │ ├── moviepy.video.compositing.rst │ │ ├── moviepy.video.fx.AccelDecel.rst │ │ ├── moviepy.video.fx.BlackAndWhite.rst │ │ ├── moviepy.video.fx.Blink.rst │ │ ├── moviepy.video.fx.Crop.rst │ │ ├── moviepy.video.fx.CrossFadeIn.rst │ │ ├── moviepy.video.fx.CrossFadeOut.rst │ │ ├── moviepy.video.fx.EvenSize.rst │ │ ├── moviepy.video.fx.FadeIn.rst │ │ ├── moviepy.video.fx.FadeOut.rst │ │ ├── moviepy.video.fx.Freeze.rst │ │ ├── moviepy.video.fx.FreezeRegion.rst │ │ ├── moviepy.video.fx.GammaCorrection.rst │ │ ├── moviepy.video.fx.HeadBlur.rst │ │ ├── moviepy.video.fx.InvertColors.rst │ │ ├── moviepy.video.fx.Loop.rst │ │ ├── moviepy.video.fx.LumContrast.rst │ │ ├── moviepy.video.fx.MakeLoopable.rst │ │ ├── moviepy.video.fx.Margin.rst │ │ ├── moviepy.video.fx.MaskColor.rst │ │ ├── moviepy.video.fx.MasksAnd.rst │ │ ├── moviepy.video.fx.MasksOr.rst │ │ ├── moviepy.video.fx.MirrorX.rst │ │ ├── moviepy.video.fx.MirrorY.rst │ │ ├── moviepy.video.fx.MultiplyColor.rst │ │ ├── moviepy.video.fx.MultiplySpeed.rst │ │ ├── moviepy.video.fx.Painting.rst │ │ ├── moviepy.video.fx.Resize.rst │ │ ├── moviepy.video.fx.Rotate.rst │ │ ├── moviepy.video.fx.Scroll.rst │ │ ├── moviepy.video.fx.SlideIn.rst │ │ ├── moviepy.video.fx.SlideOut.rst │ │ ├── moviepy.video.fx.SuperSample.rst │ │ ├── moviepy.video.fx.TimeMirror.rst │ │ ├── moviepy.video.fx.TimeSymmetrize.rst │ │ ├── moviepy.video.fx.rst │ │ ├── moviepy.video.io.ImageSequenceClip.ImageSequenceClip.rst │ │ ├── moviepy.video.io.ImageSequenceClip.rst │ │ ├── moviepy.video.io.VideoFileClip.VideoFileClip.rst │ │ ├── moviepy.video.io.VideoFileClip.rst │ │ ├── moviepy.video.io.display_in_notebook.HTML2.rst │ │ ├── moviepy.video.io.display_in_notebook.display_in_notebook.rst │ │ ├── moviepy.video.io.display_in_notebook.html_embed.rst │ │ ├── moviepy.video.io.display_in_notebook.rst │ │ ├── moviepy.video.io.ffmpeg_reader.FFMPEG_VideoReader.rst │ │ ├── moviepy.video.io.ffmpeg_reader.FFmpegInfosParser.rst │ │ ├── moviepy.video.io.ffmpeg_reader.ffmpeg_parse_infos.rst │ │ ├── moviepy.video.io.ffmpeg_reader.ffmpeg_read_image.rst │ │ ├── moviepy.video.io.ffmpeg_reader.rst │ │ ├── moviepy.video.io.ffmpeg_tools.ffmpeg_extract_audio.rst │ │ ├── moviepy.video.io.ffmpeg_tools.ffmpeg_extract_subclip.rst │ │ ├── moviepy.video.io.ffmpeg_tools.ffmpeg_merge_video_audio.rst │ │ ├── moviepy.video.io.ffmpeg_tools.ffmpeg_resize.rst │ │ ├── moviepy.video.io.ffmpeg_tools.ffmpeg_stabilize_video.rst │ │ ├── moviepy.video.io.ffmpeg_tools.rst │ │ ├── moviepy.video.io.ffmpeg_writer.FFMPEG_VideoWriter.rst │ │ ├── moviepy.video.io.ffmpeg_writer.ffmpeg_write_image.rst │ │ ├── moviepy.video.io.ffmpeg_writer.ffmpeg_write_video.rst │ │ ├── moviepy.video.io.ffmpeg_writer.rst │ │ ├── moviepy.video.io.ffplay_previewer.FFPLAY_VideoPreviewer.rst │ │ ├── moviepy.video.io.ffplay_previewer.ffplay_preview_video.rst │ │ ├── moviepy.video.io.ffplay_previewer.rst │ │ ├── moviepy.video.io.gif_writers.rst │ │ ├── moviepy.video.io.gif_writers.write_gif_with_imageio.rst │ │ ├── moviepy.video.io.rst │ │ ├── moviepy.video.rst │ │ ├── moviepy.video.tools.credits.CreditsClip.rst │ │ ├── moviepy.video.tools.credits.rst │ │ ├── moviepy.video.tools.cuts.FramesMatch.rst │ │ ├── moviepy.video.tools.cuts.FramesMatches.rst │ │ ├── moviepy.video.tools.cuts.detect_scenes.rst │ │ ├── moviepy.video.tools.cuts.find_video_period.rst │ │ ├── moviepy.video.tools.cuts.rst │ │ ├── moviepy.video.tools.drawing.blit.rst │ │ ├── moviepy.video.tools.drawing.circle.rst │ │ ├── moviepy.video.tools.drawing.color_gradient.rst │ │ ├── moviepy.video.tools.drawing.color_split.rst │ │ ├── moviepy.video.tools.drawing.rst │ │ ├── moviepy.video.tools.interpolators.Interpolator.rst │ │ ├── moviepy.video.tools.interpolators.Trajectory.rst │ │ ├── moviepy.video.tools.interpolators.rst │ │ ├── moviepy.video.tools.rst │ │ ├── moviepy.video.tools.subtitles.SubtitlesClip.rst │ │ ├── moviepy.video.tools.subtitles.file_to_subtitles.rst │ │ └── moviepy.video.tools.subtitles.rst └── user_guide │ ├── compositing.rst │ ├── create_effects.rst │ ├── index.rst │ ├── loading.rst │ ├── modifying.rst │ └── rendering.rst ├── examples └── soundtrack.py ├── media ├── -video-with-dash-.mp4 ├── afterimage.png ├── big_buck_bunny_0_30.webm ├── big_buck_bunny_432_433.webm ├── bitmap.mp4 ├── chaplin.mp4 ├── crunching.mp3 ├── doc_medias │ ├── example.mp4 │ ├── example.png │ ├── example.ttf │ ├── example.txt │ ├── example.wav │ ├── example2.mp4 │ ├── example2.png │ ├── example2.wav │ ├── example3.mp4 │ ├── example3.png │ ├── example3.wav │ ├── example_img_dir │ │ ├── image_0001.jpg │ │ ├── image_0002.jpg │ │ ├── image_0003.jpg │ │ ├── image_0004.jpg │ │ ├── image_0005.jpg │ │ ├── image_0006.jpg │ │ ├── image_0007.jpg │ │ ├── image_0008.jpg │ │ ├── image_0009.jpg │ │ ├── image_0010.jpg │ │ ├── image_0011.jpg │ │ ├── image_0012.jpg │ │ ├── image_0013.jpg │ │ ├── image_0014.jpg │ │ ├── image_0015.jpg │ │ ├── image_0016.jpg │ │ ├── image_0017.jpg │ │ ├── image_0018.jpg │ │ ├── image_0019.jpg │ │ ├── image_0020.jpg │ │ ├── image_0021.jpg │ │ ├── image_0022.jpg │ │ ├── image_0023.jpg │ │ ├── image_0024.jpg │ │ └── image_0025.jpg │ ├── example_mask.jpg │ ├── example_mask.mp4 │ ├── long_examples │ │ ├── example.mp4 │ │ ├── example.wav │ │ ├── example2.mp4 │ │ ├── example2.wav │ │ ├── example3.mp4 │ │ └── example3.wav │ ├── result.mp4 │ └── result.webm ├── fire2.mp4 ├── matplotlib_demo1.png ├── pigs_in_a_polka.gif ├── python_logo.png ├── python_logo_upside_down.png ├── rain.mp3 ├── rotated-90-degrees.mp4 ├── sintel_with_14_chapters.mp4 ├── smpte-2997.mp4 ├── subtitles-unicode.srt ├── subtitles.srt ├── test_video.mp4 ├── traj.txt ├── transparent.webm ├── vacation_2017.jpg ├── video_with_failing_audio.mp4 └── with-attached-pic.mp3 ├── moviepy ├── Clip.py ├── Effect.py ├── __init__.py ├── audio │ ├── AudioClip.py │ ├── __init__.py │ ├── fx │ │ ├── AudioDelay.py │ │ ├── AudioFadeIn.py │ │ ├── AudioFadeOut.py │ │ ├── AudioLoop.py │ │ ├── AudioNormalize.py │ │ ├── MultiplyStereoVolume.py │ │ ├── MultiplyVolume.py │ │ └── __init__.py │ ├── io │ │ ├── AudioFileClip.py │ │ ├── __init__.py │ │ ├── ffmpeg_audiowriter.py │ │ ├── ffplay_audiopreviewer.py │ │ └── readers.py │ └── tools │ │ ├── __init__.py │ │ └── cuts.py ├── config.py ├── decorators.py ├── tools.py ├── version.py └── video │ ├── VideoClip.py │ ├── __init__.py │ ├── compositing │ ├── CompositeVideoClip.py │ └── __init__.py │ ├── fx │ ├── AccelDecel.py │ ├── BlackAndWhite.py │ ├── Blink.py │ ├── Crop.py │ ├── CrossFadeIn.py │ ├── CrossFadeOut.py │ ├── EvenSize.py │ ├── FadeIn.py │ ├── FadeOut.py │ ├── Freeze.py │ ├── FreezeRegion.py │ ├── GammaCorrection.py │ ├── HeadBlur.py │ ├── InvertColors.py │ ├── Loop.py │ ├── LumContrast.py │ ├── MakeLoopable.py │ ├── Margin.py │ ├── MaskColor.py │ ├── MasksAnd.py │ ├── MasksOr.py │ ├── MirrorX.py │ ├── MirrorY.py │ ├── MultiplyColor.py │ ├── MultiplySpeed.py │ ├── Painting.py │ ├── Resize.py │ ├── Rotate.py │ ├── Scroll.py │ ├── SlideIn.py │ ├── SlideOut.py │ ├── SuperSample.py │ ├── TimeMirror.py │ ├── TimeSymmetrize.py │ └── __init__.py │ ├── io │ ├── ImageSequenceClip.py │ ├── VideoFileClip.py │ ├── __init__.py │ ├── display_in_notebook.py │ ├── ffmpeg_reader.py │ ├── ffmpeg_tools.py │ ├── ffmpeg_writer.py │ ├── ffplay_previewer.py │ └── gif_writers.py │ └── tools │ ├── __init__.py │ ├── credits.py │ ├── cuts.py │ ├── drawing.py │ ├── interpolators.py │ └── subtitles.py ├── pyproject.toml ├── setup.cfg └── tests ├── README.rst ├── __init__.py ├── conftest.py ├── test_AudioClips.py ├── test_BitmapClip.py ├── test_Clip.py ├── test_ImageSequenceClip.py ├── test_PR.py ├── test_SubtitlesClip.py ├── test_TextClip.py ├── test_VideoClip.py ├── test_VideoFileClip.py ├── test_compositing.py ├── test_doc_examples.py ├── test_ffmpeg_reader.py ├── test_ffmpeg_tools.py ├── test_ffmpeg_writer.py ├── test_fx.py ├── test_issues.py ├── test_tools.py └── test_videotools.py /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Report a bug with MoviePy 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | 20 | 21 | 22 | #### Expected Behavior 23 | 24 | 25 | #### Actual Behavior 26 | 27 | 28 | #### Steps and code to Reproduce the Problem 29 | 35 | 36 | 37 | #### Used medias 38 | 39 | 40 | 41 | #### Specifications 42 | 43 | - Python Version: 44 | - MoviePy Version: 45 | - Platform Name: 46 | - Platform Version: 47 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Suggest an idea for MoviePy 4 | title: '' 5 | labels: feature-request 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question 3 | about: Ask a question about an unexpected behavior of MoviePy 4 | title: '' 5 | labels: question 6 | assignees: '' 7 | 8 | --- 9 | 10 | 22 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 5 | - [ ] I have provided code that clearly demonstrates the bug and that only works correctly when applying this fix 6 | - [ ] I have added suitable tests demonstrating a fixed bug or new/changed feature to the test suite in `tests/` 7 | - [ ] I have properly documented new or changed features in the documentation or in the docstrings 8 | - [ ] I have properly explained unusual or unexpected code in the comments around it 9 | -------------------------------------------------------------------------------- /.github/workflows/build-docs.yml: -------------------------------------------------------------------------------- 1 | name: Build and Deploy Sphinx Documentation 2 | 3 | on: 4 | push: 5 | branches: 6 | - master # Change to your default branch if needed 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout code 14 | uses: actions/checkout@v3 15 | 16 | - name: Set up Python 17 | uses: actions/setup-python@v4 18 | with: 19 | python-version: '3.x' # Specify Python version as needed 20 | 21 | - name: Build v1.0.3 documentation 22 | run: | 23 | git fetch --tags 24 | git checkout v1.0.3 25 | pip install "jinja2<3" "MarkupSafe<2" "alabaster==0.7.12" 26 | pip install -e . 27 | pip install -e ".[doc]" 28 | 29 | cd docs 30 | make html 31 | mkdir -p ../build/html/v1.0.3 32 | cp -r build/html/* ../build/html/v1.0.3/ 33 | rm -rf build/html 34 | git stash 35 | 36 | - name: Install dependencies 37 | run: | 38 | git checkout master 39 | python -m pip install --upgrade pip 40 | pip install -e . 41 | pip install -e .[doc] 42 | 43 | - name: Build current documentation 44 | run: | 45 | cd docs 46 | make html 47 | cp -r build/html/* ../build/html/ 48 | 49 | - name: Deploy to GitHub Pages 50 | uses: peaceiris/actions-gh-pages@v4 51 | with: 52 | github_token: ${{ secrets.GITHUB_TOKEN }} 53 | publish_dir: ./build/html/ # Adjusted path since we're copying docs to root build directory 54 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish to PyPI 2 | 3 | on: 4 | release: 5 | types: [published] 6 | workflow_dispatch: 7 | inputs: 8 | 9 | permissions: 10 | contents: read 11 | 12 | jobs: 13 | deploy: 14 | runs-on: ubuntu-latest 15 | environment: release 16 | permissions: 17 | id-token: write 18 | steps: 19 | - uses: actions/checkout@v4 20 | - name: Set up Python 21 | uses: actions/setup-python@v5 22 | with: 23 | python-version: "3.12" 24 | cache: pip 25 | - name: Install dependencies 26 | run: | 27 | pip install setuptools wheel build 28 | - name: Build 29 | run: | 30 | python -m build 31 | - name: Publish 32 | uses: pypa/gh-action-pypi-publish@release/v1 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Partially based on 2 | # https://github.com/github/gitignore/blob/main/Python.gitignore 3 | 4 | # OS-specific 5 | .DS_Store 6 | 7 | # IDEs 8 | .idea 9 | .project 10 | .pydevproject 11 | .sublime-project 12 | .vscode 13 | 14 | # Python dev tooling 15 | .mr.developer.cfg 16 | .python-version 17 | 18 | # Cache, temp. files 19 | __pycache__/ 20 | .cache/ 21 | *.py[cod] 22 | *~ 23 | 24 | # C extensions 25 | *.so 26 | 27 | # Distribution / packaging 28 | build/ 29 | develop-eggs/ 30 | dist/ 31 | eggs/ 32 | .eggs/ 33 | lib/ 34 | lib64/ 35 | parts/ 36 | sdist/ 37 | var/ 38 | *.egg-info/ 39 | .installed.cfg 40 | *.egg 41 | 42 | # System misc. 43 | bin 44 | *.tar.gz 45 | 46 | # Installer logs 47 | pip-log.txt 48 | 49 | # Unit test / coverage reports 50 | .tox/ 51 | .coverage 52 | nosetests.xml 53 | 54 | # Media files for testing 55 | tests/media/ 56 | 57 | # Translations 58 | *.mo 59 | 60 | # Documentation 61 | docs/build/ 62 | 63 | # Publishing 64 | .pypirc 65 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/psf/black 3 | rev: 23.7.0 4 | hooks: 5 | - id: black 6 | language_version: python3 7 | files: \.py$ 8 | - repo: https://github.com/PyCQA/isort 9 | rev: 5.12.0 10 | hooks: 11 | - id: isort 12 | args: 13 | - '--filter-files' 14 | files: \.py$ 15 | - repo: https://github.com/PyCQA/flake8 16 | rev: 6.0.0 17 | hooks: 18 | - id: flake8 19 | additional_dependencies: 20 | - flake8-absolute-import>=1.0 21 | - flake8-docstrings>=1.7.0 22 | - flake8-rst-docstrings>=0.3 23 | - flake8-implicit-str-concat==0.4.0 24 | name: flake8-test 25 | files: \.py$ 26 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yml 2 | # Read the Docs configuration file 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | # Required 6 | version: 2 7 | 8 | # Build documentation in the docs/ directory with Sphinx 9 | sphinx: 10 | configuration: docs/conf.py 11 | 12 | # Build documentation with MkDocs 13 | #mkdocs: 14 | # configuration: mkdocs.yml 15 | 16 | # Optionally set the version of Python and requirements required to build your docs 17 | python: 18 | version: 3.7 19 | install: 20 | - method: pip 21 | path: . 22 | extra_requirements: 23 | - doc 24 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3 2 | 3 | # Install ffmpeg to get ffplay using system package manager 4 | RUN apt-get -y update && apt-get -y install ffmpeg 5 | 6 | # Install some special fonts we use in testing, etc.. 7 | RUN apt-get -y install fonts-liberation 8 | 9 | RUN apt-get install -y locales && \ 10 | locale-gen C.UTF-8 && \ 11 | /usr/sbin/update-locale LANG=C.UTF-8 12 | 13 | ENV LC_ALL C.UTF-8 14 | 15 | # Update pip 16 | RUN pip install --upgrade pip 17 | 18 | ADD . /moviepy 19 | RUN cd /moviepy && pip install . && pip install .[test] && pip install .[doc] && pip install .[lint] 20 | 21 | -------------------------------------------------------------------------------- /LICENCE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Zulko 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.txt 2 | recursive-include docs * 3 | include *.rst 4 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | build: off 2 | 3 | test_script: 4 | - true -------------------------------------------------------------------------------- /docs/_static/code/getting_started/quick_presentation/basic_example.py: -------------------------------------------------------------------------------- 1 | # Import everything needed to edit video clips 2 | from moviepy import * 3 | 4 | # Load file example.mp4 and extract only the subclip from 00:00:10 to 00:00:20 5 | clip = VideoFileClip("long_examples/example2.mp4").subclipped(10, 20) 6 | 7 | # Reduce the audio volume to 80% of his original volume 8 | clip = clip.with_volume_scaled(0.8) 9 | 10 | # Generate a text clip. You can customize the font, color, etc. 11 | txt_clip = TextClip( 12 | font="example.ttf", text="Big Buck Bunny", font_size=70, color="white" 13 | ) 14 | 15 | # Say that you want it to appear for 10s at the center of the screen 16 | txt_clip = txt_clip.with_position("center").with_duration(10) 17 | 18 | # Overlay the text clip on the first video clip 19 | video = CompositeVideoClip([clip, txt_clip]) 20 | 21 | # Write the result to a file (many options available!) 22 | video.write_videofile("result.mp4") 23 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/compositing/CompositeAudioClip.py: -------------------------------------------------------------------------------- 1 | """Let's first concatenate (one after the other) then composite 2 | (on top of each other) three audio clips.""" 3 | 4 | from moviepy import AudioFileClip, CompositeAudioClip, concatenate_audioclips 5 | 6 | # We load all the clips we want to compose 7 | clip1 = AudioFileClip("example.wav") 8 | clip2 = AudioFileClip("example2.wav") 9 | clip3 = AudioFileClip("example3.wav") 10 | 11 | # All clip will play one after the other 12 | concat = concatenate_audioclips([clip1, clip2, clip3]) 13 | 14 | # We will play clip1, then on top of it clip2 starting at t=5s, 15 | # and clip3 on top of both starting t=9s 16 | compo = CompositeAudioClip( 17 | [ 18 | clip1.with_volume_scaled(1.2), 19 | clip2.with_start(5), # start at t=5s 20 | clip3.with_start(9), 21 | ] 22 | ) 23 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/compositing/CompositeVideoClip.py: -------------------------------------------------------------------------------- 1 | """Let's stack three video clips on top of each other with 2 | CompositeVideoClip.""" 3 | 4 | from moviepy import VideoFileClip, CompositeVideoClip 5 | 6 | # We load all the clips we want to compose 7 | clip1 = VideoFileClip("example.mp4") 8 | clip2 = VideoFileClip("example2.mp4").subclipped(0, 1) 9 | clip3 = VideoFileClip("example.mp4") 10 | 11 | # We concatenate them and write theme stacked on top of each other, 12 | # with clip3 over clip2 over clip1 13 | final_clip = CompositeVideoClip([clip1, clip2, clip3]) 14 | final_clip.write_videofile("final_clip.mp4") 15 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/compositing/concatenate.py: -------------------------------------------------------------------------------- 1 | """Let's concatenate (play one after the other) three video clips.""" 2 | 3 | from moviepy import VideoFileClip, concatenate_videoclips 4 | 5 | # We load all the clips we want to concatenate 6 | clip1 = VideoFileClip("example.mp4") 7 | clip2 = VideoFileClip("example2.mp4").subclipped(0, 1) 8 | clip3 = VideoFileClip("example3.mp4") 9 | 10 | # We concatenate them and write the result 11 | final_clip = concatenate_videoclips([clip1, clip2, clip3]) 12 | final_clip.write_videofile("final_clip.mp4") 13 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/compositing/crossfadein.py: -------------------------------------------------------------------------------- 1 | """In this example, we will concatenate two clips with a 1-second 2 | crossfadein of the second clip.""" 3 | 4 | from moviepy import VideoFileClip, CompositeVideoClip, vfx 5 | 6 | # We load all the clips we want to compose 7 | clip1 = VideoFileClip("example.mp4") 8 | clip2 = VideoFileClip("example2.mp4") 9 | 10 | clips = [ 11 | clip1.with_end(2), 12 | clip2.with_start(1).with_effects([vfx.CrossFadeIn(1)]), 13 | ] 14 | final_clip = CompositeVideoClip(clips) 15 | final_clip.write_videofile("final_clip.mp4") 16 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/compositing/juxtaposing.py: -------------------------------------------------------------------------------- 1 | """Let's juxtapose four video clips in a 2x2 grid.""" 2 | 3 | from moviepy import VideoFileClip, clips_array, vfx 4 | 5 | # We will use the same clip and transform it in 3 ways 6 | clip1 = VideoFileClip("example.mp4").with_effects([vfx.Margin(10)]) # add 10px contour 7 | clip2 = clip1.with_effects([vfx.MirrorX()]) # Flip horizontaly 8 | clip3 = clip1.with_effects([vfx.MirrorY()]) # Flip verticaly 9 | clip4 = clip1.resized(0.6) # downsize to 60% of original 10 | 11 | # The form of the final clip will depend of the shape of the array 12 | # We want our clip to be our 4 videos, 2x2, so we make an array of 2x2 13 | array = [ 14 | [clip1, clip2], 15 | [clip3, clip4], 16 | ] 17 | final_clip = clips_array(array) 18 | # let's resize the final clip so it has 480px of width 19 | final_clip = final_clip.resized(width=480) 20 | 21 | final_clip.write_videofile("final_clip.mp4") 22 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/compositing/with_position.py: -------------------------------------------------------------------------------- 1 | """Let's position some text and images on a video.""" 2 | 3 | from moviepy import TextClip, VideoFileClip, CompositeVideoClip, ImageClip 4 | 5 | # We load all the clips we want to compose 6 | background = VideoFileClip("example2.mp4").subclipped(0, 2) 7 | title = TextClip( 8 | "./example.ttf", 9 | text="Big Buck Bunny", 10 | font_size=80, 11 | color="#fff", 12 | text_align="center", 13 | duration=1, 14 | ) 15 | author = TextClip( 16 | "./example.ttf", 17 | text="Blender Foundation", 18 | font_size=40, 19 | color="#fff", 20 | text_align="center", 21 | duration=1, 22 | ) 23 | copyright = TextClip( 24 | "./example.ttf", 25 | text="© CC BY 3.0", 26 | font_size=20, 27 | color="#fff", 28 | text_align="center", 29 | duration=1, 30 | ) 31 | logo = ImageClip("./example2.png", duration=1).resized(height=50) 32 | 33 | # We want our title to be at the center horizontaly and start at 25% 34 | # of the video verticaly. We can set as "center", "left", "right", 35 | # "top" and "bottom", and % relative from the clip size 36 | title = title.with_position(("center", 0.25), relative=True) 37 | 38 | # We want the author to be in the center, 30px under the title 39 | # We can set as pixels 40 | top = background.h * 0.25 + title.h + 30 41 | left = (background.w - author.w) / 2 42 | author = author.with_position((left, top)) 43 | 44 | # We want the copyright to be 30px before bottom 45 | copyright = copyright.with_position(("center", background.h - copyright.h - 30)) 46 | 47 | # Finally, we want the logo to be in the center, but to drop as time pass 48 | # We can do so by setting position as a function that take time as argument, 49 | # a lot like frame_function 50 | top = (background.h - logo.h) / 2 51 | logo = logo.with_position(lambda t: ("center", top + t * 30)) 52 | 53 | # We write the result 54 | final_clip = CompositeVideoClip([background, title, author, copyright, logo]) 55 | final_clip.write_videofile("final_clip.mp4") 56 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/compositing/with_start.py: -------------------------------------------------------------------------------- 1 | from moviepy import VideoFileClip, CompositeVideoClip 2 | 3 | # We load all the clips we want to compose 4 | clip1 = VideoFileClip("example.mp4") 5 | clip2 = VideoFileClip("example2.mp4").subclipped(0, 1) 6 | clip3 = VideoFileClip("example3.mp4") 7 | 8 | # We want to stop clip1 after 1s 9 | clip1 = clip1.with_end(1) 10 | 11 | # We want to play clip2 after 1.5s 12 | clip2 = clip2.with_start(1.5) 13 | 14 | # We want to play clip3 at the end of clip2, and so for 3 seconds only 15 | # Some times its more practical to modify the duration of a clip instead 16 | # of his end 17 | clip3 = clip3.with_start(clip2.end).with_duration(1) 18 | 19 | # We write the result 20 | final_clip = CompositeVideoClip([clip1, clip2, clip3]) 21 | final_clip.write_videofile("final_clip.mp4") 22 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/effects/custom_effect.py: -------------------------------------------------------------------------------- 1 | """Let's write a custom effect that will add a basic progress bar 2 | at the bottom of our clip.""" 3 | 4 | from moviepy import VideoClip 5 | from moviepy.decorators import requires_duration 6 | 7 | 8 | # Here you see a decorator that will verify if our clip have a duration 9 | # MoviePy offer a few of them that may come handy when writing your own effects 10 | @requires_duration 11 | def progress_bar(clip: VideoClip, color: tuple, height: int = 10): 12 | """ 13 | Add a progress bar at the bottom of our clip 14 | 15 | Parameters 16 | ---------- 17 | 18 | color: Color of the bar as a RGB tuple 19 | height: The height of the bar in pixels. Default = 10 20 | """ 21 | 22 | # Because we have define the filter func inside our global effect, 23 | # it have access to global effect scope and can use clip from inside filter 24 | def filter(get_frame, t): 25 | progression = t / clip.duration 26 | bar_width = int(progression * clip.w) 27 | 28 | # Showing a progress bar is just replacing bottom pixels 29 | # on some part of our frame 30 | frame = get_frame(t) 31 | frame[-height:, 0:bar_width] = color 32 | 33 | return frame 34 | 35 | return clip.transform(filter, apply_to="mask") 36 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/effects/image_transform.py: -------------------------------------------------------------------------------- 1 | """Let's invert the green and blue channels of a video.""" 2 | 3 | from moviepy import VideoFileClip 4 | import numpy 5 | 6 | my_clip = VideoFileClip("example.mp4") 7 | 8 | 9 | def invert_green_blue(image: numpy.ndarray) -> numpy.ndarray: 10 | return image[:, :, [0, 2, 1]] 11 | 12 | 13 | modified_clip1 = my_clip.image_transform(invert_green_blue) 14 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/effects/modify_copy_example.py: -------------------------------------------------------------------------------- 1 | # Import everything needed to edit video clips 2 | from moviepy import VideoFileClip 3 | 4 | # Load example.mp4 5 | clip = VideoFileClip("example.mp4") 6 | 7 | # This does nothing, as multiply_volume will return a copy of clip 8 | # which you will loose immediatly as you don't store it 9 | # If you was to render clip now, the audio would still be at full volume 10 | clip.with_volume_scaled(0.1) 11 | 12 | # This create a copy of clip in clip_whisper with a volume of only 10% the original, 13 | # but does not modify the original clip 14 | # If you was to render clip right now, the audio would still be at full volume 15 | # If you was to render clip_whisper, the audio would be a 10% of the original volume 16 | clip_whisper = clip.with_volume_scaled(0.1) 17 | 18 | # This replace the original clip with a copy of it where volume is only 10% of 19 | # the original. If you was to render clip now, the audio would be at 10% 20 | # The original clip is now lost 21 | clip = clip.with_volume_scaled(0.1) 22 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/effects/time_transform.py: -------------------------------------------------------------------------------- 1 | from moviepy import VideoFileClip 2 | import math 3 | 4 | my_clip = VideoFileClip("example.mp4") 5 | 6 | # Let's accelerate the video by a factor of 3 7 | modified_clip1 = my_clip.time_transform(lambda t: t * 3) 8 | # Let's play the video back and forth with a "sine" time-warping effect 9 | modified_clip2 = my_clip.time_transform(lambda t: 1 + math.sin(t)) 10 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/effects/transform.py: -------------------------------------------------------------------------------- 1 | """Let's create a scolling video effect from scratch.""" 2 | 3 | from moviepy import VideoFileClip 4 | 5 | my_clip = VideoFileClip("example.mp4") 6 | 7 | 8 | def scroll(get_frame, t): 9 | """ 10 | This function returns a 'region' of the current frame. 11 | The position of this region depends on the time. 12 | """ 13 | frame = get_frame(t) 14 | frame_region = frame[int(t) : int(t) + 360, :] 15 | return frame_region 16 | 17 | 18 | modified_clip1 = my_clip.transform(scroll) 19 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/effects/using_effects.py: -------------------------------------------------------------------------------- 1 | from moviepy import VideoFileClip 2 | from moviepy import vfx, afx 3 | 4 | myclip = VideoFileClip("example.mp4") 5 | # resize clip to be 460px in width, keeping aspect ratio 6 | myclip = myclip.with_effects([vfx.Resize(width=460)]) 7 | 8 | # fx method return a copy of the clip, so we can easily chain them 9 | # double the speed and half the audio volume 10 | myclip = myclip.with_effects([vfx.MultiplySpeed(2), afx.MultiplyVolume(0.5)]) 11 | 12 | # because effects are added to Clip at runtime, you can also call 13 | # them directly from your clip as methods 14 | myclip = myclip.with_effects([vfx.MultiplyColor(0.5)]) # darken the clip 15 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/effects/using_with_methods.py: -------------------------------------------------------------------------------- 1 | from moviepy import VideoFileClip 2 | 3 | myclip = VideoFileClip("example.mp4") 4 | myclip = myclip.with_end(5) # stop the clip after 5 sec 5 | myclip = myclip.without_audio() # remove the audio of the clip 6 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/loading/AudioArrayClip.py: -------------------------------------------------------------------------------- 1 | """Let's create an audioclip from values in a numpy array.""" 2 | 3 | import numpy as np 4 | from moviepy import AudioArrayClip 5 | 6 | # We want to play these notes 7 | notes = {"A": 440, "B": 494, "C": 523, "D": 587, "E": 659, "F": 698} 8 | 9 | note_duration = 0.5 10 | total_duration = len(notes) * note_duration 11 | sample_rate = 44100 # Number of samples per second 12 | 13 | note_size = int(note_duration * sample_rate) 14 | n_frames = note_size * len(notes) 15 | 16 | 17 | def frame_function(t, note_frequency): 18 | return np.sin(note_frequency * 2 * np.pi * t) 19 | 20 | 21 | # At this point one could use this audioclip which generates the audio on the fly 22 | # clip = AudioFileClip(frame_function) 23 | 24 | # We generate all frames timepoints 25 | 26 | audio_frame_values = [ 27 | 2 * [frame_function(t, freq)] 28 | for freq in notes.values() 29 | for t in np.arange(0, note_duration, 1.0 / sample_rate) 30 | ] 31 | # Create an AudioArrayClip from the audio samples 32 | audio_clip = AudioArrayClip(np.array(audio_frame_values), fps=sample_rate) 33 | 34 | # Write the audio clip to a WAV file 35 | audio_clip.write_audiofile("result.wav", fps=44100) 36 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/loading/AudioClip.py: -------------------------------------------------------------------------------- 1 | from moviepy import AudioClip 2 | import numpy as np 3 | 4 | 5 | def audio_frame(t): 6 | """Producing a sinewave of 440 Hz -> note A""" 7 | return np.sin(440 * 2 * np.pi * t) 8 | 9 | 10 | audio_clip = AudioClip(frame_function=audio_frame, duration=3) 11 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/loading/AudioFileClip.py: -------------------------------------------------------------------------------- 1 | from moviepy import * 2 | 3 | # Works for audio files, but also videos file where you only want the keep the audio track 4 | clip = AudioFileClip("example.wav") 5 | clip.write_audiofile("./result.wav") 6 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/loading/ColorClip.py: -------------------------------------------------------------------------------- 1 | from moviepy import ColorClip 2 | 3 | # Color is passed as a RGB tuple 4 | myclip = ColorClip(size=(200, 100), color=(255, 0, 0), duration=1) 5 | # We really don't need more than 1 fps do we ? 6 | myclip.write_videofile("result.mp4", fps=1) 7 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/loading/DataVideoClip.py: -------------------------------------------------------------------------------- 1 | """Let's make a clip where frames depend on values in a list""" 2 | 3 | from moviepy import DataVideoClip 4 | import numpy as np 5 | 6 | # Dataset will just be a list of colors as RGB 7 | dataset = [ 8 | (255, 0, 0), 9 | (0, 255, 0), 10 | (0, 0, 255), 11 | (0, 255, 255), 12 | (255, 0, 255), 13 | (255, 255, 0), 14 | ] 15 | 16 | 17 | # The function make frame take data and create an image of 200x100 px 18 | # filled with the color given in the dataset 19 | def frame_function(data): 20 | frame = np.full((100, 200, 3), data, dtype=np.uint8) 21 | return frame 22 | 23 | 24 | # We create the DataVideoClip, and we set FPS at 2, making a 3s clip 25 | # (because len(dataset) = 6, so 6/2=3) 26 | myclip = DataVideoClip(data=dataset, data_to_frame=frame_function, fps=2) 27 | 28 | # Modifying fps here will change video FPS, not clip FPS 29 | myclip.write_videofile("result.mp4", fps=30) 30 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/loading/ImageClip.py: -------------------------------------------------------------------------------- 1 | """Here's how you transform a VideoClip into an ImageClip from an image, from 2 | arbitrary data, or by extracting a frame at a given time""" 3 | 4 | from moviepy import ImageClip, VideoFileClip 5 | import numpy as np 6 | 7 | # Random RGB noise image of 200x100 8 | noise_image = np.random.randint(low=0, high=255, size=(100, 200, 3)) 9 | 10 | myclip1 = ImageClip("example.png") # You can create it from a path 11 | myclip2 = ImageClip(noise_image) # from a (height x width x 3) RGB numpy array 12 | # Or load videoclip and extract frame at a given time 13 | myclip3 = VideoFileClip("./example.mp4").to_ImageClip(t="00:00:01") 14 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/loading/ImageSequenceClip.py: -------------------------------------------------------------------------------- 1 | from moviepy import ImageSequenceClip 2 | 3 | # A clip with a list of images showed for 1 second each 4 | myclip = ImageSequenceClip( 5 | [ 6 | "example_img_dir/image_0001.jpg", 7 | "example_img_dir/image_0002.jpg", 8 | "example_img_dir/image_0003.jpg", 9 | ], 10 | durations=[1, 1, 1], 11 | ) 12 | # 3 images, 1 seconds each, duration = 3 13 | print("Clip duration: {}".format(myclip.duration)) 14 | # 3 seconds, 3 images, fps is 3/3 = 1 15 | print("Clip fps: {}".format(myclip.fps)) 16 | 17 | # This time we will load all images in the dir, and instead of showing theme 18 | # for X seconds, we will define FPS 19 | myclip2 = ImageSequenceClip("./example_img_dir", fps=30) 20 | # fps = 30, so duration = nb images in dir / 30 21 | print("Clip duration: {}".format(myclip2.duration)) 22 | print("Clip fps: {}".format(myclip2.fps)) # fps = 30 23 | 24 | # the gif will be 30 fps, its duration will depend on the number of 25 | # images in dir 26 | myclip.write_gif("result.gif") # the gif will be 3 sec and 1 fps 27 | myclip2.write_gif("result2.gif") 28 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/loading/TextClip.py: -------------------------------------------------------------------------------- 1 | from moviepy import TextClip 2 | 3 | font = "./example.ttf" 4 | 5 | # First we use as string and let system autocalculate clip dimensions to fit the text 6 | # we set clip duration to 2 secs, if we do not, it got an infinite duration 7 | txt_clip1 = TextClip( 8 | font=font, 9 | text="Hello World !", 10 | font_size=30, 11 | color="#FF0000", # Red 12 | bg_color="#FFFFFF", 13 | duration=2, 14 | ) 15 | # This time we load text from a file, we set a fixed size for clip and let the system find best font size, 16 | # allowing for line breaking 17 | txt_clip2 = TextClip( 18 | font=font, 19 | filename="./example.txt", 20 | size=(500, 200), 21 | bg_color="#FFFFFF", 22 | method="caption", 23 | color=(0, 0, 255, 127), 24 | ) # Blue with 50% transparency 25 | 26 | # we set duration, because by default image clip are infinite, and we cannot render infinite 27 | txt_clip2 = txt_clip2.with_duration(2) 28 | # ImageClip have no FPS either, so we must defined it 29 | txt_clip1.write_videofile("result1.mp4", fps=24) 30 | txt_clip2.write_videofile("result2.mp4", fps=24) 31 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/loading/VideoClip.py: -------------------------------------------------------------------------------- 1 | from PIL import Image, ImageDraw 2 | import numpy as np 3 | from moviepy import VideoClip 4 | import math 5 | 6 | WIDTH, HEIGHT = (128, 128) 7 | RED = (255, 0, 0) 8 | 9 | 10 | def frame_function(t): 11 | frequency = 1 # One pulse per second 12 | coef = 0.5 * (1 + math.sin(2 * math.pi * frequency * t)) # radius varies over time 13 | radius = WIDTH * coef 14 | 15 | x1 = WIDTH / 2 - radius / 2 16 | y1 = HEIGHT / 2 - radius / 2 17 | x2 = WIDTH / 2 + radius / 2 18 | y2 = HEIGHT / 2 + radius / 2 19 | 20 | img = Image.new("RGB", (WIDTH, HEIGHT)) 21 | draw = ImageDraw.Draw(img) 22 | draw.ellipse((x1, y1, x2, y2), fill=RED) 23 | 24 | return np.array(img) # returns a 8-bit RGB array 25 | 26 | 27 | # we define a 2s duration for the clip to be able to render it later 28 | clip = VideoClip(frame_function, duration=2) 29 | # we must set a framerate because VideoClip have no framerate by default 30 | clip.write_gif("circle.gif", fps=15) 31 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/loading/VideoFileClip.py: -------------------------------------------------------------------------------- 1 | from moviepy import VideoFileClip 2 | 3 | myclip = VideoFileClip("example.mp4") 4 | 5 | # video file clips already have fps and duration 6 | print("Clip duration: {}".format(myclip.duration)) 7 | print("Clip fps: {}".format(myclip.fps)) 8 | 9 | myclip = myclip.subclipped(0.5, 2) # Cutting the clip between 0.5 and 2 secs. 10 | print("Clip duration: {}".format(myclip.duration)) # Cuting will update duration 11 | print("Clip fps: {}".format(myclip.fps)) # and keep fps 12 | # the output video will be 1.5 sec long and use original fps 13 | myclip.write_videofile("result.mp4") 14 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/loading/closing.py: -------------------------------------------------------------------------------- 1 | from moviepy import * 2 | 3 | # clip.close() is implicitly called, so the lock on my_audiofile.mp3 file 4 | # is immediately released. 5 | try: 6 | with AudioFileClip("example.wav") as clip: 7 | raise Exception("Let's simulate an exception") 8 | except Exception as e: 9 | print("{}".format(e)) 10 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/loading/loading.py: -------------------------------------------------------------------------------- 1 | from moviepy import ( 2 | VideoClip, 3 | VideoFileClip, 4 | ImageSequenceClip, 5 | ImageClip, 6 | TextClip, 7 | ColorClip, 8 | AudioFileClip, 9 | AudioClip, 10 | ) 11 | import numpy as np 12 | 13 | # Define some constants for later use 14 | black = (255, 255, 255) # RGB for black 15 | 16 | 17 | def frame_function(t): 18 | """Random noise image of 200x100""" 19 | return np.random.randint(low=0, high=255, size=(100, 200, 3)) 20 | 21 | 22 | def frame_function_audio(t): 23 | """A note by producing a sinewave of 440 Hz""" 24 | return np.sin(440 * 2 * np.pi * t) 25 | 26 | 27 | # Now lets see how to load different type of resources ! 28 | 29 | # VIDEO CLIPS 30 | # for custom animations, where frame_function is a function returning an image 31 | # as numpy array for a given time 32 | clip = VideoClip(frame_function, duration=5) 33 | clip = VideoFileClip("example.mp4") # for videos 34 | # for a list or directory of images to be used as a video sequence 35 | clip = ImageSequenceClip("example_img_dir", fps=24) 36 | clip = ImageClip("example.png") # For a picture 37 | # To create the image of a text 38 | clip = TextClip(font="./example.ttf", text="Hello!", font_size=70, color="black") 39 | # a clip of a single unified color, where color is a RGB tuple/array/list 40 | clip = ColorClip(size=(460, 380), color=black) 41 | 42 | # AUDIO CLIPS 43 | # for audio files, but also videos where you only want the keep the audio track 44 | clip = AudioFileClip("example.wav") 45 | # for custom audio, where frame_function is a function returning a 46 | # float (or tuple for stereo) for a given time 47 | clip = AudioClip(frame_function_audio, duration=3) 48 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/loading/masks.py: -------------------------------------------------------------------------------- 1 | from moviepy import VideoClip, ImageClip, VideoFileClip 2 | import numpy as np 3 | 4 | # Random RGB noise image of 200x100 5 | frame_function = lambda t: np.random.rand(100, 200) 6 | 7 | # To define the VideoClip as a mask, just pass parameter is_mask as True 8 | maskclip1 = VideoClip(frame_function, duration=4, is_mask=True) # A random noise mask 9 | maskclip2 = ImageClip("example_mask.jpg", is_mask=True) # A fixed mask as jpeg 10 | maskclip3 = VideoFileClip("example_mask.mp4", is_mask=True) # A video as a mask 11 | 12 | # Load our basic clip, resize to 200x100 and apply each mask 13 | clip = VideoFileClip("example.mp4") 14 | clip_masked1 = clip.with_mask(maskclip1) 15 | clip_masked2 = clip.with_mask(maskclip2) 16 | clip_masked3 = clip.with_mask(maskclip3) 17 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/rendering/display_in_notebook.py: -------------------------------------------------------------------------------- 1 | from moviepy import * 2 | 3 | # ... 4 | # ... some jupyter specifics stuff 5 | # ... 6 | 7 | my_video_clip = VideoFileClip("./example.mp4") 8 | my_image_clip = ImageClip("./example.png") 9 | my_audio_clip = AudioFileClip("./example.wav") 10 | 11 | # We can show any type of clip 12 | my_video_clip.display_in_notebook() # embeds a video 13 | my_image_clip.display_in_notebook() # embeds an image 14 | my_audio_clip.display_in_notebook() # embeds a sound 15 | 16 | # We can display only a snaphot of a video 17 | my_video_clip.display_in_notebook(t=1) 18 | 19 | # We can provide any valid HTML5 option as keyword argument 20 | # For instance, if the clip is too big, we can set width 21 | my_video_clip.display_in_notebook(width=400) 22 | 23 | # We can also make it loop, for example to check if a GIF is 24 | # looping as expected 25 | my_video_clip.display_in_notebook(autoplay=1, loop=1) 26 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/rendering/preview.py: -------------------------------------------------------------------------------- 1 | from moviepy import * 2 | 3 | myclip = VideoFileClip("./example.mp4").subclipped(0, 1) # Keep only 0 to 1 sec 4 | 5 | # We preview our clip as a video, inheriting FPS and audio of the original clip 6 | myclip.preview() 7 | 8 | # We preview our clip as video, but with a custom FPS for video and audio 9 | # making it less consuming for our computer 10 | myclip.preview(fps=5, audio_fps=11000) 11 | 12 | # Now we preview without audio 13 | myclip.preview(audio=False) 14 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/rendering/save_frame.py: -------------------------------------------------------------------------------- 1 | from moviepy import * 2 | 3 | # We load all the clips we want to compose 4 | myclip = VideoFileClip("example.mp4") 5 | myclip.save_frame("result.png", t=1) # Save frame at 1 sec 6 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/rendering/show.py: -------------------------------------------------------------------------------- 1 | from moviepy import * 2 | 3 | myclip = VideoFileClip("./example.mp4") 4 | 5 | # We show the first frame of our clip 6 | myclip.show() 7 | 8 | # We show the frame at point 00:00:01.5 of our clip 9 | myclip.show(1.5) 10 | 11 | # We want to see our clip without applying his mask 12 | myclip.show(1.5, with_mask=False) 13 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/rendering/write_gif.py: -------------------------------------------------------------------------------- 1 | from moviepy import * 2 | 3 | myclip = VideoFileClip("example.mp4").subclipped(0, 2) 4 | 5 | # Here we just save as GIF 6 | myclip.write_gif("result.gif") 7 | 8 | # Here we save as GIF, but we set the FPS of our GIF at 10 9 | myclip.write_gif("result.gif", fps=10) 10 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/rendering/write_images_sequence.py: -------------------------------------------------------------------------------- 1 | from moviepy import * 2 | import os 3 | 4 | myclip = VideoFileClip("example.mp4") 5 | 6 | # Here we just save in dir output with filename being his index (start at 0, then +1 for each frame) 7 | os.mkdir("./output") 8 | myclip.write_images_sequence("./output/%d.jpg") 9 | 10 | # We set the FPS of our GIF at 10, and we leftpad name with 0 up to 4 digits 11 | myclip.write_images_sequence("./output/%04d.jpg") 12 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/rendering/write_videofile.py: -------------------------------------------------------------------------------- 1 | from moviepy import * 2 | 3 | # We load all the clips we want to compose 4 | background = VideoFileClip("long_examples/example2.mp4").subclipped(0, 10) 5 | title = TextClip( 6 | "./example.ttf", 7 | text="Big Buck Bunny", 8 | font_size=80, 9 | color="#fff", 10 | text_align="center", 11 | duration=3, 12 | ).with_position(("center", "center")) 13 | 14 | # We make our final clip through composition 15 | final_clip = CompositeVideoClip([background, title]) 16 | 17 | # And finally we can write the result into a file 18 | 19 | # Here we just save as MP4, inheriting FPS, etc. from final_clip 20 | final_clip.write_videofile("result.mp4") 21 | 22 | # Here we save as MP4, but we set the FPS of the clip to our own, here 24 fps, like cinema 23 | final_clip.write_videofile("result24fps.mp4", fps=24) 24 | 25 | # Now we save as WEBM instead, and we want tu use codec libvpx-vp9 (usefull when mp4 + transparency). 26 | # We also want ffmpeg compression optimisation as minimal as possible. This will not change 27 | # the video quality and it will decrease time for encoding, but increase final file size a lot. 28 | # Finally, we want ffmpeg to use 4 threads for video encoding. You should probably leave that 29 | # to default, as ffmpeg is already quite good at using the best setting on his own. 30 | final_clip.write_videofile( 31 | "result.webm", codec="libvpx-vp9", fps=24, preset="ultrafast", threads=4 32 | ) 33 | -------------------------------------------------------------------------------- /docs/_static/code/user_guide/rendering/write_videofile_duration.py: -------------------------------------------------------------------------------- 1 | from moviepy import * 2 | 3 | # By default an ImageClip has no duration 4 | my_clip = ImageClip("example.png") 5 | 6 | try: 7 | # This will fail! We cannot write a clip with no duration! 8 | my_clip.write_videofile("result.mp4") 9 | except: 10 | print("Cannot write a video without duration") 11 | 12 | # By calling with_duration on our clip, we fix the problem! We also need to set fps 13 | my_clip.with_duration(2).write_videofile("result.mp4", fps=1) 14 | -------------------------------------------------------------------------------- /docs/_static/medias/accel_decel-fx-params.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/docs/_static/medias/accel_decel-fx-params.png -------------------------------------------------------------------------------- /docs/_static/medias/getting_started/explanations.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/docs/_static/medias/getting_started/explanations.jpeg -------------------------------------------------------------------------------- /docs/_static/medias/getting_started/moviepy_10_minutes/moviepy_10_minutes.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/docs/_static/medias/getting_started/moviepy_10_minutes/moviepy_10_minutes.zip -------------------------------------------------------------------------------- /docs/_static/medias/getting_started/moviepy_10_minutes/trailer_bbb.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/docs/_static/medias/getting_started/moviepy_10_minutes/trailer_bbb.mp4 -------------------------------------------------------------------------------- /docs/_static/medias/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/docs/_static/medias/logo.png -------------------------------------------------------------------------------- /docs/_static/medias/logo_small.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/docs/_static/medias/logo_small.jpeg -------------------------------------------------------------------------------- /docs/_static/medias/user_guide/circle.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/docs/_static/medias/user_guide/circle.gif -------------------------------------------------------------------------------- /docs/_static/medias/user_guide/demo_preview.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/docs/_static/medias/user_guide/demo_preview.jpeg -------------------------------------------------------------------------------- /docs/_static/medias/user_guide/stacked.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/docs/_static/medias/user_guide/stacked.jpeg -------------------------------------------------------------------------------- /docs/_static/medias/user_guide/videoWH.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/docs/_static/medias/user_guide/videoWH.jpeg -------------------------------------------------------------------------------- /docs/_static/moviepy.css: -------------------------------------------------------------------------------- 1 | @import url(flasky.css) 2 | /* Override some aspects of the pydata-sphinx-theme */ 3 | 4 | .indexwrapper .sphinxsidebar { visibility: hidden; } 5 | 6 | .logo img.logo { width: 120px; height: 120px; padding-right: 30px; } 7 | 8 | div.body h1, div.body h2, div.body h3, div.body h4, div.body h5, div.body h6 9 | { font-family: 'Times New Roman', 'Garamond', 'Georgia', serif; } 10 | 11 | 12 | :root { 13 | /* Use softer blue from bootstrap's default info color */ 14 | --pst-color-info: 23, 162, 184; 15 | } 16 | 17 | table { 18 | width: auto; /* Override fit-content which breaks Styler user guide ipynb */ 19 | } 20 | 21 | /* Main index page overview cards */ 22 | 23 | .intro-card { 24 | padding: 30px 10px 20px 10px; 25 | } 26 | 27 | .intro-card .sd-card-img-top { 28 | margin: 10px; 29 | height: 52px; 30 | background: none !important; 31 | } 32 | 33 | .intro-card .sd-card-title { 34 | color: var(--pst-color-primary); 35 | font-size: var(--pst-font-size-h5); 36 | padding: 1rem 0rem 0.5rem 0rem; 37 | } 38 | 39 | .intro-card .sd-card-footer { 40 | border: none !important; 41 | } 42 | 43 | .intro-card .sd-card-footer p.sd-card-text { 44 | max-width: 220px; 45 | margin-left: auto; 46 | margin-right: auto; 47 | } 48 | 49 | .intro-card .sd-btn-secondary { 50 | background-color: #6c757d !important; 51 | border-color: #6c757d !important; 52 | } 53 | 54 | .intro-card .sd-btn-secondary:hover { 55 | background-color: #5a6268 !important; 56 | border-color: #545b62 !important; 57 | } 58 | 59 | .card, .card img { 60 | background-color: var(--pst-color-background); 61 | } 62 | -------------------------------------------------------------------------------- /docs/_templates/custom_autosummary/class.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | {{ fullname | escape | underline}} 5 | 6 | .. currentmodule:: {{ module }} 7 | 8 | .. autoclass:: {{ objname }} 9 | :members: 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/_templates/custom_autosummary/module.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | {{ fullname | escape | underline}} 5 | 6 | {% if fullname in ['moviepy.Effect'] or '.fx.' in fullname %} {# Fix for autosummary to document abstract class #} 7 | .. automodule:: {{ fullname }} 8 | :inherited-members: 9 | {% else %} 10 | .. automodule:: {{ fullname }} 11 | {% endif %} 12 | 13 | 14 | {% block classes %} 15 | {% if classes %} 16 | .. rubric:: {{ _('Classes') }} 17 | 18 | .. autosummary:: 19 | :toctree: 20 | :template: custom_autosummary/class.rst 21 | {% for item in classes %} 22 | {{ item }} 23 | {%- endfor %} 24 | {% endif %} 25 | {% endblock %} 26 | 27 | 28 | {% block functions %} 29 | {% if functions %} 30 | .. rubric:: {{ _('Functions') }} 31 | 32 | .. autosummary:: 33 | :toctree: 34 | {% for item in functions %} 35 | {{ item }} 36 | {%- endfor %} 37 | {% endif %} 38 | {% endblock %} 39 | 40 | 41 | {% block exceptions %} 42 | {% if exceptions %} 43 | .. rubric:: {{ _('Exceptions') }} 44 | 45 | .. autosummary:: 46 | {% for item in exceptions %} 47 | {{ item }} 48 | {%- endfor %} 49 | {% endif %} 50 | {% endblock %} 51 | 52 | {% block modules %} 53 | {% if modules %} 54 | .. rubric:: Modules 55 | 56 | .. autosummary:: 57 | :toctree: 58 | :template: custom_autosummary/module.rst 59 | :recursive: 60 | {% for item in modules %} 61 | {% if not item in ['moviepy.version'] %} 62 | {{ item }} 63 | {% endif %} 64 | {%- endfor %} 65 | {% endif %} 66 | {% endblock %} 67 | -------------------------------------------------------------------------------- /docs/_themes/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.pyo 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /docs/developer_guide/developers_install.rst: -------------------------------------------------------------------------------- 1 | .. _developers_install: 2 | 3 | Installation for MoviePy developers 4 | ====================================== 5 | 6 | .. warning:: 7 | This part is only destined to people who want to build the MoviePy documentation by themselves, or to contribute to MoviePy. Normal users don't need it. 8 | 9 | In addition to MoviePy main libraries, MoviePy developers will also need to install additional libraries to be able to run MoviePy tests and build the MoviePy documentation. 10 | 11 | Libraries for documentation 12 | ----------------------------- 13 | 14 | You can install the libraries required to build documentation with: 15 | 16 | .. code:: bash 17 | 18 | $ (sudo) pip install moviepy[doc] 19 | 20 | Once libraries installed you can build the documentation with: 21 | 22 | .. code:: bash 23 | 24 | $ python setup.py build_docs 25 | 26 | 27 | Libraries for testing and linting 28 | ------------------------------------- 29 | 30 | You can install the libraries required for testing and linting with: 31 | 32 | .. code:: bash 33 | 34 | $ (sudo) pip install moviepy[test] 35 | $ (sudo) pip install moviepy[lint] 36 | 37 | Once libraries installed you can test with: 38 | 39 | .. code:: bash 40 | 41 | $ python -m pytest 42 | 43 | And you can lint with: 44 | 45 | .. code:: bash 46 | 47 | $ python -m black . 48 | 49 | and 50 | 51 | .. code:: bash 52 | 53 | $ python3 -m flake8 -v --show-source --max-line-length=92 moviepy docs/conf.py examples tests 54 | 55 | Adding Git pre-commit hooks 56 | ----------------------------- 57 | 58 | Running linter manually is painfull and error prone, instead you should consider adding a pre-commit hook. 59 | To do so you can simply go in your local moviepy directory, and run : 60 | 61 | .. code:: bash 62 | $ pre-commit install 63 | 64 | This will enable a git hooks using python pre-commit framework. 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /docs/developer_guide/index.rst: -------------------------------------------------------------------------------- 1 | .. _developer_guide: 2 | 3 | 4 | The MoviePy Developers Guide 5 | ------------------------------ 6 | 7 | The Developers Guide covers most of the things people wanting to participate to MoviePy development need to know. 8 | 9 | .. toctree:: 10 | :maxdepth: 1 11 | 12 | developers_install 13 | contribution_guidelines 14 | maintainers_publish 15 | -------------------------------------------------------------------------------- /docs/developer_guide/maintainers_publish.rst: -------------------------------------------------------------------------------- 1 | .. _maintainers_publish: 2 | 3 | Publishing a New Version of MoviePy 4 | =================================== 5 | 6 | This section is for maintainers responsible for publishing new versions of MoviePy. Follow these steps to ensure the process is smooth and consistent: 7 | 8 | **Pre-requisites** 9 | ------------------ 10 | - Ensure you have proper permissions to push changes and create releases in the MoviePy repository. 11 | 12 | Steps to Publish a New Version 13 | ------------------------------ 14 | 15 | 1. **Update the `CHANGELOG.md`** 16 | 17 | - Add a new section for the upcoming version, respecting the format used in previous entries. 18 | - Summarize all changes, fixes, and new features. 19 | 20 | 2. **Update the version in `pyproject.toml`** 21 | 22 | - Open the `pyproject.toml` file. 23 | - Update the `version` field to the new version, following `Semantic Versioning `_. 24 | 25 | 3. **Commit and Push** 26 | 27 | - Stage your changes:: 28 | 29 | git add CHANGELOG.md pyproject.toml 30 | 31 | - Commit your changes:: 32 | 33 | git commit -m "Release vX.Y.Z" 34 | 35 | - Push your changes:: 36 | 37 | git push 38 | 39 | 4. **Create a New Tag** 40 | 41 | - Create a tag for the new version (replace ``vX.Y.Z`` with the actual version number):: 42 | 43 | git tag -a vX.Y.Z -m "Release vX.Y.Z" 44 | 45 | - Push the tag to the remote repository:: 46 | 47 | git push origin vX.Y.Z 48 | 49 | 5. **Create a New Release** 50 | 51 | - Go to the repository's page on GitHub (or the relevant hosting platform). 52 | - Navigate to the "Releases" section and create a new release. 53 | - Use the new tag (``vX.Y.Z``) and provide a description for the release. 54 | - Copy the changelog for this version into the release description. 55 | - Publish the release. 56 | 57 | GitHub actions will automatically build and publish the new release on PyPi. 58 | 59 | By following these steps, you ensure that each MoviePy release is well-documented, correctly versioned, and accessible to users. 60 | -------------------------------------------------------------------------------- /docs/getting_started/FAQ.rst: -------------------------------------------------------------------------------- 1 | FAQ and troubleshooting 2 | ========================= 3 | 4 | This section intend to answer the most common questions and errors. 5 | 6 | Common errors that are not bugs 7 | -------------------------------- 8 | 9 | These are very common errors which are not considered as bugs to be 10 | solved (but you can still ask for this to change). If these answers 11 | don't work for you, please open a bug report on Github_, or on the dedicated Subreddit_. 12 | 13 | 14 | MoviePy generated a video that cannot be read by my favorite player. 15 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 16 | 17 | Known reason: one of the video's dimensions were not even, 18 | for instance 720x405, and you used a MPEG4 codec like libx264 (default 19 | in MoviePy). In this case the video generated uses a format that is 20 | readable only on some readers like VLC. 21 | 22 | 23 | I can't seem to read any video with MoviePy 24 | """""""""""""""""""""""""""""""""""""""""""""" 25 | 26 | Known reason: you have a deprecated version of FFmpeg, install a recent version from the 27 | website, not from your OS's repositories! (see :ref:`install`). 28 | 29 | 30 | Previewing videos make them slower than they are 31 | """"""""""""""""""""""""""""""""""""""""""""""""" 32 | 33 | It means that your computer is not good enough to render the clip in real time. Don't hesitate to play with the options of ``preview``: for instance, lower the fps of the sound (11000 Hz is still fine) and the video. Also, downsizing your video with ``resize`` can help. 34 | 35 | .. _Github: https://github.com/Zulko/moviepy 36 | .. _Subreddit: https://www.reddit.com/r/moviepy/ 37 | 38 | -------------------------------------------------------------------------------- /docs/getting_started/docker.rst: -------------------------------------------------------------------------------- 1 | MoviePy Docker 2 | =============== 3 | 4 | Prerequisites 5 | ------------- 6 | 7 | Docker installed: `Docker Engine for Linux `_ or `Docker Desktop for Windows/Mac/Linux `_. 8 | 9 | Build the docker 10 | ----------------- 11 | 1. Move into the moviepy root dir 12 | 2. Build the Dockerfile :: 13 | 14 | docker build -t moviepy -f Dockerfile . 15 | 16 | 17 | How to run the unittests from docker 18 | ------------------------------------------------ 19 | 20 | Run pytest inside the container with the following command :: 21 | 22 | docker run -w /moviepy -it moviepy python -m pytest 23 | 24 | Running your own moviepy script from docker 25 | -------------------------------------------- 26 | 27 | Change directory to where your script is located 28 | 29 | If moviepy docker container is already running, you can connect by: :: 30 | 31 | docker exec -it moviepy python myscript.py 32 | 33 | If the container isn't running already :: 34 | 35 | docker run -it moviepy bash 36 | python myscript.py 37 | 38 | You can also start a container and run a script in one command: :: 39 | 40 | docker run -it -v `pwd`:/code moviepy python myscript.py 41 | -------------------------------------------------------------------------------- /docs/getting_started/index.rst: -------------------------------------------------------------------------------- 1 | .. _getting_started: 2 | 3 | Getting started with MoviePy 4 | ------------------------------ 5 | 6 | This section explain everything you need to start editing with MoviePy. To go further, have a look at the :ref:`user_guide` and the :ref:`reference_manual`. 7 | 8 | 9 | .. toctree:: 10 | :maxdepth: 1 11 | 12 | install 13 | quick_presentation 14 | moviepy_10_minutes 15 | docker 16 | updating_to_v2 17 | FAQ 18 | 19 | -------------------------------------------------------------------------------- /docs/makehtml.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | make clean html 3 | 4 | # open generated HTML files 5 | if [[ $(uname) == 'Darwin' ]]; then 6 | open 'build/html/index.html' -a Firefox 7 | elif [[ $(uname) == 'Linux' ]]; then 8 | firefox build/html/index.html 9 | fi 10 | -------------------------------------------------------------------------------- /docs/reference/index.rst: -------------------------------------------------------------------------------- 1 | .. _reference_manual: 2 | 3 | 4 | Api Reference 5 | ================ 6 | 7 | This is the definitive place to find all the details on MoviePy API documentation. 8 | 9 | For a more beginner introduction, please see :ref:`getting_started`, for a more detailed explanations of the different concepts in MoviePy, 10 | see :ref:`user_guide`. 11 | 12 | .. autosummary:: 13 | :toctree: reference 14 | :recursive: 15 | :template: custom_autosummary/module.rst 16 | 17 | moviepy 18 | 19 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.Clip.Clip.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.Clip.Clip 5 | ================= 6 | 7 | .. currentmodule:: moviepy.Clip 8 | 9 | .. autoclass:: Clip 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.Clip.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.Clip 5 | ============ 6 | 7 | 8 | .. automodule:: moviepy.Clip 9 | 10 | 11 | 12 | 13 | 14 | .. rubric:: Classes 15 | 16 | .. autosummary:: 17 | :toctree: 18 | :template: custom_autosummary/class.rst 19 | 20 | Clip 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.Effect.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.Effect 5 | ============== 6 | 7 | 8 | .. automodule:: moviepy.Effect 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.AudioClip.AudioArrayClip.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.AudioClip.AudioArrayClip 5 | ====================================== 6 | 7 | .. currentmodule:: moviepy.audio.AudioClip 8 | 9 | .. autoclass:: AudioArrayClip 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.AudioClip.AudioClip.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.AudioClip.AudioClip 5 | ================================= 6 | 7 | .. currentmodule:: moviepy.audio.AudioClip 8 | 9 | .. autoclass:: AudioClip 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.AudioClip.CompositeAudioClip.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.AudioClip.CompositeAudioClip 5 | ========================================== 6 | 7 | .. currentmodule:: moviepy.audio.AudioClip 8 | 9 | .. autoclass:: CompositeAudioClip 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.AudioClip.concatenate_audioclips.rst: -------------------------------------------------------------------------------- 1 | moviepy.audio.AudioClip.concatenate\_audioclips 2 | =============================================== 3 | 4 | .. currentmodule:: moviepy.audio.AudioClip 5 | 6 | .. autofunction:: concatenate_audioclips -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.AudioClip.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.AudioClip 5 | ======================= 6 | 7 | 8 | .. automodule:: moviepy.audio.AudioClip 9 | 10 | 11 | 12 | 13 | 14 | .. rubric:: Classes 15 | 16 | .. autosummary:: 17 | :toctree: 18 | :template: custom_autosummary/class.rst 19 | 20 | AudioArrayClip 21 | AudioClip 22 | CompositeAudioClip 23 | 24 | 25 | 26 | 27 | 28 | 29 | .. rubric:: Functions 30 | 31 | .. autosummary:: 32 | :toctree: 33 | 34 | concatenate_audioclips 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.fx.AudioDelay.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.fx.AudioDelay 5 | =========================== 6 | 7 | 8 | .. automodule:: moviepy.audio.fx.AudioDelay 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.fx.AudioFadeIn.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.fx.AudioFadeIn 5 | ============================ 6 | 7 | 8 | .. automodule:: moviepy.audio.fx.AudioFadeIn 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.fx.AudioFadeOut.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.fx.AudioFadeOut 5 | ============================= 6 | 7 | 8 | .. automodule:: moviepy.audio.fx.AudioFadeOut 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.fx.AudioLoop.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.fx.AudioLoop 5 | ========================== 6 | 7 | 8 | .. automodule:: moviepy.audio.fx.AudioLoop 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.fx.AudioNormalize.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.fx.AudioNormalize 5 | =============================== 6 | 7 | 8 | .. automodule:: moviepy.audio.fx.AudioNormalize 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.fx.MultiplyStereoVolume.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.fx.MultiplyStereoVolume 5 | ===================================== 6 | 7 | 8 | .. automodule:: moviepy.audio.fx.MultiplyStereoVolume 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.fx.MultiplyVolume.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.fx.MultiplyVolume 5 | =============================== 6 | 7 | 8 | .. automodule:: moviepy.audio.fx.MultiplyVolume 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.fx.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.fx 5 | ================ 6 | 7 | 8 | .. automodule:: moviepy.audio.fx 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | .. rubric:: Modules 29 | 30 | .. autosummary:: 31 | :toctree: 32 | :template: custom_autosummary/module.rst 33 | :recursive: 34 | 35 | 36 | moviepy.audio.fx.AudioDelay 37 | 38 | 39 | moviepy.audio.fx.AudioFadeIn 40 | 41 | 42 | moviepy.audio.fx.AudioFadeOut 43 | 44 | 45 | moviepy.audio.fx.AudioLoop 46 | 47 | 48 | moviepy.audio.fx.AudioNormalize 49 | 50 | 51 | moviepy.audio.fx.MultiplyStereoVolume 52 | 53 | 54 | moviepy.audio.fx.MultiplyVolume 55 | 56 | 57 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.io.AudioFileClip.AudioFileClip.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.io.AudioFileClip.AudioFileClip 5 | ============================================ 6 | 7 | .. currentmodule:: moviepy.audio.io.AudioFileClip 8 | 9 | .. autoclass:: AudioFileClip 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.io.AudioFileClip.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.io.AudioFileClip 5 | ============================== 6 | 7 | 8 | .. automodule:: moviepy.audio.io.AudioFileClip 9 | 10 | 11 | 12 | 13 | 14 | .. rubric:: Classes 15 | 16 | .. autosummary:: 17 | :toctree: 18 | :template: custom_autosummary/class.rst 19 | 20 | AudioFileClip 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.io.ffmpeg_audiowriter.FFMPEG_AudioWriter.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.io.ffmpeg\_audiowriter.FFMPEG\_AudioWriter 5 | ======================================================== 6 | 7 | .. currentmodule:: moviepy.audio.io.ffmpeg_audiowriter 8 | 9 | .. autoclass:: FFMPEG_AudioWriter 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.io.ffmpeg_audiowriter.ffmpeg_audiowrite.rst: -------------------------------------------------------------------------------- 1 | moviepy.audio.io.ffmpeg\_audiowriter.ffmpeg\_audiowrite 2 | ======================================================= 3 | 4 | .. currentmodule:: moviepy.audio.io.ffmpeg_audiowriter 5 | 6 | .. autofunction:: ffmpeg_audiowrite -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.io.ffmpeg_audiowriter.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.io.ffmpeg\_audiowriter 5 | ==================================== 6 | 7 | 8 | .. automodule:: moviepy.audio.io.ffmpeg_audiowriter 9 | 10 | 11 | 12 | 13 | 14 | .. rubric:: Classes 15 | 16 | .. autosummary:: 17 | :toctree: 18 | :template: custom_autosummary/class.rst 19 | 20 | FFMPEG_AudioWriter 21 | 22 | 23 | 24 | 25 | 26 | 27 | .. rubric:: Functions 28 | 29 | .. autosummary:: 30 | :toctree: 31 | 32 | ffmpeg_audiowrite 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.io.ffplay_audiopreviewer.FFPLAY_AudioPreviewer.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.io.ffplay\_audiopreviewer.FFPLAY\_AudioPreviewer 5 | ============================================================== 6 | 7 | .. currentmodule:: moviepy.audio.io.ffplay_audiopreviewer 8 | 9 | .. autoclass:: FFPLAY_AudioPreviewer 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.io.ffplay_audiopreviewer.ffplay_audiopreview.rst: -------------------------------------------------------------------------------- 1 | moviepy.audio.io.ffplay\_audiopreviewer.ffplay\_audiopreview 2 | ============================================================ 3 | 4 | .. currentmodule:: moviepy.audio.io.ffplay_audiopreviewer 5 | 6 | .. autofunction:: ffplay_audiopreview -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.io.ffplay_audiopreviewer.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.io.ffplay\_audiopreviewer 5 | ======================================= 6 | 7 | 8 | .. automodule:: moviepy.audio.io.ffplay_audiopreviewer 9 | 10 | 11 | 12 | 13 | 14 | .. rubric:: Classes 15 | 16 | .. autosummary:: 17 | :toctree: 18 | :template: custom_autosummary/class.rst 19 | 20 | FFPLAY_AudioPreviewer 21 | 22 | 23 | 24 | 25 | 26 | 27 | .. rubric:: Functions 28 | 29 | .. autosummary:: 30 | :toctree: 31 | 32 | ffplay_audiopreview 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.io.readers.FFMPEG_AudioReader.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.io.readers.FFMPEG\_AudioReader 5 | ============================================ 6 | 7 | .. currentmodule:: moviepy.audio.io.readers 8 | 9 | .. autoclass:: FFMPEG_AudioReader 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.io.readers.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.io.readers 5 | ======================== 6 | 7 | 8 | .. automodule:: moviepy.audio.io.readers 9 | 10 | 11 | 12 | 13 | 14 | .. rubric:: Classes 15 | 16 | .. autosummary:: 17 | :toctree: 18 | :template: custom_autosummary/class.rst 19 | 20 | FFMPEG_AudioReader 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.io.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.io 5 | ================ 6 | 7 | 8 | .. automodule:: moviepy.audio.io 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | .. rubric:: Modules 29 | 30 | .. autosummary:: 31 | :toctree: 32 | :template: custom_autosummary/module.rst 33 | :recursive: 34 | 35 | 36 | moviepy.audio.io.AudioFileClip 37 | 38 | 39 | moviepy.audio.io.ffmpeg_audiowriter 40 | 41 | 42 | moviepy.audio.io.ffplay_audiopreviewer 43 | 44 | 45 | moviepy.audio.io.readers 46 | 47 | 48 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio 5 | ============= 6 | 7 | 8 | .. automodule:: moviepy.audio 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | .. rubric:: Modules 29 | 30 | .. autosummary:: 31 | :toctree: 32 | :template: custom_autosummary/module.rst 33 | :recursive: 34 | 35 | 36 | moviepy.audio.AudioClip 37 | 38 | 39 | moviepy.audio.fx 40 | 41 | 42 | moviepy.audio.io 43 | 44 | 45 | moviepy.audio.tools 46 | 47 | 48 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.tools.cuts.find_audio_period.rst: -------------------------------------------------------------------------------- 1 | moviepy.audio.tools.cuts.find\_audio\_period 2 | ============================================ 3 | 4 | .. currentmodule:: moviepy.audio.tools.cuts 5 | 6 | .. autofunction:: find_audio_period -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.tools.cuts.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.tools.cuts 5 | ======================== 6 | 7 | 8 | .. automodule:: moviepy.audio.tools.cuts 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | .. rubric:: Functions 20 | 21 | .. autosummary:: 22 | :toctree: 23 | 24 | find_audio_period 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.audio.tools.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.audio.tools 5 | =================== 6 | 7 | 8 | .. automodule:: moviepy.audio.tools 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | .. rubric:: Modules 29 | 30 | .. autosummary:: 31 | :toctree: 32 | :template: custom_autosummary/module.rst 33 | :recursive: 34 | 35 | 36 | moviepy.audio.tools.cuts 37 | 38 | 39 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.config.check.rst: -------------------------------------------------------------------------------- 1 | moviepy.config.check 2 | ==================== 3 | 4 | .. currentmodule:: moviepy.config 5 | 6 | .. autofunction:: check -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.config.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.config 5 | ============== 6 | 7 | 8 | .. automodule:: moviepy.config 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | .. rubric:: Functions 20 | 21 | .. autosummary:: 22 | :toctree: 23 | 24 | check 25 | try_cmd 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.config.try_cmd.rst: -------------------------------------------------------------------------------- 1 | moviepy.config.try\_cmd 2 | ======================= 3 | 4 | .. currentmodule:: moviepy.config 5 | 6 | .. autofunction:: try_cmd -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.decorators.add_mask_if_none.rst: -------------------------------------------------------------------------------- 1 | moviepy.decorators.add\_mask\_if\_none 2 | ====================================== 3 | 4 | .. currentmodule:: moviepy.decorators 5 | 6 | .. autofunction:: add_mask_if_none -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.decorators.apply_to_audio.rst: -------------------------------------------------------------------------------- 1 | moviepy.decorators.apply\_to\_audio 2 | =================================== 3 | 4 | .. currentmodule:: moviepy.decorators 5 | 6 | .. autofunction:: apply_to_audio -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.decorators.apply_to_mask.rst: -------------------------------------------------------------------------------- 1 | moviepy.decorators.apply\_to\_mask 2 | ================================== 3 | 4 | .. currentmodule:: moviepy.decorators 5 | 6 | .. autofunction:: apply_to_mask -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.decorators.audio_video_effect.rst: -------------------------------------------------------------------------------- 1 | moviepy.decorators.audio\_video\_effect 2 | ======================================= 3 | 4 | .. currentmodule:: moviepy.decorators 5 | 6 | .. autofunction:: audio_video_effect -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.decorators.convert_masks_to_RGB.rst: -------------------------------------------------------------------------------- 1 | moviepy.decorators.convert\_masks\_to\_RGB 2 | ========================================== 3 | 4 | .. currentmodule:: moviepy.decorators 5 | 6 | .. autofunction:: convert_masks_to_RGB -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.decorators.convert_parameter_to_seconds.rst: -------------------------------------------------------------------------------- 1 | moviepy.decorators.convert\_parameter\_to\_seconds 2 | ================================================== 3 | 4 | .. currentmodule:: moviepy.decorators 5 | 6 | .. autofunction:: convert_parameter_to_seconds -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.decorators.convert_path_to_string.rst: -------------------------------------------------------------------------------- 1 | moviepy.decorators.convert\_path\_to\_string 2 | ============================================ 3 | 4 | .. currentmodule:: moviepy.decorators 5 | 6 | .. autofunction:: convert_path_to_string -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.decorators.outplace.rst: -------------------------------------------------------------------------------- 1 | moviepy.decorators.outplace 2 | =========================== 3 | 4 | .. currentmodule:: moviepy.decorators 5 | 6 | .. autofunction:: outplace -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.decorators.preprocess_args.rst: -------------------------------------------------------------------------------- 1 | moviepy.decorators.preprocess\_args 2 | =================================== 3 | 4 | .. currentmodule:: moviepy.decorators 5 | 6 | .. autofunction:: preprocess_args -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.decorators.requires_duration.rst: -------------------------------------------------------------------------------- 1 | moviepy.decorators.requires\_duration 2 | ===================================== 3 | 4 | .. currentmodule:: moviepy.decorators 5 | 6 | .. autofunction:: requires_duration -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.decorators.requires_fps.rst: -------------------------------------------------------------------------------- 1 | moviepy.decorators.requires\_fps 2 | ================================ 3 | 4 | .. currentmodule:: moviepy.decorators 5 | 6 | .. autofunction:: requires_fps -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.decorators.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.decorators 5 | ================== 6 | 7 | 8 | .. automodule:: moviepy.decorators 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | .. rubric:: Functions 20 | 21 | .. autosummary:: 22 | :toctree: 23 | 24 | add_mask_if_none 25 | apply_to_audio 26 | apply_to_mask 27 | audio_video_effect 28 | convert_masks_to_RGB 29 | convert_parameter_to_seconds 30 | convert_path_to_string 31 | outplace 32 | preprocess_args 33 | requires_duration 34 | requires_fps 35 | use_clip_fps_by_default 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.decorators.use_clip_fps_by_default.rst: -------------------------------------------------------------------------------- 1 | moviepy.decorators.use\_clip\_fps\_by\_default 2 | ============================================== 3 | 4 | .. currentmodule:: moviepy.decorators 5 | 6 | .. autofunction:: use_clip_fps_by_default -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy 5 | ======= 6 | 7 | 8 | .. automodule:: moviepy 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | .. rubric:: Modules 29 | 30 | .. autosummary:: 31 | :toctree: 32 | :template: custom_autosummary/module.rst 33 | :recursive: 34 | 35 | 36 | moviepy.Clip 37 | 38 | 39 | moviepy.Effect 40 | 41 | 42 | moviepy.audio 43 | 44 | 45 | moviepy.config 46 | 47 | 48 | moviepy.decorators 49 | 50 | 51 | moviepy.tools 52 | 53 | 54 | 55 | moviepy.video 56 | 57 | 58 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.tools.close_all_clips.rst: -------------------------------------------------------------------------------- 1 | moviepy.tools.close\_all\_clips 2 | =============================== 3 | 4 | .. currentmodule:: moviepy.tools 5 | 6 | .. autofunction:: close_all_clips -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.tools.convert_to_seconds.rst: -------------------------------------------------------------------------------- 1 | moviepy.tools.convert\_to\_seconds 2 | ================================== 3 | 4 | .. currentmodule:: moviepy.tools 5 | 6 | .. autofunction:: convert_to_seconds -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.tools.cross_platform_popen_params.rst: -------------------------------------------------------------------------------- 1 | moviepy.tools.cross\_platform\_popen\_params 2 | ============================================ 3 | 4 | .. currentmodule:: moviepy.tools 5 | 6 | .. autofunction:: cross_platform_popen_params -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.tools.deprecated_version_of.rst: -------------------------------------------------------------------------------- 1 | moviepy.tools.deprecated\_version\_of 2 | ===================================== 3 | 4 | .. currentmodule:: moviepy.tools 5 | 6 | .. autofunction:: deprecated_version_of -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.tools.find_extension.rst: -------------------------------------------------------------------------------- 1 | moviepy.tools.find\_extension 2 | ============================= 3 | 4 | .. currentmodule:: moviepy.tools 5 | 6 | .. autofunction:: find_extension -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.tools.no_display_available.rst: -------------------------------------------------------------------------------- 1 | moviepy.tools.no\_display\_available 2 | ==================================== 3 | 4 | .. currentmodule:: moviepy.tools 5 | 6 | .. autofunction:: no_display_available -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.tools.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.tools 5 | ============= 6 | 7 | 8 | .. automodule:: moviepy.tools 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | .. rubric:: Functions 20 | 21 | .. autosummary:: 22 | :toctree: 23 | 24 | close_all_clips 25 | convert_to_seconds 26 | cross_platform_popen_params 27 | deprecated_version_of 28 | find_extension 29 | no_display_available 30 | subprocess_call 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.tools.subprocess_call.rst: -------------------------------------------------------------------------------- 1 | moviepy.tools.subprocess\_call 2 | ============================== 3 | 4 | .. currentmodule:: moviepy.tools 5 | 6 | .. autofunction:: subprocess_call -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.VideoClip.BitmapClip.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.VideoClip.BitmapClip 5 | ================================== 6 | 7 | .. currentmodule:: moviepy.video.VideoClip 8 | 9 | .. autoclass:: BitmapClip 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.VideoClip.ColorClip.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.VideoClip.ColorClip 5 | ================================= 6 | 7 | .. currentmodule:: moviepy.video.VideoClip 8 | 9 | .. autoclass:: ColorClip 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.VideoClip.DataVideoClip.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.VideoClip.DataVideoClip 5 | ===================================== 6 | 7 | .. currentmodule:: moviepy.video.VideoClip 8 | 9 | .. autoclass:: DataVideoClip 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.VideoClip.ImageClip.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.VideoClip.ImageClip 5 | ================================= 6 | 7 | .. currentmodule:: moviepy.video.VideoClip 8 | 9 | .. autoclass:: ImageClip 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.VideoClip.TextClip.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.VideoClip.TextClip 5 | ================================ 6 | 7 | .. currentmodule:: moviepy.video.VideoClip 8 | 9 | .. autoclass:: TextClip 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.VideoClip.UpdatedVideoClip.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.VideoClip.UpdatedVideoClip 5 | ======================================== 6 | 7 | .. currentmodule:: moviepy.video.VideoClip 8 | 9 | .. autoclass:: UpdatedVideoClip 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.VideoClip.VideoClip.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.VideoClip.VideoClip 5 | ================================= 6 | 7 | .. currentmodule:: moviepy.video.VideoClip 8 | 9 | .. autoclass:: VideoClip 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.VideoClip.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.VideoClip 5 | ======================= 6 | 7 | 8 | .. automodule:: moviepy.video.VideoClip 9 | 10 | 11 | 12 | 13 | 14 | .. rubric:: Classes 15 | 16 | .. autosummary:: 17 | :toctree: 18 | :template: custom_autosummary/class.rst 19 | 20 | BitmapClip 21 | ColorClip 22 | DataVideoClip 23 | ImageClip 24 | TextClip 25 | UpdatedVideoClip 26 | VideoClip 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.compositing.CompositeVideoClip.CompositeVideoClip.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.compositing.CompositeVideoClip.CompositeVideoClip 5 | =============================================================== 6 | 7 | .. currentmodule:: moviepy.video.compositing.CompositeVideoClip 8 | 9 | .. autoclass:: CompositeVideoClip 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.compositing.CompositeVideoClip.clips_array.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.compositing.CompositeVideoClip.clips\_array 2 | ========================================================= 3 | 4 | .. currentmodule:: moviepy.video.compositing.CompositeVideoClip 5 | 6 | .. autofunction:: clips_array -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.compositing.CompositeVideoClip.concatenate_videoclips.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.compositing.CompositeVideoClip.concatenate\_videoclips 2 | ==================================================================== 3 | 4 | .. currentmodule:: moviepy.video.compositing.CompositeVideoClip 5 | 6 | .. autofunction:: concatenate_videoclips -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.compositing.CompositeVideoClip.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.compositing.CompositeVideoClip 5 | ============================================ 6 | 7 | 8 | .. automodule:: moviepy.video.compositing.CompositeVideoClip 9 | 10 | 11 | 12 | 13 | 14 | .. rubric:: Classes 15 | 16 | .. autosummary:: 17 | :toctree: 18 | :template: custom_autosummary/class.rst 19 | 20 | CompositeVideoClip 21 | 22 | 23 | 24 | 25 | 26 | 27 | .. rubric:: Functions 28 | 29 | .. autosummary:: 30 | :toctree: 31 | 32 | clips_array 33 | concatenate_videoclips 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.compositing.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.compositing 5 | ========================= 6 | 7 | 8 | .. automodule:: moviepy.video.compositing 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | .. rubric:: Modules 29 | 30 | .. autosummary:: 31 | :toctree: 32 | :template: custom_autosummary/module.rst 33 | :recursive: 34 | 35 | 36 | moviepy.video.compositing.CompositeVideoClip 37 | 38 | 39 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.AccelDecel.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.AccelDecel 5 | =========================== 6 | 7 | 8 | .. automodule:: moviepy.video.fx.AccelDecel 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.BlackAndWhite.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.BlackAndWhite 5 | ============================== 6 | 7 | 8 | .. automodule:: moviepy.video.fx.BlackAndWhite 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.Blink.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.Blink 5 | ====================== 6 | 7 | 8 | .. automodule:: moviepy.video.fx.Blink 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.Crop.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.Crop 5 | ===================== 6 | 7 | 8 | .. automodule:: moviepy.video.fx.Crop 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.CrossFadeIn.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.CrossFadeIn 5 | ============================ 6 | 7 | 8 | .. automodule:: moviepy.video.fx.CrossFadeIn 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.CrossFadeOut.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.CrossFadeOut 5 | ============================= 6 | 7 | 8 | .. automodule:: moviepy.video.fx.CrossFadeOut 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.EvenSize.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.EvenSize 5 | ========================= 6 | 7 | 8 | .. automodule:: moviepy.video.fx.EvenSize 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.FadeIn.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.FadeIn 5 | ======================= 6 | 7 | 8 | .. automodule:: moviepy.video.fx.FadeIn 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.FadeOut.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.FadeOut 5 | ======================== 6 | 7 | 8 | .. automodule:: moviepy.video.fx.FadeOut 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.Freeze.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.Freeze 5 | ======================= 6 | 7 | 8 | .. automodule:: moviepy.video.fx.Freeze 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.FreezeRegion.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.FreezeRegion 5 | ============================= 6 | 7 | 8 | .. automodule:: moviepy.video.fx.FreezeRegion 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.GammaCorrection.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.GammaCorrection 5 | ================================ 6 | 7 | 8 | .. automodule:: moviepy.video.fx.GammaCorrection 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.HeadBlur.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.HeadBlur 5 | ========================= 6 | 7 | 8 | .. automodule:: moviepy.video.fx.HeadBlur 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.InvertColors.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.InvertColors 5 | ============================= 6 | 7 | 8 | .. automodule:: moviepy.video.fx.InvertColors 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.Loop.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.Loop 5 | ===================== 6 | 7 | 8 | .. automodule:: moviepy.video.fx.Loop 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.LumContrast.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.LumContrast 5 | ============================ 6 | 7 | 8 | .. automodule:: moviepy.video.fx.LumContrast 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.MakeLoopable.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.MakeLoopable 5 | ============================= 6 | 7 | 8 | .. automodule:: moviepy.video.fx.MakeLoopable 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.Margin.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.Margin 5 | ======================= 6 | 7 | 8 | .. automodule:: moviepy.video.fx.Margin 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.MaskColor.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.MaskColor 5 | ========================== 6 | 7 | 8 | .. automodule:: moviepy.video.fx.MaskColor 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.MasksAnd.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.MasksAnd 5 | ========================= 6 | 7 | 8 | .. automodule:: moviepy.video.fx.MasksAnd 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.MasksOr.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.MasksOr 5 | ======================== 6 | 7 | 8 | .. automodule:: moviepy.video.fx.MasksOr 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.MirrorX.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.MirrorX 5 | ======================== 6 | 7 | 8 | .. automodule:: moviepy.video.fx.MirrorX 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.MirrorY.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.MirrorY 5 | ======================== 6 | 7 | 8 | .. automodule:: moviepy.video.fx.MirrorY 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.MultiplyColor.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.MultiplyColor 5 | ============================== 6 | 7 | 8 | .. automodule:: moviepy.video.fx.MultiplyColor 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.MultiplySpeed.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.MultiplySpeed 5 | ============================== 6 | 7 | 8 | .. automodule:: moviepy.video.fx.MultiplySpeed 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.Painting.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.Painting 5 | ========================= 6 | 7 | 8 | .. automodule:: moviepy.video.fx.Painting 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.Resize.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.Resize 5 | ======================= 6 | 7 | 8 | .. automodule:: moviepy.video.fx.Resize 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.Rotate.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.Rotate 5 | ======================= 6 | 7 | 8 | .. automodule:: moviepy.video.fx.Rotate 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.Scroll.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.Scroll 5 | ======================= 6 | 7 | 8 | .. automodule:: moviepy.video.fx.Scroll 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.SlideIn.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.SlideIn 5 | ======================== 6 | 7 | 8 | .. automodule:: moviepy.video.fx.SlideIn 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.SlideOut.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.SlideOut 5 | ========================= 6 | 7 | 8 | .. automodule:: moviepy.video.fx.SlideOut 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.SuperSample.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.SuperSample 5 | ============================ 6 | 7 | 8 | .. automodule:: moviepy.video.fx.SuperSample 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.TimeMirror.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.TimeMirror 5 | =========================== 6 | 7 | 8 | .. automodule:: moviepy.video.fx.TimeMirror 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.fx.TimeSymmetrize.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.fx.TimeSymmetrize 5 | =============================== 6 | 7 | 8 | .. automodule:: moviepy.video.fx.TimeSymmetrize 9 | :inherited-members: 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.ImageSequenceClip.ImageSequenceClip.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.io.ImageSequenceClip.ImageSequenceClip 5 | ==================================================== 6 | 7 | .. currentmodule:: moviepy.video.io.ImageSequenceClip 8 | 9 | .. autoclass:: ImageSequenceClip 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.ImageSequenceClip.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.io.ImageSequenceClip 5 | ================================== 6 | 7 | 8 | .. automodule:: moviepy.video.io.ImageSequenceClip 9 | 10 | 11 | 12 | 13 | 14 | .. rubric:: Classes 15 | 16 | .. autosummary:: 17 | :toctree: 18 | :template: custom_autosummary/class.rst 19 | 20 | ImageSequenceClip 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.VideoFileClip.VideoFileClip.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.io.VideoFileClip.VideoFileClip 5 | ============================================ 6 | 7 | .. currentmodule:: moviepy.video.io.VideoFileClip 8 | 9 | .. autoclass:: VideoFileClip 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.VideoFileClip.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.io.VideoFileClip 5 | ============================== 6 | 7 | 8 | .. automodule:: moviepy.video.io.VideoFileClip 9 | 10 | 11 | 12 | 13 | 14 | .. rubric:: Classes 15 | 16 | .. autosummary:: 17 | :toctree: 18 | :template: custom_autosummary/class.rst 19 | 20 | VideoFileClip 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.display_in_notebook.HTML2.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.io.display\_in\_notebook.HTML2 5 | ============================================ 6 | 7 | .. currentmodule:: moviepy.video.io.display_in_notebook 8 | 9 | .. autoclass:: HTML2 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.display_in_notebook.display_in_notebook.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.io.display\_in\_notebook.display\_in\_notebook 2 | ============================================================ 3 | 4 | .. currentmodule:: moviepy.video.io.display_in_notebook 5 | 6 | .. autofunction:: display_in_notebook -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.display_in_notebook.html_embed.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.io.display\_in\_notebook.html\_embed 2 | ================================================== 3 | 4 | .. currentmodule:: moviepy.video.io.display_in_notebook 5 | 6 | .. autofunction:: html_embed -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.display_in_notebook.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.io.display\_in\_notebook 5 | ====================================== 6 | 7 | 8 | .. automodule:: moviepy.video.io.display_in_notebook 9 | 10 | 11 | 12 | 13 | 14 | .. rubric:: Classes 15 | 16 | .. autosummary:: 17 | :toctree: 18 | :template: custom_autosummary/class.rst 19 | 20 | HTML2 21 | 22 | 23 | 24 | 25 | 26 | 27 | .. rubric:: Functions 28 | 29 | .. autosummary:: 30 | :toctree: 31 | 32 | display_in_notebook 33 | html_embed 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.ffmpeg_reader.FFMPEG_VideoReader.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.io.ffmpeg\_reader.FFMPEG\_VideoReader 5 | =================================================== 6 | 7 | .. currentmodule:: moviepy.video.io.ffmpeg_reader 8 | 9 | .. autoclass:: FFMPEG_VideoReader 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.ffmpeg_reader.FFmpegInfosParser.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.io.ffmpeg\_reader.FFmpegInfosParser 5 | ================================================= 6 | 7 | .. currentmodule:: moviepy.video.io.ffmpeg_reader 8 | 9 | .. autoclass:: FFmpegInfosParser 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.ffmpeg_reader.ffmpeg_parse_infos.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.io.ffmpeg\_reader.ffmpeg\_parse\_infos 2 | ==================================================== 3 | 4 | .. currentmodule:: moviepy.video.io.ffmpeg_reader 5 | 6 | .. autofunction:: ffmpeg_parse_infos -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.ffmpeg_reader.ffmpeg_read_image.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.io.ffmpeg\_reader.ffmpeg\_read\_image 2 | =================================================== 3 | 4 | .. currentmodule:: moviepy.video.io.ffmpeg_reader 5 | 6 | .. autofunction:: ffmpeg_read_image -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.ffmpeg_reader.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.io.ffmpeg\_reader 5 | =============================== 6 | 7 | 8 | .. automodule:: moviepy.video.io.ffmpeg_reader 9 | 10 | 11 | 12 | 13 | 14 | .. rubric:: Classes 15 | 16 | .. autosummary:: 17 | :toctree: 18 | :template: custom_autosummary/class.rst 19 | 20 | FFMPEG_VideoReader 21 | FFmpegInfosParser 22 | 23 | 24 | 25 | 26 | 27 | 28 | .. rubric:: Functions 29 | 30 | .. autosummary:: 31 | :toctree: 32 | 33 | ffmpeg_parse_infos 34 | ffmpeg_read_image 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.ffmpeg_tools.ffmpeg_extract_audio.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.io.ffmpeg\_tools.ffmpeg\_extract\_audio 2 | ===================================================== 3 | 4 | .. currentmodule:: moviepy.video.io.ffmpeg_tools 5 | 6 | .. autofunction:: ffmpeg_extract_audio -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.ffmpeg_tools.ffmpeg_extract_subclip.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.io.ffmpeg\_tools.ffmpeg\_extract\_subclip 2 | ======================================================= 3 | 4 | .. currentmodule:: moviepy.video.io.ffmpeg_tools 5 | 6 | .. autofunction:: ffmpeg_extract_subclip -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.ffmpeg_tools.ffmpeg_merge_video_audio.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.io.ffmpeg\_tools.ffmpeg\_merge\_video\_audio 2 | ========================================================== 3 | 4 | .. currentmodule:: moviepy.video.io.ffmpeg_tools 5 | 6 | .. autofunction:: ffmpeg_merge_video_audio -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.ffmpeg_tools.ffmpeg_resize.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.io.ffmpeg\_tools.ffmpeg\_resize 2 | ============================================= 3 | 4 | .. currentmodule:: moviepy.video.io.ffmpeg_tools 5 | 6 | .. autofunction:: ffmpeg_resize -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.ffmpeg_tools.ffmpeg_stabilize_video.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.io.ffmpeg\_tools.ffmpeg\_stabilize\_video 2 | ======================================================= 3 | 4 | .. currentmodule:: moviepy.video.io.ffmpeg_tools 5 | 6 | .. autofunction:: ffmpeg_stabilize_video -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.ffmpeg_tools.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.io.ffmpeg\_tools 5 | ============================== 6 | 7 | 8 | .. automodule:: moviepy.video.io.ffmpeg_tools 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | .. rubric:: Functions 20 | 21 | .. autosummary:: 22 | :toctree: 23 | 24 | ffmpeg_extract_audio 25 | ffmpeg_extract_subclip 26 | ffmpeg_merge_video_audio 27 | ffmpeg_resize 28 | ffmpeg_stabilize_video 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.ffmpeg_writer.FFMPEG_VideoWriter.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.io.ffmpeg\_writer.FFMPEG\_VideoWriter 5 | =================================================== 6 | 7 | .. currentmodule:: moviepy.video.io.ffmpeg_writer 8 | 9 | .. autoclass:: FFMPEG_VideoWriter 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.ffmpeg_writer.ffmpeg_write_image.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.io.ffmpeg\_writer.ffmpeg\_write\_image 2 | ==================================================== 3 | 4 | .. currentmodule:: moviepy.video.io.ffmpeg_writer 5 | 6 | .. autofunction:: ffmpeg_write_image -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.ffmpeg_writer.ffmpeg_write_video.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.io.ffmpeg\_writer.ffmpeg\_write\_video 2 | ==================================================== 3 | 4 | .. currentmodule:: moviepy.video.io.ffmpeg_writer 5 | 6 | .. autofunction:: ffmpeg_write_video -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.ffmpeg_writer.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.io.ffmpeg\_writer 5 | =============================== 6 | 7 | 8 | .. automodule:: moviepy.video.io.ffmpeg_writer 9 | 10 | 11 | 12 | 13 | 14 | .. rubric:: Classes 15 | 16 | .. autosummary:: 17 | :toctree: 18 | :template: custom_autosummary/class.rst 19 | 20 | FFMPEG_VideoWriter 21 | 22 | 23 | 24 | 25 | 26 | 27 | .. rubric:: Functions 28 | 29 | .. autosummary:: 30 | :toctree: 31 | 32 | ffmpeg_write_image 33 | ffmpeg_write_video 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.ffplay_previewer.FFPLAY_VideoPreviewer.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.io.ffplay\_previewer.FFPLAY\_VideoPreviewer 5 | ========================================================= 6 | 7 | .. currentmodule:: moviepy.video.io.ffplay_previewer 8 | 9 | .. autoclass:: FFPLAY_VideoPreviewer 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.ffplay_previewer.ffplay_preview_video.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.io.ffplay\_previewer.ffplay\_preview\_video 2 | ========================================================= 3 | 4 | .. currentmodule:: moviepy.video.io.ffplay_previewer 5 | 6 | .. autofunction:: ffplay_preview_video -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.ffplay_previewer.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.io.ffplay\_previewer 5 | ================================== 6 | 7 | 8 | .. automodule:: moviepy.video.io.ffplay_previewer 9 | 10 | 11 | 12 | 13 | 14 | .. rubric:: Classes 15 | 16 | .. autosummary:: 17 | :toctree: 18 | :template: custom_autosummary/class.rst 19 | 20 | FFPLAY_VideoPreviewer 21 | 22 | 23 | 24 | 25 | 26 | 27 | .. rubric:: Functions 28 | 29 | .. autosummary:: 30 | :toctree: 31 | 32 | ffplay_preview_video 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.gif_writers.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.io.gif\_writers 5 | ============================= 6 | 7 | 8 | .. automodule:: moviepy.video.io.gif_writers 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | .. rubric:: Functions 20 | 21 | .. autosummary:: 22 | :toctree: 23 | 24 | write_gif_with_imageio 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.gif_writers.write_gif_with_imageio.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.io.gif\_writers.write\_gif\_with\_imageio 2 | ======================================================= 3 | 4 | .. currentmodule:: moviepy.video.io.gif_writers 5 | 6 | .. autofunction:: write_gif_with_imageio -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.io.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.io 5 | ================ 6 | 7 | 8 | .. automodule:: moviepy.video.io 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | .. rubric:: Modules 29 | 30 | .. autosummary:: 31 | :toctree: 32 | :template: custom_autosummary/module.rst 33 | :recursive: 34 | 35 | 36 | moviepy.video.io.ImageSequenceClip 37 | 38 | 39 | moviepy.video.io.VideoFileClip 40 | 41 | 42 | moviepy.video.io.display_in_notebook 43 | 44 | 45 | moviepy.video.io.ffmpeg_reader 46 | 47 | 48 | moviepy.video.io.ffmpeg_tools 49 | 50 | 51 | moviepy.video.io.ffmpeg_writer 52 | 53 | 54 | moviepy.video.io.ffplay_previewer 55 | 56 | 57 | moviepy.video.io.gif_writers 58 | 59 | 60 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video 5 | ============= 6 | 7 | 8 | .. automodule:: moviepy.video 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | .. rubric:: Modules 29 | 30 | .. autosummary:: 31 | :toctree: 32 | :template: custom_autosummary/module.rst 33 | :recursive: 34 | 35 | 36 | moviepy.video.VideoClip 37 | 38 | 39 | moviepy.video.compositing 40 | 41 | 42 | moviepy.video.fx 43 | 44 | 45 | moviepy.video.io 46 | 47 | 48 | moviepy.video.tools 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.tools.credits.CreditsClip.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.tools.credits.CreditsClip 5 | ======================================= 6 | 7 | .. currentmodule:: moviepy.video.tools.credits 8 | 9 | .. autoclass:: CreditsClip 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.tools.credits.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.tools.credits 5 | =========================== 6 | 7 | 8 | .. automodule:: moviepy.video.tools.credits 9 | 10 | 11 | 12 | 13 | 14 | .. rubric:: Classes 15 | 16 | .. autosummary:: 17 | :toctree: 18 | :template: custom_autosummary/class.rst 19 | 20 | CreditsClip 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.tools.cuts.FramesMatch.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.tools.cuts.FramesMatch 5 | ==================================== 6 | 7 | .. currentmodule:: moviepy.video.tools.cuts 8 | 9 | .. autoclass:: FramesMatch 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.tools.cuts.FramesMatches.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.tools.cuts.FramesMatches 5 | ====================================== 6 | 7 | .. currentmodule:: moviepy.video.tools.cuts 8 | 9 | .. autoclass:: FramesMatches 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.tools.cuts.detect_scenes.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.tools.cuts.detect\_scenes 2 | ======================================= 3 | 4 | .. currentmodule:: moviepy.video.tools.cuts 5 | 6 | .. autofunction:: detect_scenes -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.tools.cuts.find_video_period.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.tools.cuts.find\_video\_period 2 | ============================================ 3 | 4 | .. currentmodule:: moviepy.video.tools.cuts 5 | 6 | .. autofunction:: find_video_period -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.tools.cuts.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.tools.cuts 5 | ======================== 6 | 7 | 8 | .. automodule:: moviepy.video.tools.cuts 9 | 10 | 11 | 12 | 13 | 14 | .. rubric:: Classes 15 | 16 | .. autosummary:: 17 | :toctree: 18 | :template: custom_autosummary/class.rst 19 | 20 | FramesMatch 21 | FramesMatches 22 | 23 | 24 | 25 | 26 | 27 | 28 | .. rubric:: Functions 29 | 30 | .. autosummary:: 31 | :toctree: 32 | 33 | detect_scenes 34 | find_video_period 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.tools.drawing.blit.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.tools.drawing.blit 2 | ================================ 3 | 4 | .. currentmodule:: moviepy.video.tools.drawing 5 | 6 | .. autofunction:: blit -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.tools.drawing.circle.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.tools.drawing.circle 2 | ================================== 3 | 4 | .. currentmodule:: moviepy.video.tools.drawing 5 | 6 | .. autofunction:: circle -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.tools.drawing.color_gradient.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.tools.drawing.color\_gradient 2 | =========================================== 3 | 4 | .. currentmodule:: moviepy.video.tools.drawing 5 | 6 | .. autofunction:: color_gradient -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.tools.drawing.color_split.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.tools.drawing.color\_split 2 | ======================================== 3 | 4 | .. currentmodule:: moviepy.video.tools.drawing 5 | 6 | .. autofunction:: color_split -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.tools.drawing.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.tools.drawing 5 | =========================== 6 | 7 | 8 | .. automodule:: moviepy.video.tools.drawing 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | .. rubric:: Functions 20 | 21 | .. autosummary:: 22 | :toctree: 23 | 24 | blit 25 | circle 26 | color_gradient 27 | color_split 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.tools.interpolators.Interpolator.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.tools.interpolators.Interpolator 5 | ============================================== 6 | 7 | .. currentmodule:: moviepy.video.tools.interpolators 8 | 9 | .. autoclass:: Interpolator 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.tools.interpolators.Trajectory.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.tools.interpolators.Trajectory 5 | ============================================ 6 | 7 | .. currentmodule:: moviepy.video.tools.interpolators 8 | 9 | .. autoclass:: Trajectory 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.tools.interpolators.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.tools.interpolators 5 | ================================= 6 | 7 | 8 | .. automodule:: moviepy.video.tools.interpolators 9 | 10 | 11 | 12 | 13 | 14 | .. rubric:: Classes 15 | 16 | .. autosummary:: 17 | :toctree: 18 | :template: custom_autosummary/class.rst 19 | 20 | Interpolator 21 | Trajectory 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.tools.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.tools 5 | =================== 6 | 7 | 8 | .. automodule:: moviepy.video.tools 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | .. rubric:: Modules 29 | 30 | .. autosummary:: 31 | :toctree: 32 | :template: custom_autosummary/module.rst 33 | :recursive: 34 | 35 | 36 | moviepy.video.tools.credits 37 | 38 | 39 | moviepy.video.tools.cuts 40 | 41 | 42 | moviepy.video.tools.drawing 43 | 44 | 45 | moviepy.video.tools.interpolators 46 | 47 | 48 | moviepy.video.tools.subtitles 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.tools.subtitles.SubtitlesClip.rst: -------------------------------------------------------------------------------- 1 | .. custom class to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.tools.subtitles.SubtitlesClip 5 | =========================================== 6 | 7 | .. currentmodule:: moviepy.video.tools.subtitles 8 | 9 | .. autoclass:: SubtitlesClip 10 | :members: 11 | 12 | -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.tools.subtitles.file_to_subtitles.rst: -------------------------------------------------------------------------------- 1 | moviepy.video.tools.subtitles.file\_to\_subtitles 2 | ================================================= 3 | 4 | .. currentmodule:: moviepy.video.tools.subtitles 5 | 6 | .. autofunction:: file_to_subtitles -------------------------------------------------------------------------------- /docs/reference/reference/moviepy.video.tools.subtitles.rst: -------------------------------------------------------------------------------- 1 | .. custom module to enable complete documentation of every function 2 | see https://stackoverflow.com/a/62613202 3 | 4 | moviepy.video.tools.subtitles 5 | ============================= 6 | 7 | 8 | .. automodule:: moviepy.video.tools.subtitles 9 | 10 | 11 | 12 | 13 | 14 | .. rubric:: Classes 15 | 16 | .. autosummary:: 17 | :toctree: 18 | :template: custom_autosummary/class.rst 19 | 20 | SubtitlesClip 21 | 22 | 23 | 24 | 25 | 26 | 27 | .. rubric:: Functions 28 | 29 | .. autosummary:: 30 | :toctree: 31 | 32 | file_to_subtitles 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /docs/user_guide/index.rst: -------------------------------------------------------------------------------- 1 | .. _user_guide: 2 | 3 | 4 | The MoviePy User Guide 5 | ------------------------------ 6 | 7 | The User Guide covers all of MoviePy's main concepts grouped by tasks (loading, editing, composing, rendering), with a presentation of the different concept/elements relative to the tasks along with short code example. 8 | 9 | It is a good place for users wishing to understand more precisely one of these aspects and to discover the different MoviePy elements relative to it. 10 | 11 | For users wanting to have a quick overview of how to use MoviePy, a better place to start is the :ref:`getting_started` section, and more specifically the :ref:`moviepy_10_minutes` tutorial. 12 | 13 | For a full overview of MoviePy, see the :ref:`reference_manual`. 14 | 15 | .. toctree:: 16 | :maxdepth: 1 17 | 18 | loading 19 | modifying 20 | create_effects 21 | compositing 22 | rendering 23 | -------------------------------------------------------------------------------- /examples/soundtrack.py: -------------------------------------------------------------------------------- 1 | """A simple test script on how to put a soundtrack to a movie.""" 2 | 3 | from moviepy import * 4 | 5 | 6 | # We load a movie and replace the sound with some music: 7 | 8 | movie = VideoFileClip("../../videos/dam.mov").with_audio( 9 | AudioFileClip("../../sounds/startars.ogg") 10 | ) 11 | 12 | 13 | # If the soundtrack is longer than the movie, then at the end of the clip 14 | # it will freeze on the last frame and wait for the clip to finish. 15 | # If you don't want that, uncomment the next line: 16 | 17 | # ~ movie.audio = movie.audio.with_duration(movie.duration) 18 | 19 | movie.write_videofile("../../test_soundtrack.avi", codec="mpeg4") 20 | -------------------------------------------------------------------------------- /media/-video-with-dash-.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/-video-with-dash-.mp4 -------------------------------------------------------------------------------- /media/afterimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/afterimage.png -------------------------------------------------------------------------------- /media/big_buck_bunny_0_30.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/big_buck_bunny_0_30.webm -------------------------------------------------------------------------------- /media/big_buck_bunny_432_433.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/big_buck_bunny_432_433.webm -------------------------------------------------------------------------------- /media/bitmap.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/bitmap.mp4 -------------------------------------------------------------------------------- /media/chaplin.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/chaplin.mp4 -------------------------------------------------------------------------------- /media/crunching.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/crunching.mp3 -------------------------------------------------------------------------------- /media/doc_medias/example.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example.mp4 -------------------------------------------------------------------------------- /media/doc_medias/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example.png -------------------------------------------------------------------------------- /media/doc_medias/example.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example.ttf -------------------------------------------------------------------------------- /media/doc_medias/example.txt: -------------------------------------------------------------------------------- 1 | Lorem ipsum 2 | -------------------------------------------------------------------------------- /media/doc_medias/example.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example.wav -------------------------------------------------------------------------------- /media/doc_medias/example2.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example2.mp4 -------------------------------------------------------------------------------- /media/doc_medias/example2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example2.png -------------------------------------------------------------------------------- /media/doc_medias/example2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example2.wav -------------------------------------------------------------------------------- /media/doc_medias/example3.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example3.mp4 -------------------------------------------------------------------------------- /media/doc_medias/example3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example3.png -------------------------------------------------------------------------------- /media/doc_medias/example3.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example3.wav -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0001.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0002.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0003.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0004.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0005.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0006.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0006.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0007.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0007.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0008.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0008.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0009.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0009.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0010.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0010.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0011.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0011.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0012.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0012.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0013.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0013.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0014.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0014.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0015.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0015.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0016.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0016.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0017.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0017.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0018.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0018.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0019.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0019.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0020.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0020.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0021.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0021.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0022.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0022.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0023.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0023.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0024.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0024.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_img_dir/image_0025.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_img_dir/image_0025.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_mask.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_mask.jpg -------------------------------------------------------------------------------- /media/doc_medias/example_mask.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/example_mask.mp4 -------------------------------------------------------------------------------- /media/doc_medias/long_examples/example.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/long_examples/example.mp4 -------------------------------------------------------------------------------- /media/doc_medias/long_examples/example.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/long_examples/example.wav -------------------------------------------------------------------------------- /media/doc_medias/long_examples/example2.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/long_examples/example2.mp4 -------------------------------------------------------------------------------- /media/doc_medias/long_examples/example2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/long_examples/example2.wav -------------------------------------------------------------------------------- /media/doc_medias/long_examples/example3.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/long_examples/example3.mp4 -------------------------------------------------------------------------------- /media/doc_medias/long_examples/example3.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/long_examples/example3.wav -------------------------------------------------------------------------------- /media/doc_medias/result.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/result.mp4 -------------------------------------------------------------------------------- /media/doc_medias/result.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/doc_medias/result.webm -------------------------------------------------------------------------------- /media/fire2.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/fire2.mp4 -------------------------------------------------------------------------------- /media/matplotlib_demo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/matplotlib_demo1.png -------------------------------------------------------------------------------- /media/pigs_in_a_polka.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/pigs_in_a_polka.gif -------------------------------------------------------------------------------- /media/python_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/python_logo.png -------------------------------------------------------------------------------- /media/python_logo_upside_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/python_logo_upside_down.png -------------------------------------------------------------------------------- /media/rain.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/rain.mp3 -------------------------------------------------------------------------------- /media/rotated-90-degrees.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/rotated-90-degrees.mp4 -------------------------------------------------------------------------------- /media/sintel_with_14_chapters.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/sintel_with_14_chapters.mp4 -------------------------------------------------------------------------------- /media/smpte-2997.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/smpte-2997.mp4 -------------------------------------------------------------------------------- /media/subtitles-unicode.srt: -------------------------------------------------------------------------------- 1 | 0 2 | 00:00:00,000 --> 00:00:05,000 3 | ÁÉíöÙ 4 | 5 | -------------------------------------------------------------------------------- /media/subtitles.srt: -------------------------------------------------------------------------------- 1 | 0 2 | 00:00:00,000 --> 00:00:01,000 3 | Red! 4 | 5 | 1 6 | 00:00:02,000 --> 00:00:03,500 7 | More Red! 8 | 9 | 2 10 | 00:00:5,000 --> 00:00:6,000 11 | Green! 12 | 13 | 3 14 | 00:00:7,000 --> 00:00:8,000 15 | Blue 16 | 17 | 4 18 | 00:00:9,000 --> 00:00:10,000 19 | More Blue! 20 | 21 | -------------------------------------------------------------------------------- /media/test_video.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/test_video.mp4 -------------------------------------------------------------------------------- /media/traj.txt: -------------------------------------------------------------------------------- 1 | # t(ms) x y 2 | 0 547 104 3 | 1000 210 78 4 | 2000 280 85 5 | 3000 337 93 6 | 4000 354 78 7 | 5000 381 68 8 | 6000 382 67 9 | 7000 382 67 10 | 8000 372 64 11 | 9000 372 65 12 | -------------------------------------------------------------------------------- /media/transparent.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/transparent.webm -------------------------------------------------------------------------------- /media/vacation_2017.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/vacation_2017.jpg -------------------------------------------------------------------------------- /media/video_with_failing_audio.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/video_with_failing_audio.mp4 -------------------------------------------------------------------------------- /media/with-attached-pic.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/media/with-attached-pic.mp3 -------------------------------------------------------------------------------- /moviepy/Effect.py: -------------------------------------------------------------------------------- 1 | """Defines the base class for all effects in MoviePy.""" 2 | 3 | import copy as _copy 4 | from abc import ABCMeta, abstractmethod 5 | 6 | from moviepy.Clip import Clip 7 | 8 | 9 | class Effect(metaclass=ABCMeta): 10 | """Base abstract class for all effects in MoviePy. 11 | Any new effect have to extend this base class. 12 | """ 13 | 14 | def copy(self): 15 | """Return a shallow copy of an Effect. 16 | 17 | You must *always* copy an ``Effect`` before applying, 18 | because some of them will modify their own attributes when applied. 19 | For example, setting a previously unset property by using target clip property. 20 | 21 | If we was to use the original effect, calling the same effect multiple times 22 | could lead to different properties, and different results for equivalent clips. 23 | 24 | By using copy, we ensure we can use the same effect object multiple times while 25 | maintaining the same behavior/result. 26 | 27 | In a way, copy makes the effect himself being kind of idempotent. 28 | """ 29 | return _copy.copy(self) 30 | 31 | @abstractmethod 32 | def apply(self, clip: Clip) -> Clip: 33 | """Apply the current effect on a clip 34 | 35 | Parameters 36 | ---------- 37 | clip 38 | The target clip to apply the effect on. 39 | (Internally, MoviePy will always pass a copy of the original clip) 40 | 41 | """ 42 | pass 43 | -------------------------------------------------------------------------------- /moviepy/__init__.py: -------------------------------------------------------------------------------- 1 | """Imports everything that you need from the MoviePy submodules so that every thing 2 | can be directly imported with ``from moviepy import *``. 3 | """ 4 | 5 | from moviepy.audio import fx as afx 6 | from moviepy.audio.AudioClip import ( 7 | AudioArrayClip, 8 | AudioClip, 9 | CompositeAudioClip, 10 | concatenate_audioclips, 11 | ) 12 | from moviepy.audio.io.AudioFileClip import AudioFileClip 13 | from moviepy.Effect import Effect 14 | from moviepy.tools import convert_to_seconds 15 | from moviepy.version import __version__ 16 | from moviepy.video import fx as vfx, tools as videotools 17 | from moviepy.video.compositing.CompositeVideoClip import ( 18 | CompositeVideoClip, 19 | clips_array, 20 | concatenate_videoclips, 21 | ) 22 | from moviepy.video.io import ffmpeg_tools 23 | from moviepy.video.io.display_in_notebook import display_in_notebook 24 | from moviepy.video.io.ImageSequenceClip import ImageSequenceClip 25 | from moviepy.video.io.VideoFileClip import VideoFileClip 26 | from moviepy.video.VideoClip import ( 27 | BitmapClip, 28 | ColorClip, 29 | DataVideoClip, 30 | ImageClip, 31 | TextClip, 32 | UpdatedVideoClip, 33 | VideoClip, 34 | ) 35 | 36 | 37 | # Add display in notebook to video and audioclip 38 | VideoClip.display_in_notebook = display_in_notebook 39 | AudioClip.display_in_notebook = display_in_notebook 40 | 41 | 42 | # Importing with `from moviepy import *` will only import these names 43 | __all__ = [ 44 | "__version__", 45 | "VideoClip", 46 | "DataVideoClip", 47 | "UpdatedVideoClip", 48 | "ImageClip", 49 | "ColorClip", 50 | "TextClip", 51 | "BitmapClip", 52 | "VideoFileClip", 53 | "CompositeVideoClip", 54 | "clips_array", 55 | "ImageSequenceClip", 56 | "concatenate_videoclips", 57 | "AudioClip", 58 | "AudioArrayClip", 59 | "CompositeAudioClip", 60 | "concatenate_audioclips", 61 | "AudioFileClip", 62 | "Effect", 63 | "vfx", 64 | "afx", 65 | "videotools", 66 | "ffmpeg_tools", 67 | "convert_to_seconds", 68 | ] 69 | -------------------------------------------------------------------------------- /moviepy/audio/__init__.py: -------------------------------------------------------------------------------- 1 | """Everything about audio manipulation.""" 2 | -------------------------------------------------------------------------------- /moviepy/audio/fx/AudioFadeIn.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import numpy as np 4 | 5 | from moviepy.Clip import Clip 6 | from moviepy.decorators import audio_video_effect 7 | from moviepy.Effect import Effect 8 | from moviepy.tools import convert_to_seconds 9 | 10 | 11 | @dataclass 12 | class AudioFadeIn(Effect): 13 | """Return an audio (or video) clip that is first mute, then the 14 | sound arrives progressively over ``duration`` seconds. 15 | 16 | Parameters 17 | ---------- 18 | 19 | duration : float 20 | How long does it take for the sound to return to its normal level. 21 | 22 | Examples 23 | -------- 24 | 25 | .. code:: python 26 | 27 | clip = VideoFileClip("media/chaplin.mp4") 28 | clip.with_effects([afx.AudioFadeIn("00:00:06")]) 29 | """ 30 | 31 | duration: float 32 | 33 | def __post_init__(self): 34 | self.duration = convert_to_seconds(self.duration) 35 | 36 | def _mono_factor_getter(self): 37 | return lambda t, duration: np.minimum(t / duration, 1) 38 | 39 | def _stereo_factor_getter(self, nchannels): 40 | def getter(t, duration): 41 | factor = np.minimum(t / duration, 1) 42 | return np.array([factor for _ in range(nchannels)]).T 43 | 44 | return getter 45 | 46 | @audio_video_effect 47 | def apply(self, clip: Clip) -> Clip: 48 | """Apply the effect to the clip.""" 49 | if clip.duration is None: 50 | raise ValueError("Attribute 'duration' not set") 51 | 52 | get_factor = ( 53 | self._mono_factor_getter() 54 | if clip.nchannels == 1 55 | else self._stereo_factor_getter(clip.nchannels) 56 | ) 57 | 58 | return clip.transform( 59 | lambda get_frame, t: get_factor(t, self.duration) * get_frame(t), 60 | ) 61 | -------------------------------------------------------------------------------- /moviepy/audio/fx/AudioFadeOut.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import numpy as np 4 | 5 | from moviepy.Clip import Clip 6 | from moviepy.decorators import audio_video_effect 7 | from moviepy.Effect import Effect 8 | from moviepy.tools import convert_to_seconds 9 | 10 | 11 | @dataclass 12 | class AudioFadeOut(Effect): 13 | """Return a sound clip where the sound fades out progressively 14 | over ``duration`` seconds at the end of the clip. 15 | 16 | Parameters 17 | ---------- 18 | 19 | duration : float 20 | How long does it take for the sound to reach the zero level at the end 21 | of the clip. 22 | 23 | Examples 24 | -------- 25 | 26 | .. code:: python 27 | 28 | clip = VideoFileClip("media/chaplin.mp4") 29 | clip.with_effects([afx.AudioFadeOut("00:00:06")]) 30 | """ 31 | 32 | duration: float 33 | 34 | def __post_init__(self): 35 | self.duration = convert_to_seconds(self.duration) 36 | 37 | def _mono_factor_getter(self, clip_duration): 38 | return lambda t, duration: np.minimum(1.0 * (clip_duration - t) / duration, 1) 39 | 40 | def _stereo_factor_getter(self, clip_duration, nchannels): 41 | def getter(t, duration): 42 | factor = np.minimum(1.0 * (clip_duration - t) / duration, 1) 43 | return np.array([factor for _ in range(nchannels)]).T 44 | 45 | return getter 46 | 47 | @audio_video_effect 48 | def apply(self, clip: Clip) -> Clip: 49 | """Apply the effect to the clip.""" 50 | if clip.duration is None: 51 | raise ValueError("Attribute 'duration' not set") 52 | 53 | get_factor = ( 54 | self._mono_factor_getter(clip.duration) 55 | if clip.nchannels == 1 56 | else self._stereo_factor_getter(clip.duration, clip.nchannels) 57 | ) 58 | 59 | return clip.transform( 60 | lambda get_frame, t: get_factor(t, self.duration) * get_frame(t), 61 | keep_duration=True, 62 | ) 63 | -------------------------------------------------------------------------------- /moviepy/audio/fx/AudioLoop.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | from moviepy.audio.AudioClip import concatenate_audioclips 4 | from moviepy.Clip import Clip 5 | from moviepy.decorators import audio_video_effect 6 | from moviepy.Effect import Effect 7 | 8 | 9 | @dataclass 10 | class AudioLoop(Effect): 11 | """Loops over an audio clip. 12 | 13 | Returns an audio clip that plays the given clip either 14 | `n_loops` times, or during `duration` seconds. 15 | 16 | Examples 17 | -------- 18 | 19 | .. code:: python 20 | 21 | from moviepy import * 22 | videoclip = VideoFileClip('myvideo.mp4') 23 | music = AudioFileClip('music.ogg') 24 | audio = music.with_effects([afx.AudioLoop(duration=videoclip.duration)]) 25 | videoclip.with_audio(audio) 26 | 27 | """ 28 | 29 | n_loops: int = None 30 | duration: float = None 31 | 32 | @audio_video_effect 33 | def apply(self, clip: Clip) -> Clip: 34 | """Apply the effect to the clip.""" 35 | if self.duration is not None: 36 | self.n_loops = int(self.duration / clip.duration) + 1 37 | return concatenate_audioclips(self.n_loops * [clip]).with_duration( 38 | self.duration 39 | ) 40 | 41 | return concatenate_audioclips(self.n_loops * [clip]) 42 | -------------------------------------------------------------------------------- /moviepy/audio/fx/AudioNormalize.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | from moviepy.audio.fx.MultiplyVolume import MultiplyVolume 4 | from moviepy.Clip import Clip 5 | from moviepy.decorators import audio_video_effect 6 | from moviepy.Effect import Effect 7 | 8 | 9 | @dataclass 10 | class AudioNormalize(Effect): 11 | """Return a clip whose volume is normalized to 0db. 12 | 13 | Return an audio (or video) clip whose audio volume is normalized 14 | so that the maximum volume is at 0db, the maximum achievable volume. 15 | 16 | Examples 17 | -------- 18 | 19 | >>> from moviepy import * 20 | >>> videoclip = VideoFileClip('myvideo.mp4').with_effects([afx.AudioNormalize()]) 21 | 22 | """ 23 | 24 | @audio_video_effect 25 | def apply(self, clip: Clip) -> Clip: 26 | """Apply the effect to the clip.""" 27 | max_volume = clip.max_volume() 28 | if max_volume == 0: 29 | return clip 30 | else: 31 | return clip.with_effects([MultiplyVolume(1 / max_volume)]) 32 | -------------------------------------------------------------------------------- /moviepy/audio/fx/MultiplyStereoVolume.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | from moviepy.Clip import Clip 4 | from moviepy.decorators import audio_video_effect 5 | from moviepy.Effect import Effect 6 | 7 | 8 | @dataclass 9 | class MultiplyStereoVolume(Effect): 10 | """For a stereo audioclip, this function enables to change the volume 11 | of the left and right channel separately (with the factors `left` 12 | and `right`). Makes a stereo audio clip in which the volume of left 13 | and right is controllable. 14 | 15 | Examples 16 | -------- 17 | 18 | .. code:: python 19 | 20 | from moviepy import AudioFileClip 21 | music = AudioFileClip('music.ogg') 22 | # mutes left channel 23 | audio_r = music.with_effects([afx.MultiplyStereoVolume(left=0, right=1)]) 24 | # halves audio volume 25 | audio_h = music.with_effects([afx.MultiplyStereoVolume(left=0.5, right=0.5)]) 26 | """ 27 | 28 | left: float = 1 29 | right: float = 1 30 | 31 | @audio_video_effect 32 | def apply(self, clip: Clip) -> Clip: 33 | """Apply the effect to the clip.""" 34 | 35 | def stereo_volume(get_frame, t): 36 | frame = get_frame(t) 37 | if len(frame) == 1: # mono 38 | frame *= self.left if self.left is not None else self.right 39 | else: # stereo, stereo surround... 40 | for i in range(len(frame[0])): # odd channels are left 41 | frame[:, i] *= self.left if i % 2 == 0 else self.right 42 | return frame 43 | 44 | return clip.transform(stereo_volume) 45 | -------------------------------------------------------------------------------- /moviepy/audio/fx/__init__.py: -------------------------------------------------------------------------------- 1 | """All the audio effects that can be applied to AudioClip and VideoClip.""" 2 | 3 | # import every video fx function 4 | 5 | from moviepy.audio.fx.AudioDelay import AudioDelay 6 | from moviepy.audio.fx.AudioFadeIn import AudioFadeIn 7 | from moviepy.audio.fx.AudioFadeOut import AudioFadeOut 8 | from moviepy.audio.fx.AudioLoop import AudioLoop 9 | from moviepy.audio.fx.AudioNormalize import AudioNormalize 10 | from moviepy.audio.fx.MultiplyStereoVolume import MultiplyStereoVolume 11 | from moviepy.audio.fx.MultiplyVolume import MultiplyVolume 12 | 13 | 14 | __all__ = ( 15 | "AudioDelay", 16 | "AudioFadeIn", 17 | "AudioFadeOut", 18 | "AudioLoop", 19 | "AudioNormalize", 20 | "MultiplyStereoVolume", 21 | "MultiplyVolume", 22 | ) 23 | -------------------------------------------------------------------------------- /moviepy/audio/io/__init__.py: -------------------------------------------------------------------------------- 1 | """Class and methods to read, write, preview audiofiles.""" 2 | -------------------------------------------------------------------------------- /moviepy/audio/tools/__init__.py: -------------------------------------------------------------------------------- 1 | """Tools to better processing and edition of audio.""" 2 | -------------------------------------------------------------------------------- /moviepy/audio/tools/cuts.py: -------------------------------------------------------------------------------- 1 | """Cutting utilities working with audio.""" 2 | 3 | import numpy as np 4 | 5 | 6 | def find_audio_period(clip, min_time=0.1, max_time=2, time_resolution=0.01): 7 | """Finds the period, in seconds of an audioclip. 8 | 9 | Parameters 10 | ---------- 11 | 12 | min_time : float, optional 13 | Minimum bound for the returned value. 14 | 15 | max_time : float, optional 16 | Maximum bound for the returned value. 17 | 18 | time_resolution : float, optional 19 | Numerical precision. 20 | """ 21 | chunksize = int(time_resolution * clip.fps) 22 | chunk_duration = 1.0 * chunksize / clip.fps 23 | # v denotes the list of volumes 24 | v = np.array([(chunk**2).sum() for chunk in clip.iter_chunks(chunksize)]) 25 | v = v - v.mean() 26 | corrs = np.correlate(v, v, mode="full")[-len(v) :] 27 | corrs[: int(min_time / chunk_duration)] = 0 28 | corrs[int(max_time / chunk_duration) :] = 0 29 | return chunk_duration * np.argmax(corrs) 30 | -------------------------------------------------------------------------------- /moviepy/version.py: -------------------------------------------------------------------------------- 1 | __version__ = "2.1.2" 2 | -------------------------------------------------------------------------------- /moviepy/video/__init__.py: -------------------------------------------------------------------------------- 1 | """Everything about video manipulation.""" 2 | -------------------------------------------------------------------------------- /moviepy/video/compositing/__init__.py: -------------------------------------------------------------------------------- 1 | """All for compositing video clips.""" 2 | -------------------------------------------------------------------------------- /moviepy/video/fx/BlackAndWhite.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import numpy as np 4 | 5 | from moviepy.Effect import Effect 6 | 7 | 8 | @dataclass 9 | class BlackAndWhite(Effect): 10 | """Desaturates the picture, makes it black and white. 11 | Parameter RGB allows to set weights for the different color 12 | channels. 13 | If RBG is 'CRT_phosphor' a special set of values is used. 14 | preserve_luminosity maintains the sum of RGB to 1. 15 | """ 16 | 17 | RGB: str = None 18 | preserve_luminosity: bool = True 19 | 20 | def apply(self, clip): 21 | """Apply the effect to the clip.""" 22 | if self.RGB is None: 23 | self.RGB = [1, 1, 1] 24 | 25 | if self.RGB == "CRT_phosphor": 26 | self.RGB = [0.2125, 0.7154, 0.0721] 27 | 28 | R, G, B = ( 29 | 1.0 30 | * np.array(self.RGB) 31 | / (sum(self.RGB) if self.preserve_luminosity else 1) 32 | ) 33 | 34 | def filter(im): 35 | im = R * im[:, :, 0] + G * im[:, :, 1] + B * im[:, :, 2] 36 | return np.dstack(3 * [im]).astype("uint8") 37 | 38 | return clip.image_transform(filter) 39 | -------------------------------------------------------------------------------- /moviepy/video/fx/Blink.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | from moviepy.Effect import Effect 4 | 5 | 6 | @dataclass 7 | class Blink(Effect): 8 | """ 9 | Makes the clip blink. At each blink it will be displayed ``duration_on`` 10 | seconds and disappear ``duration_off`` seconds. Will only work in 11 | composite clips. 12 | """ 13 | 14 | duration_on: float 15 | duration_off: float 16 | 17 | def apply(self, clip): 18 | """Apply the effect to the clip.""" 19 | if clip.mask is None: 20 | clip = clip.with_mask() 21 | 22 | duration = self.duration_on + self.duration_off 23 | clip.mask = clip.mask.transform( 24 | lambda get_frame, t: get_frame(t) * ((t % duration) < self.duration_on) 25 | ) 26 | 27 | return clip 28 | -------------------------------------------------------------------------------- /moviepy/video/fx/CrossFadeIn.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | from moviepy.Clip import Clip 4 | from moviepy.Effect import Effect 5 | from moviepy.video.fx.FadeIn import FadeIn 6 | 7 | 8 | @dataclass 9 | class CrossFadeIn(Effect): 10 | """Makes the clip appear progressively, over ``duration`` seconds. 11 | Only works when the clip is included in a CompositeVideoClip. 12 | """ 13 | 14 | duration: float 15 | 16 | def apply(self, clip: Clip) -> Clip: 17 | """Apply the effect to the clip.""" 18 | if clip.duration is None: 19 | raise ValueError("Attribute 'duration' not set") 20 | 21 | if clip.mask is None: 22 | clip = clip.with_mask() 23 | 24 | clip.mask.duration = clip.duration 25 | clip.mask = clip.mask.with_effects([FadeIn(self.duration)]) 26 | 27 | return clip 28 | -------------------------------------------------------------------------------- /moviepy/video/fx/CrossFadeOut.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | from moviepy.Clip import Clip 4 | from moviepy.Effect import Effect 5 | from moviepy.video.fx.FadeOut import FadeOut 6 | 7 | 8 | @dataclass 9 | class CrossFadeOut(Effect): 10 | """Makes the clip disappear progressively, over ``duration`` seconds. 11 | Only works when the clip is included in a CompositeVideoClip. 12 | """ 13 | 14 | duration: float 15 | 16 | def apply(self, clip: Clip) -> Clip: 17 | """Apply the effect to the clip.""" 18 | if clip.duration is None: 19 | raise ValueError("Attribute 'duration' not set") 20 | 21 | if clip.mask is None: 22 | clip = clip.with_mask() 23 | 24 | clip.mask.duration = clip.duration 25 | clip.mask = clip.mask.with_effects([FadeOut(self.duration)]) 26 | 27 | return clip 28 | -------------------------------------------------------------------------------- /moviepy/video/fx/EvenSize.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | from moviepy.Clip import Clip 4 | from moviepy.Effect import Effect 5 | 6 | 7 | @dataclass 8 | class EvenSize(Effect): 9 | """Crops the clip to make dimensions even.""" 10 | 11 | def apply(self, clip: Clip) -> Clip: 12 | """Apply the effect to the clip.""" 13 | w, h = clip.size 14 | w_even = w % 2 == 0 15 | h_even = h % 2 == 0 16 | if w_even and h_even: 17 | return clip 18 | 19 | if not w_even and not h_even: 20 | 21 | def image_filter(a): 22 | return a[:-1, :-1, :] 23 | 24 | elif h_even: 25 | 26 | def image_filter(a): 27 | return a[:, :-1, :] 28 | 29 | else: 30 | 31 | def image_filter(a): 32 | return a[:-1, :, :] 33 | 34 | return clip.image_transform(image_filter, apply_to=["mask"]) 35 | -------------------------------------------------------------------------------- /moviepy/video/fx/FadeIn.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import numpy as np 4 | 5 | from moviepy.Clip import Clip 6 | from moviepy.Effect import Effect 7 | 8 | 9 | @dataclass 10 | class FadeIn(Effect): 11 | """Makes the clip progressively appear from some color (black by default), 12 | over ``duration`` seconds at the beginning of the clip. Can be used for 13 | masks too, where the initial color must be a number between 0 and 1. 14 | 15 | For cross-fading (progressive appearance or disappearance of a clip 16 | over another clip, see ``CrossFadeIn`` 17 | """ 18 | 19 | duration: float 20 | initial_color: list = None 21 | 22 | def apply(self, clip: Clip) -> Clip: 23 | """Apply the effect to the clip.""" 24 | if self.initial_color is None: 25 | self.initial_color = 0 if clip.is_mask else [0, 0, 0] 26 | 27 | self.initial_color = np.array(self.initial_color) 28 | 29 | def filter(get_frame, t): 30 | if t >= self.duration: 31 | return get_frame(t) 32 | else: 33 | fading = 1.0 * t / self.duration 34 | return fading * get_frame(t) + (1 - fading) * self.initial_color 35 | 36 | return clip.transform(filter) 37 | -------------------------------------------------------------------------------- /moviepy/video/fx/FadeOut.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import numpy as np 4 | 5 | from moviepy.Clip import Clip 6 | from moviepy.Effect import Effect 7 | 8 | 9 | @dataclass 10 | class FadeOut(Effect): 11 | """Makes the clip progressively fade to some color (black by default), 12 | over ``duration`` seconds at the end of the clip. Can be used for masks too, 13 | where the final color must be a number between 0 and 1. 14 | 15 | For cross-fading (progressive appearance or disappearance of a clip over another 16 | clip), see ``CrossFadeOut`` 17 | """ 18 | 19 | duration: float 20 | final_color: list = None 21 | 22 | def apply(self, clip: Clip) -> Clip: 23 | """Apply the effect to the clip.""" 24 | if clip.duration is None: 25 | raise ValueError("Attribute 'duration' not set") 26 | 27 | if self.final_color is None: 28 | self.final_color = 0 if clip.is_mask else [0, 0, 0] 29 | 30 | self.final_color = np.array(self.final_color) 31 | 32 | def filter(get_frame, t): 33 | if (clip.duration - t) >= self.duration: 34 | return get_frame(t) 35 | else: 36 | fading = 1.0 * (clip.duration - t) / self.duration 37 | return fading * get_frame(t) + (1 - fading) * self.final_color 38 | 39 | return clip.transform(filter) 40 | -------------------------------------------------------------------------------- /moviepy/video/fx/GammaCorrection.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | from moviepy.Clip import Clip 4 | from moviepy.Effect import Effect 5 | 6 | 7 | @dataclass 8 | class GammaCorrection(Effect): 9 | """Gamma-correction of a video clip.""" 10 | 11 | gamma: float 12 | 13 | def apply(self, clip: Clip) -> Clip: 14 | """Apply the effect to the clip.""" 15 | 16 | def filter(im): 17 | corrected = 255 * (1.0 * im / 255) ** self.gamma 18 | return corrected.astype("uint8") 19 | 20 | return clip.image_transform(filter) 21 | -------------------------------------------------------------------------------- /moviepy/video/fx/HeadBlur.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import numpy as np 4 | from PIL import Image, ImageDraw, ImageFilter 5 | 6 | from moviepy.Clip import Clip 7 | from moviepy.Effect import Effect 8 | 9 | 10 | @dataclass 11 | class HeadBlur(Effect): 12 | """Returns a filter that will blur a moving part (a head ?) of the frames. 13 | 14 | The position of the blur at time t is defined by (fx(t), fy(t)), the radius 15 | of the blurring by ``radius`` and the intensity of the blurring by ``intensity``. 16 | """ 17 | 18 | fx: callable 19 | fy: callable 20 | radius: float 21 | intensity: float = None 22 | 23 | def apply(self, clip: Clip) -> Clip: 24 | """Apply the effect to the clip.""" 25 | if self.intensity is None: 26 | self.intensity = int(2 * self.radius / 3) 27 | 28 | def filter(gf, t): 29 | im = gf(t).copy() 30 | h, w, d = im.shape 31 | x, y = int(self.fx(t)), int(self.fy(t)) 32 | x1, x2 = max(0, x - self.radius), min(x + self.radius, w) 33 | y1, y2 = max(0, y - self.radius), min(y + self.radius, h) 34 | 35 | image = Image.fromarray(im) 36 | mask = Image.new("RGB", image.size) 37 | draw = ImageDraw.Draw(mask) 38 | draw.ellipse([x1, y1, x2, y2], fill=(255, 255, 255)) 39 | 40 | blurred = image.filter(ImageFilter.GaussianBlur(radius=self.intensity)) 41 | 42 | res = np.where(np.array(mask) > 0, np.array(blurred), np.array(image)) 43 | return res 44 | 45 | return clip.transform(filter) 46 | -------------------------------------------------------------------------------- /moviepy/video/fx/InvertColors.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | from moviepy.Clip import Clip 4 | from moviepy.Effect import Effect 5 | 6 | 7 | @dataclass 8 | class InvertColors(Effect): 9 | """Returns the color-inversed clip. 10 | 11 | The values of all pixels are replaced with (255-v) or (1-v) for masks 12 | Black becomes white, green becomes purple, etc. 13 | """ 14 | 15 | def apply(self, clip: Clip) -> Clip: 16 | """Apply the effect to the clip.""" 17 | maxi = 1.0 if clip.is_mask else 255 18 | return clip.image_transform(lambda f: maxi - f) 19 | -------------------------------------------------------------------------------- /moviepy/video/fx/Loop.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | from moviepy.Clip import Clip 4 | from moviepy.Effect import Effect 5 | 6 | 7 | @dataclass 8 | class Loop(Effect): 9 | """ 10 | Returns a clip that plays the current clip in an infinite loop. 11 | Ideal for clips coming from GIFs. 12 | 13 | Parameters 14 | ---------- 15 | 16 | n 17 | Number of times the clip should be played. If `None` the 18 | the clip will loop indefinitely (i.e. with no set duration). 19 | 20 | duration 21 | Total duration of the clip. Can be specified instead of n. 22 | """ 23 | 24 | n: int = None 25 | duration: float = None 26 | 27 | def apply(self, clip: Clip) -> Clip: 28 | """Apply the effect to the clip.""" 29 | if clip.duration is None: 30 | raise ValueError("Attribute 'duration' not set") 31 | 32 | previous_duration = clip.duration 33 | clip = clip.time_transform( 34 | lambda t: t % previous_duration, apply_to=["mask", "audio"] 35 | ) 36 | 37 | if self.n: 38 | self.duration = self.n * previous_duration 39 | 40 | if self.duration: 41 | clip = clip.with_duration(self.duration) 42 | 43 | return clip 44 | -------------------------------------------------------------------------------- /moviepy/video/fx/LumContrast.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | from moviepy.Clip import Clip 4 | from moviepy.Effect import Effect 5 | 6 | 7 | @dataclass 8 | class LumContrast(Effect): 9 | """Luminosity-contrast correction of a clip.""" 10 | 11 | lum: float = 0 12 | contrast: float = 0 13 | contrast_threshold: float = 127 14 | 15 | def apply(self, clip: Clip) -> Clip: 16 | """Apply the effect to the clip.""" 17 | 18 | def image_filter(im): 19 | im = 1.0 * im # float conversion 20 | corrected = ( 21 | im + self.lum + self.contrast * (im - float(self.contrast_threshold)) 22 | ) 23 | corrected[corrected < 0] = 0 24 | corrected[corrected > 255] = 255 25 | return corrected.astype("uint8") 26 | 27 | return clip.image_transform(image_filter) 28 | -------------------------------------------------------------------------------- /moviepy/video/fx/MakeLoopable.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | from moviepy.Clip import Clip 4 | from moviepy.Effect import Effect 5 | from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip 6 | from moviepy.video.fx.CrossFadeIn import CrossFadeIn 7 | 8 | 9 | @dataclass 10 | class MakeLoopable(Effect): 11 | """Makes the clip fade in progressively at its own end, this way it can be 12 | looped indefinitely. 13 | 14 | Parameters 15 | ---------- 16 | 17 | overlap_duration : float 18 | Duration of the fade-in (in seconds). 19 | """ 20 | 21 | overlap_duration: float 22 | 23 | def apply(self, clip: Clip) -> Clip: 24 | """Apply the effect to the clip.""" 25 | clip2 = clip.with_effects([CrossFadeIn(self.overlap_duration)]).with_start( 26 | clip.duration - self.overlap_duration 27 | ) 28 | return CompositeVideoClip([clip, clip2]).subclipped( 29 | self.overlap_duration, clip.duration 30 | ) 31 | -------------------------------------------------------------------------------- /moviepy/video/fx/MaskColor.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import numpy as np 4 | 5 | from moviepy.Clip import Clip 6 | from moviepy.Effect import Effect 7 | 8 | 9 | @dataclass 10 | class MaskColor(Effect): 11 | """Returns a new clip with a mask for transparency where the original 12 | clip is of the given color. 13 | 14 | You can also have a "progressive" mask by specifying a non-null distance 15 | threshold ``threshold``. In this case, if the distance between a pixel and 16 | the given color is d, the transparency will be 17 | 18 | d**stiffness / (threshold**stiffness + d**stiffness) 19 | 20 | which is 1 when d>>threshold and 0 for d< Clip: 29 | """Apply the effect to the clip.""" 30 | color = np.array(self.color) 31 | 32 | def hill(x): 33 | if self.threshold: 34 | return x**self.stiffness / ( 35 | self.threshold**self.stiffness + x**self.stiffness 36 | ) 37 | else: 38 | return 1.0 * (x != 0) 39 | 40 | def flim(im): 41 | return hill(np.sqrt(((im - color) ** 2).sum(axis=2))) 42 | 43 | mask = clip.image_transform(flim) 44 | mask.is_mask = True 45 | return clip.with_mask(mask) 46 | -------------------------------------------------------------------------------- /moviepy/video/fx/MasksAnd.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | from typing import Union 3 | 4 | import numpy as np 5 | 6 | from moviepy.Clip import Clip 7 | from moviepy.Effect import Effect 8 | from moviepy.video.VideoClip import ImageClip 9 | 10 | 11 | @dataclass 12 | class MasksAnd(Effect): 13 | """Returns the logical 'and' (minimum pixel color values) between two masks. 14 | 15 | The result has the duration of the clip to which has been applied, if it has any. 16 | 17 | Parameters 18 | ---------- 19 | 20 | other_clip ImageClip or np.ndarray 21 | Clip used to mask the original clip. 22 | 23 | Examples 24 | -------- 25 | 26 | .. code:: python 27 | 28 | clip = ColorClip(color=(255, 0, 0), size=(1, 1)) # red 29 | mask = ColorClip(color=(0, 255, 0), size=(1, 1)) # green 30 | masked_clip = clip.with_effects([vfx.MasksAnd(mask)]) # black 31 | masked_clip.get_frame(0) 32 | [[[0 0 0]]] 33 | """ 34 | 35 | other_clip: Union[Clip, np.ndarray] 36 | 37 | def apply(self, clip: Clip) -> Clip: 38 | """Apply the effect to the clip.""" 39 | # to ensure that 'and' of two ImageClips will be an ImageClip 40 | if isinstance(self.other_clip, ImageClip): 41 | self.other_clip = self.other_clip.img 42 | 43 | if isinstance(self.other_clip, np.ndarray): 44 | return clip.image_transform( 45 | lambda frame: np.minimum(frame, self.other_clip) 46 | ) 47 | else: 48 | return clip.transform( 49 | lambda get_frame, t: np.minimum( 50 | get_frame(t), self.other_clip.get_frame(t) 51 | ) 52 | ) 53 | -------------------------------------------------------------------------------- /moviepy/video/fx/MasksOr.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | from typing import Union 3 | 4 | import numpy as np 5 | 6 | from moviepy.Clip import Clip 7 | from moviepy.Effect import Effect 8 | from moviepy.video.VideoClip import ImageClip 9 | 10 | 11 | @dataclass 12 | class MasksOr(Effect): 13 | """Returns the logical 'or' (maximum pixel color values) between two masks. 14 | 15 | The result has the duration of the clip to which has been applied, if it has any. 16 | 17 | Parameters 18 | ---------- 19 | 20 | other_clip ImageClip or np.ndarray 21 | Clip used to mask the original clip. 22 | 23 | Examples 24 | -------- 25 | 26 | .. code:: python 27 | 28 | clip = ColorClip(color=(255, 0, 0), size=(1, 1)) # red 29 | mask = ColorClip(color=(0, 255, 0), size=(1, 1)) # green 30 | masked_clip = clip.with_effects([vfx.MasksOr(mask)]) # yellow 31 | masked_clip.get_frame(0) 32 | [[[255 255 0]]] 33 | """ 34 | 35 | other_clip: Union[Clip, np.ndarray] 36 | 37 | def apply(self, clip: Clip) -> Clip: 38 | """Apply the effect to the clip.""" 39 | # to ensure that 'or' of two ImageClips will be an ImageClip 40 | if isinstance(self.other_clip, ImageClip): 41 | self.other_clip = self.other_clip.img 42 | 43 | if isinstance(self.other_clip, np.ndarray): 44 | return clip.image_transform( 45 | lambda frame: np.maximum(frame, self.other_clip) 46 | ) 47 | else: 48 | return clip.transform( 49 | lambda get_frame, t: np.maximum( 50 | get_frame(t), self.other_clip.get_frame(t) 51 | ) 52 | ) 53 | -------------------------------------------------------------------------------- /moviepy/video/fx/MirrorX.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | from typing import List, Union 3 | 4 | from moviepy.Clip import Clip 5 | from moviepy.Effect import Effect 6 | 7 | 8 | @dataclass 9 | class MirrorX(Effect): 10 | """Flips the clip horizontally (and its mask too, by default).""" 11 | 12 | apply_to: Union[List, str] = "mask" 13 | 14 | def apply(self, clip: Clip) -> Clip: 15 | """Apply the effect to the clip.""" 16 | return clip.image_transform(lambda img: img[:, ::-1], apply_to=self.apply_to) 17 | -------------------------------------------------------------------------------- /moviepy/video/fx/MirrorY.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | from typing import List, Union 3 | 4 | from moviepy.Clip import Clip 5 | from moviepy.Effect import Effect 6 | 7 | 8 | @dataclass 9 | class MirrorY(Effect): 10 | """Flips the clip vertically (and its mask too, by default).""" 11 | 12 | apply_to: Union[List, str] = "mask" 13 | 14 | def apply(self, clip: Clip) -> Clip: 15 | """Apply the effect to the clip.""" 16 | return clip.image_transform(lambda img: img[::-1], apply_to=self.apply_to) 17 | -------------------------------------------------------------------------------- /moviepy/video/fx/MultiplyColor.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import numpy as np 4 | 5 | from moviepy.Clip import Clip 6 | from moviepy.Effect import Effect 7 | 8 | 9 | @dataclass 10 | class MultiplyColor(Effect): 11 | """ 12 | Multiplies the clip's colors by the given factor, can be used 13 | to decrease or increase the clip's brightness (is that the 14 | right word ?) 15 | """ 16 | 17 | factor: float 18 | 19 | def apply(self, clip: Clip) -> Clip: 20 | """Apply the effect to the clip.""" 21 | return clip.image_transform( 22 | lambda frame: np.minimum(255, (self.factor * frame)).astype("uint8") 23 | ) 24 | -------------------------------------------------------------------------------- /moviepy/video/fx/MultiplySpeed.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | from moviepy.Clip import Clip 4 | from moviepy.Effect import Effect 5 | 6 | 7 | @dataclass 8 | class MultiplySpeed(Effect): 9 | """Returns a clip playing the current clip but at a speed multiplied by ``factor``. 10 | 11 | Instead of factor one can indicate the desired ``final_duration`` of the clip, and 12 | the factor will be automatically computed. The same effect is applied to the clip's 13 | audio and mask if any. 14 | """ 15 | 16 | factor: float = None 17 | final_duration: float = None 18 | 19 | def apply(self, clip: Clip) -> Clip: 20 | """Apply the effect to the clip.""" 21 | if self.final_duration: 22 | self.factor = 1.0 * clip.duration / self.final_duration 23 | 24 | new_clip = clip.time_transform( 25 | lambda t: self.factor * t, apply_to=["mask", "audio"] 26 | ) 27 | 28 | if clip.duration is not None: 29 | new_clip = new_clip.with_duration(1.0 * clip.duration / self.factor) 30 | 31 | return new_clip 32 | -------------------------------------------------------------------------------- /moviepy/video/fx/Scroll.py: -------------------------------------------------------------------------------- 1 | from moviepy.Effect import Effect 2 | 3 | 4 | class Scroll(Effect): 5 | """Effect that scrolls horizontally or vertically a clip, e.g. to make end credits 6 | 7 | Parameters 8 | ---------- 9 | w, h 10 | The width and height of the final clip. Default to clip.w and clip.h 11 | 12 | x_speed, y_speed 13 | The speed of the scroll in the x and y directions. 14 | 15 | x_start, y_start 16 | The starting position of the scroll in the x and y directions. 17 | 18 | 19 | apply_to 20 | Whether to apply the effect to the mask too. 21 | """ 22 | 23 | def __init__( 24 | self, 25 | w=None, 26 | h=None, 27 | x_speed=0, 28 | y_speed=0, 29 | x_start=0, 30 | y_start=0, 31 | apply_to="mask", 32 | ): 33 | self.w = w 34 | self.h = h 35 | self.x_speed = x_speed 36 | self.y_speed = y_speed 37 | self.x_start = x_start 38 | self.y_start = y_start 39 | self.apply_to = apply_to 40 | 41 | def apply(self, clip): 42 | """Apply the effect to the clip.""" 43 | if self.h is None: 44 | self.h = clip.h 45 | 46 | if self.w is None: 47 | self.w = clip.w 48 | 49 | x_max = self.w - 1 50 | y_max = self.h - 1 51 | 52 | def filter(get_frame, t): 53 | x = int(max(0, min(x_max, self.x_start + round(self.x_speed * t)))) 54 | y = int(max(0, min(y_max, self.y_start + round(self.y_speed * t)))) 55 | return get_frame(t)[y : y + self.h, x : x + self.w] 56 | 57 | return clip.transform(filter, apply_to=self.apply_to) 58 | -------------------------------------------------------------------------------- /moviepy/video/fx/SlideIn.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | from moviepy.Clip import Clip 4 | from moviepy.Effect import Effect 5 | 6 | 7 | @dataclass 8 | class SlideIn(Effect): 9 | """Makes the clip arrive from one side of the screen. 10 | 11 | Only works when the clip is included in a CompositeVideoClip, 12 | and if the clip has the same size as the whole composition. 13 | 14 | Parameters 15 | ---------- 16 | 17 | clip : moviepy.Clip.Clip 18 | A video clip. 19 | 20 | duration : float 21 | Time taken for the clip to be fully visible 22 | 23 | side : str 24 | Side of the screen where the clip comes from. One of 25 | 'top', 'bottom', 'left' or 'right'. 26 | 27 | Examples 28 | -------- 29 | 30 | .. code:: python 31 | 32 | from moviepy import * 33 | 34 | clips = [... make a list of clips] 35 | slided_clips = [ 36 | CompositeVideoClip([clip.with_effects([vfx.SlideIn(1, "left")])]) 37 | for clip in clips 38 | ] 39 | final_clip = concatenate_videoclips(slided_clips, padding=-1) 40 | 41 | clip = ColorClip( 42 | color=(255, 0, 0), duration=1, size=(300, 300) 43 | ).with_fps(60) 44 | final_clip = CompositeVideoClip([clip.with_effects([vfx.SlideIn(1, "right")])]) 45 | """ 46 | 47 | duration: float 48 | side: str 49 | 50 | def apply(self, clip: Clip) -> Clip: 51 | """Apply the effect to the clip.""" 52 | w, h = clip.size 53 | pos_dict = { 54 | "left": lambda t: (min(0, w * (t / self.duration - 1)), "center"), 55 | "right": lambda t: (max(0, w * (1 - t / self.duration)), "center"), 56 | "top": lambda t: ("center", min(0, h * (t / self.duration - 1))), 57 | "bottom": lambda t: ("center", max(0, h * (1 - t / self.duration))), 58 | } 59 | 60 | return clip.with_position(pos_dict[self.side]) 61 | -------------------------------------------------------------------------------- /moviepy/video/fx/SuperSample.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import numpy as np 4 | 5 | from moviepy.Clip import Clip 6 | from moviepy.Effect import Effect 7 | 8 | 9 | @dataclass 10 | class SuperSample(Effect): 11 | """Replaces each frame at time t by the mean of `n_frames` equally spaced frames 12 | taken in the interval [t-d, t+d]. This results in motion blur. 13 | """ 14 | 15 | d: float 16 | n_frames: int 17 | 18 | def apply(self, clip: Clip) -> Clip: 19 | """Apply the effect to the clip.""" 20 | 21 | def filter(get_frame, t): 22 | timings = np.linspace(t - self.d, t + self.d, self.n_frames) 23 | frame_average = np.mean( 24 | 1.0 * np.array([get_frame(t_) for t_ in timings], dtype="uint16"), 25 | axis=0, 26 | ) 27 | return frame_average.astype("uint8") 28 | 29 | return clip.transform(filter) 30 | -------------------------------------------------------------------------------- /moviepy/video/fx/TimeMirror.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | from moviepy.Clip import Clip 4 | from moviepy.Effect import Effect 5 | 6 | 7 | @dataclass 8 | class TimeMirror(Effect): 9 | """ 10 | Returns a clip that plays the current clip backwards. 11 | The clip must have its ``duration`` attribute set. 12 | The same effect is applied to the clip's audio and mask if any. 13 | """ 14 | 15 | def apply(self, clip: Clip) -> Clip: 16 | """Apply the effect to the clip.""" 17 | if clip.duration is None: 18 | raise ValueError("Attribute 'duration' not set") 19 | 20 | return clip[::-1] 21 | -------------------------------------------------------------------------------- /moviepy/video/fx/TimeSymmetrize.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | from moviepy.Clip import Clip 4 | from moviepy.Effect import Effect 5 | 6 | 7 | @dataclass 8 | class TimeSymmetrize(Effect): 9 | """ 10 | Returns a clip that plays the current clip once forwards and 11 | then once backwards. This is very practival to make video that 12 | loop well, e.g. to create animated GIFs. 13 | This effect is automatically applied to the clip's mask and audio 14 | if they exist. 15 | """ 16 | 17 | def apply(self, clip: Clip) -> Clip: 18 | """Apply the effect to the clip.""" 19 | if clip.duration is None: 20 | raise ValueError("Attribute 'duration' not set") 21 | 22 | return clip + clip[::-1] 23 | -------------------------------------------------------------------------------- /moviepy/video/io/__init__.py: -------------------------------------------------------------------------------- 1 | """Classes and methods for reading, writing and previewing video files.""" 2 | -------------------------------------------------------------------------------- /moviepy/video/io/gif_writers.py: -------------------------------------------------------------------------------- 1 | """MoviePy video GIFs writing.""" 2 | 3 | import imageio.v3 as iio 4 | import proglog 5 | 6 | from moviepy.decorators import requires_duration, use_clip_fps_by_default 7 | 8 | 9 | @requires_duration 10 | @use_clip_fps_by_default 11 | def write_gif_with_imageio(clip, filename, fps=None, loop=0, logger="bar"): 12 | """Writes the gif with the Python library ImageIO (calls FreeImage).""" 13 | logger = proglog.default_bar_logger(logger) 14 | 15 | with iio.imopen(filename, "w", plugin="pillow") as writer: 16 | logger(message="MoviePy - Building file %s with imageio." % filename) 17 | for frame in clip.iter_frames(fps=fps, logger=logger, dtype="uint8"): 18 | writer.write( 19 | frame, duration=1000 / fps, loop=loop 20 | ) # Duration is in ms not s 21 | -------------------------------------------------------------------------------- /moviepy/video/tools/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/moviepy/video/tools/__init__.py -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=42", "wheel"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "moviepy" 7 | version = "2.2.1" 8 | description = "Video editing with Python" 9 | readme = "README.md" 10 | license = { text = "MIT License" } 11 | authors = [{ name = "Zulko 2024" }] 12 | keywords = ["video", "editing", "audio", "compositing", "ffmpeg"] 13 | classifiers = [ 14 | "Development Status :: 5 - Production/Stable", 15 | "Intended Audience :: Developers", 16 | "Natural Language :: English", 17 | "License :: OSI Approved :: MIT License", 18 | "Programming Language :: Python", 19 | "Programming Language :: Python :: 3.9", 20 | "Programming Language :: Python :: 3.10", 21 | "Programming Language :: Python :: 3.11", 22 | "Topic :: Multimedia", 23 | "Topic :: Multimedia :: Sound/Audio", 24 | "Topic :: Multimedia :: Sound/Audio :: Analysis", 25 | "Topic :: Multimedia :: Video", 26 | "Topic :: Multimedia :: Video :: Capture", 27 | "Topic :: Multimedia :: Video :: Conversion", 28 | ] 29 | dependencies = [ 30 | "decorator>=4.0.2,<6.0", 31 | "imageio>=2.5,<3.0", 32 | "imageio_ffmpeg>=0.2.0", 33 | "numpy>=1.25.0", 34 | "proglog<=1.0.0", 35 | "python-dotenv>=0.10", 36 | "pillow>=9.2.0,<12.0", 37 | ] 38 | 39 | [project.optional-dependencies] 40 | doc = [ 41 | "numpydoc<2.0", 42 | "Sphinx==6.*", 43 | "pydata-sphinx-theme==0.13", 44 | "sphinx_design", 45 | ] 46 | test = [ 47 | "coveralls>=3.0,<4.0", 48 | "pytest-cov>=2.5.1,<3.0", 49 | "pytest>=3.0.0,<7.0.0", 50 | ] 51 | lint = [ 52 | "black>=23.7.0", 53 | "flake8>=6.0.0", 54 | "flake8-absolute-import>=1.0", 55 | "flake8-docstrings>=1.7.0", 56 | "flake8-rst-docstrings>=0.3", 57 | "flake8-implicit-str-concat==0.4.0", 58 | "isort>=5.12", 59 | "pre-commit>=3.3", 60 | ] 61 | 62 | [tool.setuptools.packages.find] 63 | include = ["moviepy*"] 64 | exclude = ["media", "tests", "docs"] 65 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 88 3 | extend-ignore = 4 | # Black compatibility 5 | E203, 6 | W503, 7 | # allow lambda expressions 8 | E731, 9 | # don't require docstrings for public packages 10 | D104, 11 | # don't require docstrings for magic methods 12 | D105, 13 | # don't require summary and description in docstrings 14 | D205, 15 | # allow first line of docstrings not ending in period (too much limited) 16 | D400, 17 | # allow first line of docstrings being not imperative (too much intrusive) 18 | D401, 19 | # allow blank lines between section headers and their content in docstrings 20 | D412, 21 | # allow composed `__all__` statements 22 | RST902, 23 | # allow 'from moviepy import *' in editor.py 24 | F403, F405 25 | per-file-ignores = 26 | # allow imports not placed at the top of the file 27 | # allow 'from moviepy import *' in editor.py 28 | moviepy/editor.py: E402, F403, F405 29 | # the version file doesn't require module docstring 30 | moviepy/version.py: D100 31 | # FX modules don't require module docstring 32 | moviepy/audio/fx/*.py: D100 33 | moviepy/video/fx/*.py: D100 34 | # tests doesn't require docstring (although is recommended) 35 | tests/*.py: D101,D102,D103 36 | # examples don't require module docstring 37 | # allow 'from moviepy import *' in examples 38 | examples/*.py: D100, F403, F405 39 | docstring-convention = numpy 40 | 41 | # Complexity should be decreased before uncomment: 42 | #max-complexity = 10 43 | 44 | [isort] 45 | profile = black 46 | lines_after_imports = 2 47 | combine_as_imports = True 48 | py_version = 39 49 | known_tests_third_party = pytest 50 | sections = STDLIB,THIRDPARTY,TESTS_THIRD_PARTY,FIRSTPARTY,LOCALFOLDER 51 | 52 | [coverage:report] 53 | exclude_lines = 54 | pragma: no cover 55 | -------------------------------------------------------------------------------- /tests/README.rst: -------------------------------------------------------------------------------- 1 | Install testing dependencies: `pip install moviepy[test]` 2 | 3 | Run tests: `pytest` 4 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zulko/moviepy/f515b100e1fd069da6f29d5b01b1d42b52d8068d/tests/__init__.py -------------------------------------------------------------------------------- /tests/test_BitmapClip.py: -------------------------------------------------------------------------------- 1 | """BitmapClip tests.""" 2 | 3 | import numpy as np 4 | 5 | import pytest 6 | 7 | from moviepy.video.VideoClip import BitmapClip 8 | 9 | 10 | def test_clip_generation(): 11 | bitmap = [["RR", "RR"], ["RB", "RB"]] 12 | expected_frame_array = np.array( 13 | [ 14 | np.array([[(255, 0, 0), (255, 0, 0)], [(255, 0, 0), (255, 0, 0)]]), 15 | np.array([[(255, 0, 0), (0, 0, 255)], [(255, 0, 0), (0, 0, 255)]]), 16 | ] 17 | ) 18 | unexpected_frame_array = np.array( 19 | [ 20 | np.array([[(255, 0, 0), (255, 0, 0)], [(255, 0, 0), (255, 0, 1)]]), 21 | np.array([[(255, 0, 0), (0, 0, 255)], [(255, 0, 0), (0, 0, 255)]]), 22 | ] 23 | ) 24 | 25 | clip = BitmapClip(bitmap, fps=1) 26 | frame_array = np.array(list(clip.iter_frames())) 27 | 28 | # Check that frame_list == expected_frame_list 29 | assert np.array_equal(frame_array, expected_frame_array) 30 | 31 | # Check that frame_list != unexpected_frame_list 32 | assert not np.array_equal(frame_array, unexpected_frame_array) 33 | 34 | 35 | def test_setting_fps(): 36 | bitmap = [["R"], ["R"], ["B"], ["B"], ["G"], ["G"]] 37 | clip = BitmapClip(bitmap, fps=1) 38 | 39 | assert clip.fps == 1 40 | assert clip.duration == 6 41 | 42 | 43 | def test_setting_duration(): 44 | bitmap = [["R"], ["R"], ["B"], ["B"], ["G"], ["G"]] 45 | clip = BitmapClip(bitmap, duration=6) 46 | 47 | assert clip.fps == 1 48 | assert clip.duration == 6 49 | 50 | 51 | def test_to_bitmap(): 52 | bitmap = [["R"], ["R"], ["B"], ["B"], ["G"], ["G"]] 53 | clip1 = BitmapClip(bitmap, fps=0.345) 54 | clip2 = BitmapClip(bitmap, fps=1) 55 | clip3 = BitmapClip(bitmap, fps=3.12345) 56 | assert bitmap == clip1.to_bitmap() 57 | assert bitmap == clip2.to_bitmap() 58 | assert bitmap == clip3.to_bitmap() 59 | 60 | 61 | if __name__ == "__main__": 62 | pytest.main() 63 | -------------------------------------------------------------------------------- /tests/test_ImageSequenceClip.py: -------------------------------------------------------------------------------- 1 | """Image sequencing clip tests meant to be run with pytest.""" 2 | 3 | import os 4 | 5 | import pytest 6 | 7 | from moviepy.video.io.ImageSequenceClip import ImageSequenceClip 8 | 9 | 10 | def test_1(util): 11 | images = [] 12 | durations = [] 13 | 14 | for i in range(5): 15 | durations.append(i) 16 | images.append("media/python_logo.png") 17 | durations.append(i) 18 | images.append("media/python_logo_upside_down.png") 19 | 20 | with ImageSequenceClip(images, durations=durations) as clip: 21 | assert clip.duration == sum(durations) 22 | clip.write_videofile( 23 | os.path.join(util.TMP_DIR, "ImageSequenceClip1.mp4"), fps=30, logger=None 24 | ) 25 | 26 | 27 | def test_2(): 28 | images = [] 29 | durations = [] 30 | 31 | durations.append(1) 32 | images.append("media/python_logo.png") 33 | durations.append(2) 34 | images.append("media/matplotlib_demo1.png") 35 | 36 | # images are not the same size.. 37 | with pytest.raises(Exception): 38 | ImageSequenceClip(images, durations=durations).close() 39 | 40 | 41 | if __name__ == "__main__": 42 | pytest.main() 43 | -------------------------------------------------------------------------------- /tests/test_doc_examples.py: -------------------------------------------------------------------------------- 1 | """Try to run all the documentation examples with runpy and check they don't raise 2 | exceptions. 3 | """ 4 | 5 | import os 6 | import pathlib 7 | import runpy 8 | import shutil 9 | from contextlib import contextmanager 10 | 11 | import pytest 12 | 13 | from moviepy.tools import no_display_available 14 | 15 | 16 | @contextmanager 17 | def cwd(path): 18 | oldpwd = os.getcwd() 19 | os.chdir(path) 20 | try: 21 | yield 22 | finally: 23 | os.chdir(oldpwd) 24 | 25 | 26 | # Dir for doc code examples to run 27 | DOC_EXAMPLES_DIR = "docs/_static/code" 28 | 29 | # List of examples script to ignore, mostly scripts that are too long 30 | DOC_EXAMPLES_IGNORE = ["trailer.py", "display_in_notebook.py"] 31 | 32 | # If no display, also remove all examples using preview 33 | if no_display_available(): 34 | DOC_EXAMPLES_IGNORE.append("preview.py") 35 | 36 | scripts = list(pathlib.Path(DOC_EXAMPLES_DIR).resolve().rglob("*.py")) 37 | scripts = dict(zip(map(str, scripts), scripts)) # This make test name more readable 38 | 39 | 40 | @pytest.mark.parametrize("script", scripts) 41 | def test_doc_examples(util, tmp_path, script): 42 | if os.path.basename(script) == "preview.py": 43 | pytest.skip("Skipping preview.py because no display is available") 44 | print("Try script: ", script) 45 | 46 | if os.path.basename(script) in DOC_EXAMPLES_IGNORE: 47 | return 48 | 49 | # Lets build a test dir with all medias needed to run our test in 50 | shutil.copytree(util.DOC_EXAMPLES_MEDIAS_DIR, os.path.join(tmp_path, "doc_tests")) 51 | test_dir = os.path.join(tmp_path, "doc_tests") 52 | 53 | with cwd(test_dir): 54 | runpy.run_path(script) 55 | 56 | 57 | if __name__ == "__main__": 58 | pytest.main() 59 | --------------------------------------------------------------------------------