Opened 5 years ago
Last modified 5 years ago
#8531 new enhancement
Character substitution in parameters
Reported by: | Andreas Håkon | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avutil |
Version: | git-master | Keywords: | av_get_token |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the trouble:
A lot of filters require to use SPACES inside the configuration.
Example: convolution
https://ffmpeg.org/ffmpeg-filters.html#toc-Examples-49
However, using SCRIPTS it's quite complex to work using SPACES inside STRINGS. So defining a "filter_complex" with these filters it's a pain.
So, I recommend to add a third type of "Quoting and scaping":
https://www.ffmpeg.org/ffmpeg-utils.html
The idea is to "Quote, scape and substitute", like this example:
% ffmpeg -i input -filter_complex convolution=1\%201\%201\%201\%201\%201\%201\%201\%201:1\%201\%201\%201\%201\%201\%201\%201\%201:1\%201\%201\%201\%201\%201\%201\%201\%201:1\%201\%201\%201\%201\%201\%201\%201\%201:1/9:1/9:1/9:1/9 output
Even this is hard to read for a human, it doesn't contain any space. And it can be parsed quite easy: After a BACKSPACE "\" the "%" indicates an HEX ASCII SUBSTITUTION.
This can be included in the function "av_get_token()" that parses all tokens:
https://github.com/FFmpeg/FFmpeg/blob/44a80897e86f3a8d576e8d5a14df218be767aeab/libavutil/avstring.c#L149
I hope you want to implement this.
Regards.
Change History (2)
follow-up: 2 comment:1 by , 5 years ago
comment:2 by , 5 years ago
Replying to Cigaes:
This is unlikely to happen. Using spaces is possible and easy with any decent scripting language.
Easy is not with ALL scripting languages. Futhermore the change required is only a few lines inside ONE function. It will not disturb the current behaviour and it will open other options. So I don't see any reason to not do it.
Regards.
This is unlikely to happen. Using spaces is possible and easy with any decent scripting language.