[FFmpeg-devel] [PATCH v2 0/2] Print filter input/output formats in help output

ffmpegagent ffmpegagent at gmail.com
Wed Oct 12 00:38:18 EEST 2022


Example output for command: ffmpeg -h filters=overlay

Filter overlay
  Overlay a video source on top of the input.
    slice threading supported
    Inputs:
       #0: main (video), Formats: Dynamic, Default: [yuv420p, yuvj420p, yuva420p, nv12, nv21]
       #1: overlay (video), Formats: Dynamic, Default: [yuva420p]
    Outputs:
       #0: default (video), Formats: Dynamic, Default: [yuv420p, yuvj420p, yuva420p, nv12, nv21]

overlay AVOptions:
    [...]



Examples for what it prints in various cases
============================================

For pass-through filter links

"All (passthrough)"


For filters using query_formats

"Dynamic"


For filters using query_formats where a call to query_formats succeeds

"Dynamic, Default: [yuv420p, yuvj420p, yuva420p, nv12, nv21]"


For all other cases

"[s16p, s32p, fltp, dblp]"


Except when all formats are supported (number of formats equals number of
available formats)

"All"


----------------------------------------------------------------------------

v2: rebase and fix compiler warnings

softworkz (2):
  avfilter/avfilter: add avfilter_print_config_formats()
  ftools/opt_common: Print filter input/output formats in help output

 doc/APIchanges              |   3 ++
 fftools/opt_common.c        |  37 +++++++++----
 libavfilter/avfilter.c      | 102 +++++++++++++++++++++++++++++++++++-
 libavfilter/avfilter.h      |  12 +++++
 libavfilter/avfiltergraph.c |  15 ++++--
 libavfilter/internal.h      |   9 ++++
 libavfilter/version.h       |   4 +-
 7 files changed, 163 insertions(+), 19 deletions(-)


base-commit: 479747645f795b6f4f376578ea1556409f943c31
Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-43%2Fsoftworkz%2Fsubmit_print_formats-v2
Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-43/softworkz/submit_print_formats-v2
Pull-Request: https://github.com/ffstaging/FFmpeg/pull/43

Range-diff vs v1:

 1:  c9496ca671 ! 1:  5ae347e40c avfilter/avfilter: add avfilter_print_config_formats()
     @@ doc/APIchanges: libavutil:     2021-04-27
       
      +2022-10-11 - xxxxxxxxxx - lavf 59.50.100 - avfilter.h
      +  Add add avfilter_print_config_formats().
     -+
     - 2022-10-05 - 37d5ddc317 - lavu 57.39.100 - cpu.h
     -   Add AV_CPU_FLAG_RVB_BASIC.
     ++  
     + 2022-10-11 - xxxxxxxxxx - lavu 57.39.101 - pixfmt.h
     +   Add AV_PIX_FMT_RGBF32 and AV_PIX_FMT_RGBAF32.
       
      
       ## libavfilter/avfilter.c ##
     @@ libavfilter/avfilter.c: void avfilter_link_free(AVFilterLink **link)
           av_freep(link);
       }
       
     -+static unsigned get_nb_pix_fmts()
     ++static unsigned get_nb_pix_fmts(void)
      +{
      +    unsigned i = 0;
      +    while (av_pix_fmt_desc_get(i++)) {}
      +    return i - 1;
      +}
      +
     -+static unsigned get_nb_sample_fmts()
     ++static unsigned get_nb_sample_fmts(void)
      +{
      +    unsigned i = 0;
      +    while (av_get_sample_fmt_name(i++)) {}
     @@ libavfilter/avfiltergraph.c: static int query_formats(AVFilterGraph *graph, void
      -            ret = filter_query_formats(f);
      -        else
      -            ret = ff_default_query_formats(f);
     ++
      +        ret = ff_filter_query_formats(f);
               if (ret < 0 && ret != AVERROR(EAGAIN))
                   return ret;
 2:  c99d278881 ! 2:  29389422a9 ftools/opt_common: Print filter input/output formats in help output
     @@ fftools/opt_common.c: static void show_help_filter(const char *name)
       {
       #if CONFIG_AVFILTER
           const AVFilter *f = avfilter_get_by_name(name);
     --    int i, count;
      +    AVBPrint bp;
     -+    int i, count, ret;
     +     int i, count;
       
           if (!name) {
     -         av_log(NULL, AV_LOG_ERROR, "No filter name specified.\n");
      @@ fftools/opt_common.c: static void show_help_filter(const char *name)
               return;
           }

-- 
ffmpeg-codebot


More information about the ffmpeg-devel mailing list