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

Timothy Gu git at videolan.org
Thu Aug 27 03:47:11 CEST 2015


ffmpeg | branch: master | Timothy Gu <timothygu99 at gmail.com> | Tue Aug 25 16:43:53 2015 -0700| [da0e76955a08249c593861a5088c20c50a48c6bb] | committer: Timothy Gu

ffmpeg_opt: Add -hwaccels option that lists all supported hwaccels

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

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

diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
index 51a4ec5..f4ffc6c 100644
--- a/doc/ffmpeg.texi
+++ b/doc/ffmpeg.texi
@@ -698,6 +698,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 ffmpeg.
+
 @end table
 
 @section Audio Options
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 40a6e55..c5e6624 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -166,6 +166,18 @@ static void init_options(OptionsContext *o)
     o->accurate_seek  = 1;
 }
 
+static int show_hwaccels(void *optctx, const char *opt, const char *arg)
+{
+    int i;
+
+    printf("Hardware acceleration methods:\n");
+    for (i = 0; i < FF_ARRAY_ELEMS(hwaccels) - 1; i++) {
+        printf("%s\n", hwaccels[i].name);
+    }
+    printf("\n");
+    return 0;
+}
+
 /* return a copy of the input with the stream specifiers removed from the keys */
 static AVDictionary *strip_specifiers(AVDictionary *dict)
 {
@@ -3241,6 +3253,8 @@ const OptionDef options[] = {
 #if CONFIG_VDA || CONFIG_VIDEOTOOLBOX
     { "videotoolbox_pixfmt", HAS_ARG | OPT_STRING | OPT_EXPERT, { &videotoolbox_pixfmt}, "" },
 #endif
+    { "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" },



More information about the ffmpeg-cvslog mailing list