[FFmpeg-devel] Ideas to replace the options system

Tobias Rapp t.rapp at noa-archive.com
Tue Dec 8 09:03:23 CET 2015


On 05.12.2015 00:54, James Darnley wrote:
> On 2015-12-04 15:33, Nicolas George wrote:
>> Why do we need a new options system?
>>
>>    Most importantly: escaping hell
>
> OMG yes!  I have seen several times the amount of backslashes Windows
> users are forced to use to provide a path to some of the filters.
>
> You raise a lot of good points that need to be considered from design,
> user-dev, and user-user perspectives.  I haven't read through in great
> detail but did glance at the heading and TL;DRs.
>
> I have a couple of probably controversial opinions about this:
>
> - Only allow "simple" string arguments on the command line.  If escapes
> or complexity is needed then force people to use a script file.
>
> - Deprecate and remove the expression evaluation that currently exists
> and replace it with an existing scripting language.  Sorry to the people
> that worked hard on it.  It works fine.  Perhaps the escaping hell
> causes my bad perception of it.
>
> [...]
I think that replacing the option system with a scripting language will 
put the entry level too high for most users. The basic problem seems to 
be how to better represent option hierarchy. Maybe some JSON-like syntax 
would make it simpler:

ffmpeg -f lavfi -i '{"aevalsrc": {"exprs": ["sin(420*2*PI*t)", 
"cos(430*2*PI*t)"], "c": ["FC", "BC"]}, "s": 48000}' ...

If you have to escape double quote characters in your shell environment 
it gets really worse, though. So likely the syntax should be adjusted to 
allow for both, single and double quotes. Further it would be nice to 
allow the key being non-quoted:

ffmpeg -f lavfi -i "{aevalsrc: {exprs: ['sin(420*2*PI*t)', 
'cos(430*2*PI*t)'], c: ['FC', 'BC']}, s: 48000}" ...

Just some idea.

Regards,
Tobias



More information about the ffmpeg-devel mailing list