Zulko / moviepy

Video editing with Python
https://zulko.github.io/moviepy/
MIT License
12.07k stars 1.51k forks source link

ffmpeg interpets video title as a command line argument when it begins with "-" #2160

Open TheSpaceSheep opened 2 months ago

TheSpaceSheep commented 2 months ago

Minimal reproducible example :

from moviepy.editor import *
clip = ColorClip((640, 480), color=(0, 0, 0), duration=5)
clip.write_videofile("-filenamethatbeginswith-.webm", fps=24)

Expected Behavior

write to a video file with name "-filenamethatbeginswith-.webm"

Actual Behavior

The following exception occurs (my interpretation is that a video file starting with "-" is interpreted as a command line argument for ffmpeg)

MoviePy error: FFMPEG encountered the following error while writing fil
e -myHolidays_edited.webm:

 b"Unrecognized option 'myHolidays_edited.webm'.\nError splitting the a
rgument list: Option not found\n"

Specifications

I will try to fix it myself !