moviepy
moviepy copied to clipboard
commas in filterchain are always escaped by a backslash
Expected Behavior
Filters that accept expressions or built in ffmpeg constants as options will format correctly with commas.
Actual Behavior
when attempting to apply an option that requires commas to delineate values in an expression (i.e r=X/W*(X,Y)
) an inescapable backslash is inserted into the middle of the string. Breaking the filter chain because it is unable to parse the option properly.
Steps to Reproduce the Problem
Install the latest version of moviepy, and run a filter that accepts expressions for option values:
stream =ffmpeg.input(args.i)
video = stream.video.filter('geq', 'X/W*(X//,Y)', '(1-X/W)*(X,Y)','(H-Y)/H*(X,Y)').filter('hue', '2*PI*t','sin(2*PI*t)+2')
audio = stream.audio.filter("anull")
out = ffmpeg.output(audio, video,f"{args.i}-rainbow{file_extension}" )
ffmpeg.run(out)
The error message:
[Parsed_geq_1 @ 0x5d34734413c0] [Eval @ 0x7fff3e9b9180] Undefined constant or missing '(' in '/,Y)'
Specifications
- Python Version:3.12.2
- MoviePy Version:1.0.3
- Platform: Ubuntu 24.04 LTS