Go to file
Zhao Zhili b62a678da8 avfilter/dnn: Refactor DNN parameter configuration system
This patch trying to resolve mulitiple issues related to parameter
configuration:

Firstly, each DNN filters duplicate DNN_COMMON_OPTIONS, which should
be the common options of backend.

Secondly, backend options are hidden behind the scene. It's a
AV_OPT_TYPE_STRING backend_configs for user, and parsed by each
backend. We don't know each backend support what kind of options
from the help message.

Third, DNN backends duplicate DNN_BACKEND_COMMON_OPTIONS.

Last but not the least, pass backend options via AV_OPT_TYPE_STRING
makes it hard to pass AV_OPT_TYPE_BINARY to backend, if not impossible.

This patch puts backend common options and each backend options inside
DnnContext to reduce code duplication, make options user friendly, and
easy to extend for future usecase.

For example,

./ffmpeg -h filter=dnn_processing

dnn_processing AVOptions:
   dnn_backend       <int>        ..FV....... DNN backend (from INT_MIN to INT_MAX) (default tensorflow)
     tensorflow      1            ..FV....... tensorflow backend flag
     openvino        2            ..FV....... openvino backend flag
     torch           3            ..FV....... torch backend flag

dnn_base AVOptions:
   model             <string>     ..F........ path to model file
   input             <string>     ..F........ input name of the model
   output            <string>     ..F........ output name of the model
   backend_configs   <string>     ..F.......P backend configs (deprecated)
   options           <string>     ..F.......P backend configs (deprecated)
   nireq             <int>        ..F........ number of request (from 0 to INT_MAX) (default 0)
   async             <boolean>    ..F........ use DNN async inference (default true)
   device            <string>     ..F........ device to run model

dnn_tensorflow AVOptions:
   sess_config       <string>     ..F........ config for SessionOptions

dnn_openvino AVOptions:
   batch_size        <int>        ..F........ batch size per request (from 1 to 1000) (default 1)
   input_resizable   <boolean>    ..F........ can input be resizable or not (default false)
   layout            <int>        ..F........ input layout of model (from 0 to 2) (default none)
     none            0            ..F........ none
     nchw            1            ..F........ nchw
     nhwc            2            ..F........ nhwc
   scale             <float>      ..F........ Add scale preprocess operation. Divide each element of input by specified value. (from INT_MIN to INT_MAX) (default 0)
   mean              <float>      ..F........ Add mean preprocess operation. Subtract specified value from each element of input. (from INT_MIN to INT_MAX) (default 0)

dnn_th AVOptions:
   optimize          <int>        ..F........ turn on graph executor optimization (from 0 to 1) (default 0)

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Reviewed-by: Wenbin Chen <wenbin.chen@intel.com>
Reviewed-by: Guo Yejun <yejun.guo@intel.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2024-05-18 19:59:12 +02:00
compat avutil/common: Don't auto-include mem.h 2024-04-01 19:51:37 +02:00
doc riscv: add Zvbb vector bit manipulation extension 2024-05-11 18:22:55 +02:00
ffbuild riscv: add Zvbb vector bit manipulation extension 2024-05-11 18:22:55 +02:00
fftools fftools/ffplay: Check return of swr_alloc_set_opts2() 2024-05-09 19:04:12 +02:00
libavcodec lavc/libvpxenc: Fix parsing of ts_layering_mode parameter 2024-05-18 19:59:12 +02:00
libavdevice lavd/v4l2: Use proper field type for second parameter of ioctl() with BSD's 2024-05-09 19:04:09 +02:00
libavfilter avfilter/dnn: Refactor DNN parameter configuration system 2024-05-18 19:59:12 +02:00
libavformat avformat: add PDA (PlayDate Audio) demuxer 2024-05-13 10:52:22 +02:00
libavutil avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD 2024-05-18 19:59:12 +02:00
libswresample avutil/common: Don't auto-include mem.h 2024-04-01 19:51:37 +02:00
libswscale swscale/riscv: explicitly require Zbb for MIN 2024-05-11 18:22:53 +02:00
presets
tests checkasm/h264dsp: use int64_t scale values 2024-05-18 19:59:11 +02:00
tools tools/target_enc_fuzzer: Only read pix_fmts if its set 2024-05-09 19:04:11 +02:00
.gitattributes
.gitignore
.mailmap
Changelog update Changelog 2024-05-10 20:48:58 +02:00
configure lavu/riscv: fallback to raw hwprobe() system call 2024-05-14 22:49:48 +02:00
CONTRIBUTING.md
COPYING.GPLv2
COPYING.GPLv3
COPYING.LGPLv2.1
COPYING.LGPLv3
CREDITS
INSTALL.md
LICENSE.md
Makefile riscv: add Zvbb vector bit manipulation extension 2024-05-11 18:22:55 +02:00
README.md
RELEASE RELEASE: update after 7.0 branch 2024-04-03 17:29:51 +02:00

Librempeg README

Librempeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata.

Libraries

  • libavcodec provides implementation of a wider range of codecs.
  • libavformat implements streaming protocols, container formats and basic I/O access.
  • libavutil includes hashers, decompressors and miscellaneous utility functions.
  • libavfilter provides means to alter decoded audio and video through a directed graph of connected filters.
  • libavdevice provides an abstraction to access capture and playback devices.
  • libswresample implements audio mixing and resampling routines.
  • libswscale implements color conversion and scaling routines.

Tools

  • ffmpeg is a command line toolbox to manipulate, convert and stream multimedia content.
  • ffplay is a minimalistic multimedia player.
  • ffprobe is a simple analysis tool to inspect multimedia content.
  • Additional small tools such as aviocat, ismindex and qt-faststart.

Documentation

The offline documentation is available in the doc/ directory.

Examples

Coding examples are available in the doc/examples directory.

License

Librempeg codebase is mainly LGPL-licensed with optional components licensed under GPL. Please refer to the LICENSE file for detailed information.

Contributing

Contributing can be done via Github pull requests.