ffmpeg-python icon indicating copy to clipboard operation
ffmpeg-python copied to clipboard

filter_ parsing error

Open RGuilfoyle opened this issue 9 years ago • 1 comments

When running version 1.6 the following filter definition works;

stream = ffmpeg.filter_(stream, 'crop', 'iw*.63:ih*.63:iw-(iw*.64):ih-(ih*.833)')

But if I run latest f8409d4 I get a parsing error returned by ffmpeg; [Parsed_crop_1 @ 0x4c86340] [Eval @ 0x7ffee8b86310] Invalid chars ':ih*.63:iw-(iw*.64):ih-(ih*.833)' at the end of expression 'iw*.63:ih*.63:iw-(iw*.64):ih-(ih*.833)' Error when evaluating the expression 'iw*.63:ih*.63:iw-(iw*.64):ih-(ih*.833)'

You can see that FFMpeg is rejecting part of the string, I guess the escaping is broken?

RGuilfoyle avatar Jul 26 '17 10:07 RGuilfoyle

Instead of joining arguments with :, pass each argument as its own string: ffmpeg.filter_(stream, 'crop', 'iw*.63', 'ih*.63', 'iw-(iw*.64)', 'ih-(ih*.833)')

I'll try to think of a way to make this more obvious, (or maybe have a warning when : is included in a filter arg).

It would also probably be good for ffmpeg-python to have crop as an explicitly supported filter. I'll put that on the list of things to do.

kkroening avatar Jul 27 '17 06:07 kkroening