79587123

Date: 2025-04-22 17:34:23
Score: 1
Natty:
Report link

from moviepy.editor import VideoFileClip, ColorClip, CompositeVideoClip

# Load the original video

clip = VideoFileClip("/mnt/data/istockphoto-1395741858-640_adpp_is.mp4")

# Get video dimensions

w, h = clip.size

# Define a black rectangle to cover the watermark (e.g., bottom right corner)

# Approximate watermark size and position

wm_width, wm_height = 120, 30 # size of watermark area

wm_x, wm_y = w - wm_width - 10, h - wm_height - 10 # position from bottom right with padding

# Create a black rectangle to overlay

cover = ColorClip(size=(wm_width, wm_height), color=(0, 0, 0), duration=clip.duration)

cover = cover.set_position((wm_x, wm_y))

# Combine the video with the overlay

final = CompositeVideoClip([clip, cover])

# Export the result

output_path = "/mnt/data/watermark_covered.mp4"

final.write_videofile(output_path, codec="libx264", audio_codec="aac")

output_path

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Abhilasha Shrivastav