From: Thilo Borgmann <thilo.borgmann@mail.de>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH v6 1/2] ffmpeg: Add display_{rotation, hflip, vflip} options
Date: Sat, 15 Oct 2022 12:27:54 +0200
Message-ID: <e005d815-f6d4-a8ac-42d0-faf03fbbb0aa@mail.de> (raw)
In-Reply-To: <166487305168.5794.17571588681688773816@lain.khirnov.net>
Am 04.10.22 um 10:44 schrieb Anton Khirnov:
> Quoting Thilo Borgmann (2022-09-26 07:57:52)
>> From: Jan Ekström <jeebjp@gmail.com>
>>
>> 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.
>> ---
>> doc/ffmpeg.texi | 29 +++++++++++++++++++++
>> fftools/ffmpeg.h | 6 +++++
>> fftools/ffmpeg_opt.c | 50 +++++++++++++++++++++++++++++++++++++
>> tests/fate/filter-video.mak | 2 +-
>> 4 files changed, 86 insertions(+), 1 deletion(-)
>>
>> diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
>> index 42440d93b4..6016b43892 100644
>> --- a/doc/ffmpeg.texi
>> +++ b/doc/ffmpeg.texi
>> @@ -912,6 +912,35 @@ If used together with @option{-vcodec copy}, it will affect the aspect ratio
>> stored at container level, but not the aspect ratio stored in encoded
>> frames, if it exists.
>>
>> +@item -display_rotation[:@var{stream_specifier}] @var{rotation} (@emph{input,per-stream})
>> +Set the video display rotation in degrees specified by @var{rotation}.
>> +
>> +@var{rotation} is a floating point number that describes a pure
>> +counter-clockwise rotation in degrees.
>> +When setting this, @code{-autorotate} logic will be affected.
>> +For additional parameters affecting display matrix side data into which this
>> +information is saved, see @code{-display_hflip}, @code{-display_vflip}.
>> +
>> +These options work as a unit, so if only one of them is set, then the display
>> +matrix will be overridden to that specific value with the rest being set to
>> +default values.
>> +
>> +If unset, the default value if a display matrix is being defined is a rotation
>> +of zero degrees.
>> +
>> +@item -display_hflip[:@var{stream_specifier}] (@emph{input,per-stream})
>> +Set whether on display the image should be horizontally flipped.
>> +
>> +If unset, the default value if a display matrix is being defined is that there
>> +is no additional horizontal flip. See @code{-display_rotation}.
>> +
>> +@item -display_vflip[:@var{stream_specifier}] (@emph{input,per-stream})
>> +Set whether on display the image should be vertically flipped.
>> +
>> +If unset, the default value if a display matrix is being defined is that there
>> +is no additional vertical flip. See @code{-display_rotation}.
>
> @item -display_rotation[:@var{stream_specifier}] @var{rotation} (@emph{input,per-stream})
> Set video rotation metadata.
>
> @var{rotation} is a decimal number specifying the amount in degree by
> which the video should be rotated counter-clockwise before being
> displayed.
>
> This option overrides the rotation/display transform metadata stored in
> the file, if any. When the video is being transcoded (rather than
> copied) and @code{-autorotate} is enabled, the video will be rotated at
> the filtering stage. Otherwise, the metadata will be written into the
> output file if the muxer supports it.
>
> If the @code{-display_hflip} and/or @code{-display_vflip} options are
> given, they are applied after the rotation specified by this option.
>
> @item -display_hflip[:@var{stream_specifier}] (@emph{input,per-stream})
> Set whether on display the image should be horizontally flipped.
>
> See the @code{-display_rotation} option for more details.
>
> @item -display_vflip[:@var{stream_specifier}] (@emph{input,per-stream})
> Set whether on display the image should be vertically flipped.
>
> See the @code{-display_rotation} option for more details.
>
>> +static void add_display_matrix_to_stream(OptionsContext *o,
>> + AVFormatContext *ctx, AVStream *st)
>> +{
>> + double rotation = DBL_MAX;
>> + int hflip = -1, vflip = -1;
>> + int hflip_set = 0, vflip_set = 0, rotation_set = 0;
>> + uint8_t *buf = NULL;
>
> should be int32_t*
av_stream_new_side_data() returns uint8_t*.
So it is either add a cast to if(...) or two casts to av_display_...().
All else in v7.
Thanks,
Thilo
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2022-10-15 10:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-26 5:57 [FFmpeg-devel] [PATCH v6 0/2] " Thilo Borgmann
2022-09-26 5:57 ` [FFmpeg-devel] [PATCH v6 1/2] " Thilo Borgmann
2022-10-04 8:44 ` Anton Khirnov
2022-10-15 10:27 ` Thilo Borgmann [this message]
2022-10-17 13:01 ` Anton Khirnov
2022-09-26 5:57 ` [FFmpeg-devel] [PATCH v6 2/2] ffmpeg: Deprecate display rotation override with a metadata key Thilo Borgmann
2022-10-04 8:52 ` Anton Khirnov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e005d815-f6d4-a8ac-42d0-faf03fbbb0aa@mail.de \
--to=thilo.borgmann@mail.de \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git