Zulko / moviepy

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

commas in filterchain are always escaped by a backslash #2172

Open blrbrb opened 1 month ago

blrbrb commented 1 month ago

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