Skip to content

Video editing with Python

New functionality

George Pantelisae25b7cb9809
diff --git a/moviepy/video/io/ffmpeg_tools.py b/moviepy/video/io/ffmpeg_tools.py
index 8128de90..710eeb5a 100644
--- a/moviepy/video/io/ffmpeg_tools.py
+++ b/moviepy/video/io/ffmpeg_tools.py
@@ -119,3 +119,29 @@ def ffmpeg_resize(video, output, size):
]
subprocess_call(cmd)
+
+def ffmpeg_stabilaze_video(filename,output = None):
+ """
+
+ Makes a new video file , from the given one
+ which is more stable
+
+ Parameters
+ -----------
+
+ filename
+ The name of the shaky video
+
+ output
+ The name of new stabilazed video
+ """
+
+ name,ext = os.path.splitext(filename)
+ if not output:
+ output = "%s_stabilazed%s"%(name,ext)
+
+ cmd = [get_setting("FFMPEG_BINARY"),"-i",
+ filename,"-vf",
+ "deshake",output]
+
+ subprocess_call(cmd)