[FFmpeg-devel] [PATCH 5/6 v3] fftools/ffmpeg: support applying container level cropping

Anton Khirnov anton at khirnov.net
Tue Jul 2 20:55:19 EEST 2024


Quoting James Almer (2024-07-02 18:49:36)
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  doc/ffmpeg.texi         | 16 ++++++++++++++++
>  fftools/ffmpeg.h        | 15 +++++++++++++++
>  fftools/ffmpeg_demux.c  | 26 ++++++++++++++++++++++++++
>  fftools/ffmpeg_filter.c | 10 ++++++++++
>  fftools/ffmpeg_opt.c    | 25 +++++++++++++++++++++++++
>  5 files changed, 92 insertions(+)
> 
> diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
> index f25f6192eb..f75ed681cf 100644
> --- a/doc/ffmpeg.texi
> +++ b/doc/ffmpeg.texi
> @@ -1262,6 +1262,22 @@ disabled, all output frames of filter graph might not be in the same resolution
>  and may be inadequate for some encoder/muxer. Therefore, it is not recommended
>  to disable it unless you really know what you are doing.
>  Disable autoscale at your own risk.
> +
> + at item -apply_cropping

+ at item -apply_cropping[:@var{stream_specifier}] @var{source} (@emph{input,per-stream})


> +Automatically crop the video according to file metadata. Default is @emph{all}.
                               ^
                        after decoding
> +
> + at table @option
> + at item none (0)
> +Don't apply any cropping metadata.
> + at item all (1)
> +Apply both codec and container level croppping. This is the default mode.
> + at item codec (2)
> +Apply codec level croppping.
> + at item container (3)
> +Apply container level croppping.
> +
> + at end table
> +

Also, this should probably be in the advanced section, since it's marked
as OPT_EXPERT.

> @@ -715,6 +729,7 @@ AVDictionary *strip_specifiers(const AVDictionary *dict);
>  int find_codec(void *logctx, const char *name,
>                 enum AVMediaType type, int encoder, const AVCodec **codec);
>  int parse_and_set_vsync(const char *arg, int *vsync_var, int file_idx, int st_idx, int is_global);
> +int parse_and_set_cropping(const char *arg, int *out);

What's the point of this being in a separate file when it's only used
from ffmpeg_demux?

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list