# Re-import necessary modules after environment reset
import moviepy.editor as mp
from moviepy.video.fx import resize, colorx
from moviepy.video.fx.all import lum_contrast
# Define file paths
input_path = "/mnt/data/VID-20241207-WA0006.mp4"
output_path = "/mnt/data/VID_sunset_1080p_clip.mp4"
# Load video
clip = mp.VideoFileClip(input_path)
# Potong video dari detik ke-0 sampai 15 detik
clip_cut = clip.subclip(0, 15)
# Resize ke 1080p
clip_resized = clip_cut.fx(resize.resize, height=1080)
# Tambahkan efek sunset cerah
clip_warm = clip_resized.fx(lum_contrast, lum=20, contrast=40)
clip_sunset = clip_warm.fx(colorx.colorx, 1.2)
# Simpan hasil video
clip_sunset.write_videofile(output_path, codec='libx264', audio_codec='aac')