2. 编码参数

支持的编码参数,可通过ffmpeg -h查看帮助文档,如:

ffmpeg -h encoder=hevc_mxenc

支持的硬件编码器包含h264_mxenchevc_mxencmjpeg_mxenc

h264_mxenc上查看编码参数,如下所示:

ffmpeg version n4.4.3-39-g1914aedcc1-VERSION--build_data:2025-04-04_04:56:43,branch:,commit_id:1914aedcc1 Copyright (c) 2000-2022 the FFmpeg developers
   built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
   configuration: --disable-asm --enable-metax --enable-shared --enable-cross-compile --enable-gpl --enable-libx264 --enable-libx265 --enable-libaom --enable-libdavs2 --enable-libxavs2 --enable-libopus --enable-libfreetype --enable-libvmaf --enable-version3 --enable-avresample --disable-sndio --disable-xlib --disable-alsa --disable-sdl2 --extra-version='VERSION--build_data:2025-04-04_04:56:43,branch:,commit_id:1914aedcc1' --extra-cflags=-I/workspace/out/Release/mxc500-2.32.0.1/linux/x86_64/include --extra-cflags=-I/workspace/out/Release/mxc500-2.32.0.1/linux/x86_64/include/mcr --extra-cflags=-I/workspace/out/Release/mxc500-2.32.0.1/linux/x86_64/ffmpeg/thirdparty/include --extra-ldflags=-L/workspace/out/Release/mxc500-2.32.0.1/linux/x86_64/lib --extra-ldflags=-L/workspace/out/Release/mxc500-2.32.0.1/linux/x86_64/ffmpeg/thirdparty/lib --extra-libs=-lmcruntime --extra-libs=-lmxkw --extra-libs=-lmxc-runtime64 --extra-libs=-lmcimage --prefix=/workspace/out/Release/mxc500-2.32.0.1/linux/x86_64/ffmpeg
   libavutil      56. 70.100 / 56. 70.100
   libavcodec     58.134.100 / 58.134.100
   libavformat    58. 76.100 / 58. 76.100
   libavdevice    58. 13.100 / 58. 13.100
   libavfilter     7.110.100 /  7.110.100
   libavresample   4.  0.  0 /  4.  0.  0
   libswscale      5.  9.100 /  5.  9.100
   libswresample   3.  9.100 /  3.  9.100
   libpostproc    55.  9.100 / 55.  9.100
Encoder h264_mxenc [METAX VPUE H.264 encoder]:
      General capabilities: delay hardware
      Threading capabilities: none
      Supported hardware devices: metax metax
      Supported pixel formats: yuv420p yuv420p10le nv12 p010le metax
h264_mxenc AVOptions:
   -preset            <int>        E..V....... Set the encoding preset (from 0 to 5) (default faster)
      veryfast        0            E..V.......
      faster          1            E..V.......
      fast            2            E..V.......
      medium          3            E..V.......
      slow            4            E..V.......
      slower          5            E..V.......
   -profile           <int>        E..V....... Set the encoding profile (from -1 to 3) (default auto)
      auto            -1           E..V.......
      baseline        0            E..V.......
      main            1            E..V.......
      high            2            E..V.......
      high10          3            E..V.......
   -level             <int>        E..V....... Set the encoding level restriction (from -1 to 99) (default auto)
      auto            -1           E..V.......
      1               10           E..V.......
      1.0             10           E..V.......
      1b              99           E..V.......
      1.0b            99           E..V.......
      1.1             11           E..V.......
      1.2             12           E..V.......
      1.3             13           E..V.......
      2               20           E..V.......
      2.0             20           E..V.......
      2.1             21           E..V.......
      2.2             22           E..V.......
      3               30           E..V.......
      3.0             30           E..V.......
      3.1             31           E..V.......
      3.2             32           E..V.......
      4               40           E..V.......
      4.0             40           E..V.......
      4.1             41           E..V.......
      4.2             42           E..V.......
      5               50           E..V.......
      5.0             50           E..V.......
      5.1             51           E..V.......
      5.2             52           E..V.......
      6               60           E..V.......
      6.0             60           E..V.......
      6.1             61           E..V.......
      6.2             62           E..V.......
   -tune              <int>        E..V....... Video quality for different target (from -1 to 0) (default auto)
      auto            -1           E..V.......
      psnr            0            E..V.......
   -rc                <int>        E..V....... Override the preset rate-control (from -1 to 4) (default auto)
      auto            -1           E..V.......
      cbr             1            E..V....... Constant bitrate mode
      vbr             2            E..V....... Variable bitrate mode
      crf             3            E..V....... Constant rate factor mode
      constqp         4            E..V....... Constant QP mode
.......

hevc_mxenc上查看编码参数,如下所示:

 ffmpeg version n4.4.3-39-g1914aedcc1-VERSION--build_data:2025-04-04_04:56:43,branch:,commit_id:1914aedcc1 Copyright (c) 2000-2022 the FFmpeg developers
    built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
    configuration: --disable-asm --enable-metax --enable-shared --enable-cross-compile --enable-gpl --enable-libx264 --enable-libx265 --enable-libaom --enable-libdavs2 --enable-libxavs2 --enable-libopus --enable-libfreetype --enable-libvmaf --enable-version3 --enable-avresample --disable-sndio --disable-xlib --disable-alsa --disable-sdl2 --extra-version='VERSION--build_data:2025-04-04_04:56:43,branch:,commit_id:1914aedcc1' --extra-cflags=-I/workspace/out/Release/mxc500-2.32.0.1/linux/x86_64/include --extra-cflags=-I/workspace/out/Release/mxc500-2.32.0.1/linux/x86_64/include/mcr --extra-cflags=-I/workspace/out/Release/mxc500-2.32.0.1/linux/x86_64/ffmpeg/thirdparty/include --extra-ldflags=-L/workspace/out/Release/mxc500-2.32.0.1/linux/x86_64/lib --extra-ldflags=-L/workspace/out/Release/mxc500-2.32.0.1/linux/x86_64/ffmpeg/thirdparty/lib --extra-libs=-lmcruntime --extra-libs=-lmxkw --extra-libs=-lmxc-runtime64 --extra-libs=-lmcimage --prefix=/workspace/out/Release/mxc500-2.32.0.1/linux/x86_64/ffmpeg
    libavutil      56. 70.100 / 56. 70.100
    libavcodec     58.134.100 / 58.134.100
    libavformat    58. 76.100 / 58. 76.100
    libavdevice    58. 13.100 / 58. 13.100
    libavfilter     7.110.100 /  7.110.100
    libavresample   4.  0.  0 /  4.  0.  0
    libswscale      5.  9.100 /  5.  9.100
    libswresample   3.  9.100 /  3.  9.100
    libpostproc    55.  9.100 / 55.  9.100
 Encoder hevc_mxenc [METAX VPUE HEVC encoder]:
       General capabilities: delay hardware
       Threading capabilities: none
       Supported hardware devices: metax metax
       Supported pixel formats: yuv420p yuv420p10le nv12 p010le metax
 hevc_mxenc AVOptions:
    -preset            <int>        E..V....... Set the encoding preset (from 0 to 5) (default fast)
       veryfast        0            E..V.......
       faster          1            E..V.......
       fast            2            E..V.......
       medium          3            E..V.......
       slow            4            E..V.......
       slower          5            E..V.......
    -profile           <int>        E..V....... Set the encoding profile (from -1 to 3) (default auto)
       auto            -1           E..V.......
       main            0            E..V.......
       mainstillpicture 1            E..V.......
       main10          2            E..V.......
       rext            3            E..V.......
    -level             <int>        E..V....... Set the encoding level restriction (from -1 to 186) (default auto)
       auto            -1           E..V.......
       1               30           E..V.......
       1.0             30           E..V.......
       2               60           E..V.......
       2.0             60           E..V.......
       2.1             63           E..V.......
       3               90           E..V.......
       3.0             90           E..V.......
       3.1             93           E..V.......
       4               120          E..V.......
       4.0             120          E..V.......
       4.1             123          E..V.......
       5               150          E..V.......
       5.0             150          E..V.......
       5.1             153          E..V.......
       5.2             156          E..V.......
       6               180          E..V.......
       6.0             180          E..V.......
       6.1             183          E..V.......
       6.2             186          E..V.......
    -tune              <int>        E..V....... Video quality for different target (from -1 to 0) (default auto)
       auto            -1           E..V.......
       psnr            0            E..V.......
    -rc                <int>        E..V....... Override the preset rate-control (from -1 to 4) (default auto)
       auto            -1           E..V.......
       cbr             1            E..V....... Constant bitrate mode
       vbr             2            E..V....... Variable bitrate mode
       crf             3            E..V....... Constant rate factor mode
       constqp         4            E..V....... Constant QP mode
.......