[FFmpeg-cvslog] avconv_opt: Add an option that lists all supported hwaccels

Timothy Gu git at videolan.org
Mon Aug 31 10:02:14 CEST 2015


ffmpeg | branch: master | Timothy Gu <timothygu99 at gmail.com> | Tue Aug 25 16:45:21 2015 -0700| [c23999be134bde0a0554261a9043be7dbc01de0c] | committer: Luca Barbato

avconv_opt: Add an option that lists all supported hwaccels

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c23999be134bde0a0554261a9043be7dbc01de0c
---

 avconv_opt.c    |   14 ++++++++++++++
 doc/avconv.texi |    4 ++++
 2 files changed, 18 insertions(+)

diff --git a/avconv_opt.c b/avconv_opt.c
index b527335..5bdd7d9 100644
--- a/avconv_opt.c
+++ b/avconv_opt.c
@@ -177,6 +177,18 @@ static double parse_frame_aspect_ratio(const char *arg)
     return ar;
 }
 
+static int show_hwaccels(void *optctx, const char *opt, const char *arg)
+{
+    int i;
+
+    printf("Supported hardware acceleration:\n");
+    for (i = 0; i < FF_ARRAY_ELEMS(hwaccels) - 1; i++) {
+        printf("%s\n", hwaccels[i].name);
+    }
+    printf("\n");
+    return 0;
+}
+
 static int opt_audio_codec(void *optctx, const char *opt, const char *arg)
 {
     OptionsContext *o = optctx;
@@ -2446,6 +2458,8 @@ const OptionDef options[] = {
     { "hwaccel_device",   OPT_VIDEO | OPT_STRING | HAS_ARG | OPT_EXPERT |
                           OPT_SPEC | OPT_INPUT,                                  { .off = OFFSET(hwaccel_devices) },
         "select a device for HW acceleration", "devicename" },
+    { "hwaccels",         OPT_EXIT,                                              { .func_arg = show_hwaccels },
+        "show available HW acceleration methods" },
     { "autorotate",       HAS_ARG | OPT_BOOL | OPT_SPEC |
                           OPT_EXPERT | OPT_INPUT,                                { .off = OFFSET(autorotate) },
         "automatically insert correct rotate filters" },
diff --git a/doc/avconv.texi b/doc/avconv.texi
index 504b8ed..2433ede 100644
--- a/doc/avconv.texi
+++ b/doc/avconv.texi
@@ -626,6 +626,10 @@ is not specified, the value of the @var{DISPLAY} environment variable is used
 For DXVA2, this option should contain the number of the display adapter to use.
 If this option is not specified, the default adapter is used.
 @end table
+
+ at item -hwaccels
+List all hardware acceleration methods supported in this build of avconv.
+
 @end table
 
 @section Audio Options



More information about the ffmpeg-cvslog mailing list