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

Anton Khirnov anton at khirnov.net
Thu Aug 18 10:11:34 EEST 2022


Quoting Gyan Doshi (2022-08-17 10:50:43)
> 
> 
> On 2022-08-17 01:48 pm, Anton Khirnov wrote:
> > Quoting Thilo Borgmann (2022-08-16 20:48:57)
> >> Am 16.08.22 um 16:10 schrieb Anton Khirnov:
> >>> Quoting Thilo Borgmann (2022-08-15 22:02:09)
> >>>> $subject
> >>>>
> >>>> -Thilo
> >>>>   From fe2ff114cb004f897c7774753d9cf28298eba82d Mon Sep 17 00:00:00 2001
> >>>> From: =?UTF-8?q?Jan=20Ekstr=C3=B6m?= <jeebjp at gmail.com>
> >>>> Date: Mon, 15 Aug 2022 21:09:27 +0200
> >>>> Subject: [PATCH v2 2/4] ffmpeg: Add display_matrix option
> >>>>
> >>>> This enables overriding the rotation as well as horizontal/vertical
> >>>> flip state of a specific video stream on the input side.
> >>>>
> >>>> Additionally, switch the singular test that was utilizing the rotation
> >>>> metadata to instead override the input display rotation, thus leading
> >>>> to the same result.
> >>>> ---
> >>> I still don't see how it's better to squash multiple options into a
> >>> single option.
> >>>
> >>> It requires all this extra infrastructure and in the end it's less
> >>> user-friendly, because user-understandable things like rotation or flips
> >>> are now hidden under "display matrix". How many users would know what a
> >>> display matrix is?
> >> FWIW I think Gyan's request to do this all in one option that effect one thing (the display matrix) is valid.
> > I don't.
> >
> > It may be one thing internally, but modeling user interfaces based on
> > internal representation is a sinful malpractice. More importantly, I see
> > no advantage from doing it - it only makes the option parsing more
> > complicated.
> 
> It's not based on ffmpeg's 'internal representation'. All transform 
> attributes are stored as a composite in one mathematical object.

Also forgot to mention yesterday - the way this will be stored in the
output depends on the codec/container and will not always necessarily be
an MP4-style display matrix. E.g. in some cases it might make most sense
to write a display orientation SEI, which stores [hv]flip flags and a
rotation angle.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list