[FFmpeg-devel] [PATCH v2 2/4] ffmpeg: Add display_matrix option

Nicolas George george at nsup.org
Wed Aug 17 11:59:02 EEST 2022


Gyan Doshi (12022-08-17):
> It's not based on ffmpeg's 'internal representation'. All transform
> attributes are stored as a composite in one mathematical object.
> Evaluating the matrix values will need to look at all sources of
> contribution. So gathering and presenting all these attributes in a single
> option (+ docs) makes it clearer to the user at the cost of an initial
> learning curve.

I concur a single option might be more convenient. Especially since our
options system does not take into account the order of options: the
interactions between multiple options would be rather hard to explain.

OTOH, I do not like a dictionary-based approach, for the same reason:
you have to explain the order of precedence of options, and how
contradicting ones interact.

Might I suggest to adopt the syntax of the transform attribute of SVG?
Or a subset of it with a stricter syntax.

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform

It requires writing a specific parser, but one that can be done with
sscanf():

if (sscanf(cur, "translate(%d %d)%n", &dx, &dy, &off) >= 2 && off) {
    translate_current_matrix(&mat, dx, dy);
    cur += off;
}

Regards,

-- 
  Nicolas George

-- 
  “I dont see why” isnt an argument. Proposing better is.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20220817/f3900f4f/attachment.sig>


More information about the ffmpeg-devel mailing list