Fixed background video choping issue

Fixed issue #348
pull/385/head
emil314 3 years ago committed by GitHub
parent 41ebf3b5e5
commit 33f78bf7aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -6,7 +6,7 @@ from pathlib import Path
from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
from moviepy.editor import VideoFileClip
from utils.console import print_step, print_substep
from moviepy.video.io.VideoFileClip import VideoFileClip
def get_start_and_end_times(video_length, length_of_clip):
@ -42,10 +42,9 @@ def chop_background_video(video_length):
background = VideoFileClip("assets/mp4/background.mp4")
start_time, end_time = get_start_and_end_times(video_length, background.duration)
ffmpeg_extract_subclip(
"assets/mp4/background.mp4",
start_time,
end_time,
targetname="assets/mp4/clip.mp4",
)
with VideoFileClip("assets/mp4/background.mp4") as video:
new = video.subclip(start_time, end_time)
new.write_videofile("assets/mp4/clip.mp4")
print_substep("Background video chopped successfully!", style="bold green")

Loading…
Cancel
Save