fftools/ffmpeg: support applying container level cropping

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2024-05-28 16:37:44 -03:00
parent f194f291d8
commit bf87688a9f
5 changed files with 86 additions and 0 deletions

View file

@ -155,6 +155,7 @@ typedef struct OptionsContext {
SpecifierOptList hwaccel_devices;
SpecifierOptList hwaccel_output_formats;
SpecifierOptList autorotate;
SpecifierOptList apply_cropping;
/* output options */
StreamMap *stream_maps;
@ -239,6 +240,7 @@ enum IFilterFlags {
IFILTER_FLAG_AUTOROTATE = (1 << 0),
IFILTER_FLAG_REINIT = (1 << 1),
IFILTER_FLAG_CFR = (1 << 2),
IFILTER_FLAG_CROP = (1 << 3),
};
typedef struct InputFilterOptions {
@ -254,6 +256,11 @@ typedef struct InputFilterOptions {
* accurate */
AVRational framerate;
unsigned crop_top;
unsigned crop_bottom;
unsigned crop_left;
unsigned crop_right;
int sub2video_width;
int sub2video_height;
@ -539,6 +546,13 @@ typedef struct KeyframeForceCtx {
typedef struct Encoder Encoder;
enum CroppingType {
CROP_DISABLED = 0,
CROP_ALL,
CROP_CODEC,
CROP_CONTAINER,
};
typedef struct OutputStream {
const AVClass *class;