Video editing with Python
formatting
osaajani96253ce116d8
diff --git a/moviepy/tools.py b/moviepy/tools.pyindex 95166b13..174f6c41 100644--- a/moviepy/tools.py+++ b/moviepy/tools.py@@ -55,8 +55,8 @@ def ffmpeg_escape_filename(filename):That will ensure the filename doesn't start with a '-' (which would raise an error)"""- if filename.startswith('-') :- filename = './' + filename+ if filename.startswith("-"):+ filename = "./" + filenamereturn filenamediff --git a/moviepy/video/io/ffmpeg_tools.py b/moviepy/video/io/ffmpeg_tools.pyindex 00dfafb2..e9716ffb 100644--- a/moviepy/video/io/ffmpeg_tools.py+++ b/moviepy/video/io/ffmpeg_tools.py@@ -200,7 +200,7 @@ def ffmpeg_stabilize_video(ffmpeg_escape_filename(inputfile),"-vf","deshake",- ffmpeg_escape_filename(outputfile)+ ffmpeg_escape_filename(outputfile),]if overwrite_file:diff --git a/tests/test_compositing.py b/tests/test_compositing.pyindex 23d4ec11..6937007b 100644--- a/tests/test_compositing.py+++ b/tests/test_compositing.py@@ -294,11 +294,20 @@ def test_slide_out():def test_concatenate_with_masks(util):- video_without_mask = ColorClip(size=(10, 10), color=(255, 0, 0)).with_duration(1).with_fps(1)- video_with_mask = ColorClip(size=(5, 5), color=(0, 255, 0)).with_duration(1).with_fps(1).with_mask()-+ video_without_mask = (+ ColorClip(size=(10, 10), color=(255, 0, 0)).with_duration(1).with_fps(1)+ )+ video_with_mask = (+ ColorClip(size=(5, 5), color=(0, 255, 0))+ .with_duration(1)+ .with_fps(1)+ .with_mask()+ )+output = os.path.join(util.TMP_DIR, "test_concatenate_with_masks.mp4")- concatenate_videoclips([video_without_mask, video_with_mask]).write_videofile(output)+ concatenate_videoclips([video_without_mask, video_with_mask]).write_videofile(+ output+ )if __name__ == "__main__":diff --git a/tests/test_ffmpeg_writer.py b/tests/test_ffmpeg_writer.pyindex a56d5096..f450c459 100644--- a/tests/test_ffmpeg_writer.py+++ b/tests/test_ffmpeg_writer.py@@ -254,7 +254,7 @@ def test_transparent_video(util):result.close()-+def test_write_file_with_spaces(util):filename = os.path.join(util.TMP_DIR, "name with spaces.mp4")clip = ColorClip((1, 1), color=1, is_mask=True).with_fps(1).with_duration(0.3)diff --git a/tests/test_issues.py b/tests/test_issues.pyindex ed395707..ae2d6acd 100644--- a/tests/test_issues.py+++ b/tests/test_issues.py@@ -435,7 +435,7 @@ def test_issue_2269_3(util):assert pixel2 == 0.51assert pixel3 == 0.657-+def test_issue_2160(util):filename = "media/-video-with-dash-.mp4"clip = VideoFileClip(filename)diff --git a/tests/test_tools.py b/tests/test_tools.pyindex 49357c2f..448a5e33 100644--- a/tests/test_tools.py+++ b/tests/test_tools.py@@ -72,7 +72,7 @@ def test_subprocess_call(command):("-path/that/starts/with/dash.mp4", "./-path/that/starts/with/dash.mp4"),("file-name-.mp4", "file-name-.mp4"),("/absolute/path/to/-file.mp4", "/absolute/path/to/-file.mp4"),- ("filename with spaces.mp4", "filename with spaces.mp4")+ ("filename with spaces.mp4", "filename with spaces.mp4"),],)def test_ffmpeg_escape_filename(given, expected):