Skip to content

Video editing with Python

examples/dancing_knights: Change file extension for audio file and resizing parameters during crop of clip (#1241)

Jay Essb47c29ed4041
diff --git a/examples/dancing_knights.py b/examples/dancing_knights.py
index c136b7c7..3d24d132 100644
--- a/examples/dancing_knights.py
+++ b/examples/dancing_knights.py
@@ -34,8 +34,8 @@ from moviepy.video.tools.cuts import find_video_period
# https://www.youtube.com/watch?v=lkY3Ek9VPtg => frontier.mp4
if not os.path.exists("knights.mp4"):
- os.system("youtube-dl zvCvOC2VwDc -o knights.mp4")
- os.system("youtube-dl lkY3Ek9VPtg -o frontier.mp4")
+ os.system("youtube-dl zvCvOC2VwDc -o knights")
+ os.system("youtube-dl lkY3Ek9VPtg -o frontier")
# ==========
@@ -43,7 +43,7 @@ if not os.path.exists("knights.mp4"):
audio = (
- AudioFileClip("frontier.mp4")
+ AudioFileClip("frontier.webm")
.subclip((4, 7), (4, 18))
.audio_fadein(1)
.audio_fadeout(1)
@@ -57,9 +57,9 @@ print("Analyzed the audio, found a period of %.02f seconds" % audio_period)
clip = (
- VideoFileClip("./knights.mp4", audio=False)
+ VideoFileClip("./knights.webm", audio=False)
.subclip((1, 24.15), (1, 26))
- .crop(x1=332, x2=910, y2=686)
+ .crop(x1=500, x2=1350)
)
video_period = find_video_period(clip, tmin=0.3)