Encoder - hbiyik/ffmpeg-rockchip GitHub Wiki

Encoder

Overview

The codecs, profiles, levels, bitrates, resolutions, FPS, AFBC, etc. supported by MPP encoders depend on the specific chip capabilities. This chapter uses RK3588 for demonstration.

 V..... h264_rkmpp           Rockchip MPP (Media Process Platform) H264 encoder (codec h264)
 V..... hevc_rkmpp           Rockchip MPP (Media Process Platform) HEVC encoder (codec hevc)

Query encoders

  • Query MPP encoders
./ffmpeg -hide_banner -encoders | grep rkmpp
  • Query MPP encoder options by name
./ffmpeg -hide_banner -h encoder=h264_rkmpp
Encoder h264_rkmpp [Rockchip MPP (Media Process Platform) H264 encoder]:
    General capabilities: delay hardware
    Threading capabilities: none
    Supported hardware devices: rkmpp rkmpp drm
    Supported pixel formats: yuv420p yuv422p yuv444p nv12 nv21 nv16 nv24 yuyv422 yvyu422 uyvy422 rgb24 bgr24 rgba rgb0 bgra bgr0 argb 0rgb abgr 0bgr drm_prime
h264_rkmpp_encoder AVOptions:
  -rc_mode           <int>        E..V....... Set the encoding rate control mode (from 0 to 4) (default 4)
     VBR             0            E..V.......
     CBR             1            E..V.......
     CQP             2            E..V.......
     AVBR            3            E..V.......
  -qp_init           <int>        E..V....... Set the initial QP value (from -1 to 51) (default -1)
  -qp_max            <int>        E..V....... Set the max QP value for P and B frame (from -1 to 51) (default -1)
  -qp_min            <int>        E..V....... Set the min QP value for P and B frame (from -1 to 51) (default -1)
  -qp_max_i          <int>        E..V....... Set the max QP value for I frame (from -1 to 51) (default -1)
  -qp_min_i          <int>        E..V....... Set the min QP value for I frame (from -1 to 51) (default -1)
  -surfaces          <int>        E..V....... Set the maximum surfaces to be used for encoding (from 1 to 16) (default 4)
  -profile           <int>        E..V....... Set the encoding profile restriction (from -1 to 100) (default high)
     baseline        66           E..V.......
     main            77           E..V.......
     high            100          E..V.......
  -level             <int>        E..V....... Set the encoding level restriction (from -99 to 62) (default 0)
     1               10           E..V.......
     1.1             11           E..V.......
     1.2             12           E..V.......
     1.3             13           E..V.......
     2               20           E..V.......
     2.1             21           E..V.......
     2.2             22           E..V.......
     3               30           E..V.......
     3.1             31           E..V.......
     3.2             32           E..V.......
     4               40           E..V.......
     4.1             41           E..V.......
     4.2             42           E..V.......
     5               50           E..V.......
     5.1             51           E..V.......
     5.2             52           E..V.......
     6               60           E..V.......
     6.1             61           E..V.......
     6.2             62           E..V.......
  -coder             <int>        E..V....... Set the entropy coder type (from 0 to 1) (default cabac) (from 0 to 1) (default cabac)
     cavlc           0            E..V.......
     cabac           1            E..V.......
  -8x8dct            <boolean>    E..V....... Set the high profile 8x8 transform (default true)


./ffmpeg -hide_banner -h encoder=hevc_rkmpp
Encoder hevc_rkmpp [Rockchip MPP (Media Process Platform) HEVC encoder]:
    General capabilities: delay hardware
    Threading capabilities: none
    Supported hardware devices: rkmpp rkmpp drm
    Supported pixel formats: yuv420p yuv422p yuv444p nv12 nv21 nv16 nv24 yuyv422 yvyu422 uyvy422 rgb24 bgr24 rgba rgb0 bgra bgr0 argb 0rgb abgr 0bgr drm_prime
hevc_rkmpp_encoder AVOptions:
  -rc_mode           <int>        E..V....... Set the encoding rate control mode (from 0 to 4) (default 4)
     VBR             0            E..V.......
     CBR             1            E..V.......
     CQP             2            E..V.......
     AVBR            3            E..V.......
  -qp_init           <int>        E..V....... Set the initial QP value (from -1 to 51) (default -1)
  -qp_max            <int>        E..V....... Set the max QP value for P and B frame (from -1 to 51) (default -1)
  -qp_min            <int>        E..V....... Set the min QP value for P and B frame (from -1 to 51) (default -1)
  -qp_max_i          <int>        E..V....... Set the max QP value for I frame (from -1 to 51) (default -1)
  -qp_min_i          <int>        E..V....... Set the min QP value for I frame (from -1 to 51) (default -1)
  -surfaces          <int>        E..V....... Set the maximum surfaces to be used for encoding (from 1 to 16) (default 4)
  -profile           <int>        E..V....... Set the encoding profile restriction (from -1 to 1) (default main)
     main            1            E..V.......
  -level             <int>        E..V....... Set the encoding level restriction (from -99 to 186) (default 0)
     1               30           E..V.......
     2               60           E..V.......
     2.1             63           E..V.......
     3               90           E..V.......
     3.1             93           E..V.......
     4               120          E..V.......
     4.1             123          E..V.......
     5               150          E..V.......
     5.1             153          E..V.......
     5.2             156          E..V.......
     6               180          E..V.......
     6.1             183          E..V.......
     6.2             186          E..V.......

Test encoders

  • 1080p H.264, CQP rate control
./ffmpeg -f lavfi -i testsrc2=s=1920x1080,format=nv12 -c:v hevc_rkmpp -qp_init 26 -profile:v main -level 4.1 -g:v 100 -vframes 5000 -y /tmp/tmp.mp4
  • 1080p H.264, CBR rate control
./ffmpeg -f lavfi -i testsrc2=s=1920x1080,format=nv12 -c:v h264_rkmpp -b:v 4M -profile:v high -level 4.1 -g:v 100 -vframes 5000 -y /tmp/tmp.mp4
  • 1080p H.264, VBR rate control
./ffmpeg -f lavfi -i testsrc2=s=1920x1080,format=nv12 -c:v h264_rkmpp -b:v 4M -minrate 2M -maxrate 5M -profile:v high -level 4.1 -g:v 100 -vframes 5000 -y /tmp/tmp.mp4

  • 4K HEVC, VBR rate control
./ffmpeg -f lavfi -i testsrc2=s=3840x2160,format=nv12 -c:v hevc_rkmpp -b:v 15M -minrate 10M -maxrate 20M -profile:v main -level 5.1 -g:v 100 -vframes 5000 -y /tmp/tmp.mp4

  • 8K HEVC, VBR rate control
./ffmpeg -f lavfi -i testsrc2=s=7680x4320,format=nv12 -c:v hevc_rkmpp -b:v 30M -minrate 25M -maxrate 35M -profile:v main -level 6.1 -g:v 100 -vframes 2000 -y /tmp/tmp.mp4
⚠️ **GitHub.com Fallback** ⚠️