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

VideoClip blitting: fix truncation bug to enable fractional opacity #1552

Merged
merged 5 commits into from
May 18, 2021

Conversation

creichen
Copy link
Contributor

This fixes #1369 for me, which was broken as of
fe5c782 due to a `truncate before
multiply' bug.

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

Below is the (manual) test that I used:

from moviepy.editor import *

video = VideoFileClip('earth.mp4')

fgclip = VideoFileClip('sample-mp4-file.mp4')
fgclip = fgclip.with_end(4)
fgclip = fgclip.with_opacity(0.5)

video = CompositeVideoClip([video, fgclip])

video.subclip(0, 4).write_videofile('out.mp4', fps=5)

The second commit adds a unit test.

@coveralls
Copy link

coveralls commented May 18, 2021

Coverage Status

Coverage remained the same at 68.564% when pulling 1f54b78 on creichen:fade-opacity-fix into b5e5a30 on Zulko:master.

@mondeja mondeja force-pushed the fade-opacity-fix branch from deef1f4 to 41c2a53 Compare May 18, 2021 15:30
@mondeja mondeja force-pushed the fade-opacity-fix branch from 41c2a53 to 9b1ab5f Compare May 18, 2021 15:32
@mondeja mondeja added bug-fix For PRs and issues solving bugs. video Related to VideoClip and related classes, or handling of video in general. labels May 18, 2021
Copy link
Collaborator

@mondeja mondeja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thank you for this fix @creichen! 💯

@mondeja mondeja linked an issue May 18, 2021 that may be closed by this pull request
@mondeja mondeja merged commit 495948e into Zulko:master May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix For PRs and issues solving bugs. video Related to VideoClip and related classes, or handling of video in general.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crossfadein on TextClip doesn't work with the newest code Crossfade effects seem deprecated
3 participants