ffmpeg | branch: master | Paul B Mahol <one...@gmail.com> | Mon Mar 7 16:57:30 2022 +0100| [13a153d801011c4ec82b90af1351e10dcf1754e1] | committer: Paul B Mahol
avfilter/f_sendcmd: export width and height too > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=13a153d801011c4ec82b90af1351e10dcf1754e1 --- doc/filters.texi | 6 ++++++ libavfilter/f_sendcmd.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/doc/filters.texi b/doc/filters.texi index 8427b88d3d..26c5b4db48 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -27041,6 +27041,12 @@ The end time in seconds of the current command interval. @item TI The interpolated time of the current command interval, TI = (T - TS) / (TE - TS). + +@item W +The video frame width. + +@item H +The video frame height. @end table @end table diff --git a/libavfilter/f_sendcmd.c b/libavfilter/f_sendcmd.c index 7261a05aae..04bfc84a06 100644 --- a/libavfilter/f_sendcmd.c +++ b/libavfilter/f_sendcmd.c @@ -46,6 +46,8 @@ static const char *const var_names[] = { "TS", /* interval start time in seconds */ "TE", /* interval end time in seconds */ "TI", /* interval interpolated value: TI = (T - TS) / (TE - TS) */ + "W", /* width for video frames */ + "H", /* height for video frames */ NULL }; @@ -57,6 +59,8 @@ enum var_name { VAR_TS, VAR_TE, VAR_TI, + VAR_W, + VAR_H, VAR_VARS_NB }; @@ -531,6 +535,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *ref) var_values[VAR_TS] = start; var_values[VAR_TE] = end; var_values[VAR_TI] = (current - start) / (end - start); + var_values[VAR_W] = ref->width; + var_values[VAR_H] = ref->height; if ((ret = av_expr_parse_and_eval(&res, cmd->arg, var_names, var_values, NULL, NULL, NULL, NULL, NULL, 0, NULL)) < 0) { _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".