Skip to content

the text only show half of it #2497

@jk2K

Description

@jk2K
Image
from moviepy import VideoFileClip, TextClip, CompositeVideoClip
import os

# Load file example.mp4 and keep only the subclip from 00:00:10 to 00:00:20
# Reduce the audio volume to 80% of its original volume

clip = (
    VideoFileClip("./assets/Here Comes the Runaway Bride-8.mp4")
    .subclipped(10, 20)
    .with_volume_scaled(0.8)
)

# 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])
if not os.path.exists("out"):
    os.makedirs("out")

final_video.write_videofile("out/result.mp4")

Expected Behavior

Actual Behavior

Steps and code to Reproduce the Problem

Used medias

Specifications

  • Python Version: 3.13.5
  • MoviePy Version: 2.2.1
  • Platform Name: macOS
  • Platform Version: 15.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssues that report (apparent) bugs.lib-PIL-PillowIssues pertaining to dependency PIL (or PIL fork Pillow).textIssues dealing with TextClip, SubtitlesClip, or handling of text in general.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions