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

Base example from PyPi is not working as expected in latest version -- with_duration seems to be ignored #2300

Open
harsh-zymr opened this issue Dec 26, 2024 · 6 comments
Labels
bug Issues that report (apparent) bugs.

Comments

@harsh-zymr
Copy link

harsh-zymr commented Dec 26, 2024

Running the example code vailable on PyPi site for moviepy.

Expected Behavior

The text should stop displaying after 10 seconds.

Actual Behavior

The text is displayed for 14 seconds, regardless of what value is passed in with_duration method.

Steps to Reproduce the Problem

from moviepy import VideoFileClip, TextClip, CompositeVideoClip

# Load file example.mp4 
clip = (
    VideoFileClip("long_examples/example2.mp4")
)

# Generate a text clip. You can customize the font, color, etc.
txt_clip = TextClip(
    font="Arial.ttf",
    text="Hello there!",
    font_size=70,
    color='white'
).with_duration(10).with_position('center')

# Overlay the text clip on the first video clip
final_video = CompositeVideoClip([clip, txt_clip])
final_video.write_videofile("result.mp4")

Specifications

  • Python Version: 3.13.0
  • MoviePy Version: 2.1.1
  • Platform Name: Macbook Pro - M1 2020
  • Platform Version: MacOS Sonoma 14.5
  • ffmpeg version: 7.1
@harsh-zymr harsh-zymr added the bug Issues that report (apparent) bugs. label Dec 26, 2024
@harsh-zymr harsh-zymr changed the title Base example from PyPi is not working in latest version Base example from PyPi is not working as expected in latest version -- with_duration seems to be ignored Dec 26, 2024
@harsh-zymr
Copy link
Author

Interestingly this only happened when a video, generated by another NodeJS application, was used. The Nodejs generated video using ffmpeg only.
If I generate a video from the same library then the issue does not happen.

@OsaAjani
Copy link
Collaborator

Could you include the problematic video please

@OsaAjani
Copy link
Collaborator

Hi @harsh-zymr I would need the mentioned video to be able to test, I cannot reproduce.

@harsh-zymr
Copy link
Author

@OsaAjani I will need to recreate it now since I dropped nodejs app and moved to full python generation only to avoid the issue. I will share the video here in a day or so, after I recreate it.

@harsh-zymr
Copy link
Author

@OsaAjani Here is one of the videos:

vid.mp4

@OsaAjani
Copy link
Collaborator

Thanks, I'll put it on my to-do list !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that report (apparent) bugs.
Projects
None yet
Development

No branches or pull requests

2 participants