Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add afterimage example #491

Merged
1 commit merged into from Mar 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions tests/test_Videos.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import pytest
from moviepy.editor import *

# must have to work on travis-ci
import sys
sys.path.append("tests")
import download_media

def test_download_media(capsys):
with capsys.disabled():
download_media.download()

def test_afterimage():
ai=ImageClip("media/afterimage.png")
masked_clip = vfx.mask_color(ai, color=[0,255,1]) # for green

some_background_clip = ColorClip((800,600), color=(255,255,255))

final_clip = CompositeVideoClip([some_background_clip, masked_clip],
use_bgclip=True)
final_clip.duration=5
final_clip.write_videofile("/tmp/afterimage.mp4", fps=30)

if __name__ == '__main__':
pytest.main()