Am 04.10.22 um 10:44 schrieb Anton Khirnov:
Quoting Thilo Borgmann (2022-09-26 07:57:52)
From: Jan Ekström <jee...@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-requ...@ffmpeg.org with subject "unsubscribe".