1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-03-28 12:32:17 +02:00

ffmpeg_opt: Add -hwaccels option that lists all supported hwaccels

This commit is contained in:
Timothy Gu 2015-08-25 16:43:53 -07:00
parent 33908f0837
commit da0e76955a
2 changed files with 18 additions and 0 deletions

View File

@ -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. 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. If this option is not specified, the default adapter is used.
@end table @end table
@item -hwaccels
List all hardware acceleration methods supported in this build of ffmpeg.
@end table @end table
@section Audio Options @section Audio Options

View File

@ -166,6 +166,18 @@ static void init_options(OptionsContext *o)
o->accurate_seek = 1; 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 */ /* return a copy of the input with the stream specifiers removed from the keys */
static AVDictionary *strip_specifiers(AVDictionary *dict) static AVDictionary *strip_specifiers(AVDictionary *dict)
{ {
@ -3241,6 +3253,8 @@ const OptionDef options[] = {
#if CONFIG_VDA || CONFIG_VIDEOTOOLBOX #if CONFIG_VDA || CONFIG_VIDEOTOOLBOX
{ "videotoolbox_pixfmt", HAS_ARG | OPT_STRING | OPT_EXPERT, { &videotoolbox_pixfmt}, "" }, { "videotoolbox_pixfmt", HAS_ARG | OPT_STRING | OPT_EXPERT, { &videotoolbox_pixfmt}, "" },
#endif #endif
{ "hwaccels", OPT_EXIT, { .func_arg = show_hwaccels },
"show available HW acceleration methods" },
{ "autorotate", HAS_ARG | OPT_BOOL | OPT_SPEC | { "autorotate", HAS_ARG | OPT_BOOL | OPT_SPEC |
OPT_EXPERT | OPT_INPUT, { .off = OFFSET(autorotate) }, OPT_EXPERT | OPT_INPUT, { .off = OFFSET(autorotate) },
"automatically insert correct rotate filters" }, "automatically insert correct rotate filters" },