mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-24 02:20:56 +01:00
14
Encoder
Nyanmisaka edited this page 2025-09-26 18:53:34 +08:00
Table of Contents
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)
V..... mjpeg_rkmpp Rockchip MPP (Media Process Platform) MJPEG encoder (codec mjpeg)
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: gray yuv420p yuvj420p yuv422p yuvj422p yuv444p yuvj444p 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 6) (default 6)
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)
-intra_refresh <boolean> E..V....... Use Intra Refresh instead of IDR frames (default false)
-refresh_mode <int> E..V....... Set the Intra Refresh mode (from 0 to 1) (default row)
row 0 E..V....... Refresh by MB row
col 1 E..V....... Refresh by MB column
-refresh_num <int> E..V....... Set how many MB rows or columns refresh each time (from 1 to INT_MAX) (default 1)
-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)
-udu_sei <boolean> E..V....... Pass on user data unregistered SEI if available (default false)
-prefix_mode <boolean> E..V....... Add prefix NAL between SEI info and encoded bitstream data (default false)
./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: gray yuv420p yuvj420p yuv422p yuvj422p yuv444p yuvj444p 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 6) (default 6)
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)
-intra_refresh <boolean> E..V....... Use Intra Refresh instead of IDR frames (default false)
-refresh_mode <int> E..V....... Set the Intra Refresh mode (from 0 to 1) (default row)
row 0 E..V....... Refresh by MB row
col 1 E..V....... Refresh by MB column
-refresh_num <int> E..V....... Set how many MB rows or columns refresh each time (from 1 to INT_MAX) (default 1)
-profile <int> E..V....... Set the encoding profile restriction (from -1 to 1) (default main)
main 1 E..V.......
-tier <int> E..V....... Set the encoding profile tier restriction (from 0 to 1) (default high)
main 0 E..V.......
high 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.......
-udu_sei <boolean> E..V....... Pass on user data unregistered SEI if available (default false)
./ffmpeg -hide_banner -h encoder=mjpeg_rkmpp
Encoder mjpeg_rkmpp [Rockchip MPP (Media Process Platform) MJPEG encoder]:
General capabilities: delay hardware
Threading capabilities: none
Supported hardware devices: rkmpp rkmpp drm
Supported pixel formats: yuv420p yuvj420p yuv422p yuvj422p yuv444p yuvj444p nv12 nv21 nv16 nv24 yuyv422 uyvy422 yvyu422 rgb444be bgr444be rgb555be bgr555be rgb565be bgr565be rgba rgb0 bgra bgr0 argb 0rgb abgr 0bgr x2rgb10be x2bgr10be drm_prime
mjpeg_rkmpp_encoder AVOptions:
-qp_init <int> E..V....... Set the initial QP/Q_Factor value (from -1 to 99) (default -1)
-qp_max <int> E..V....... Set the max QP/Q_Factor value (from -1 to 99) (default -1)
-qp_min <int> E..V....... Set the min QP/Q_Factor value (from -1 to 99) (default -1)
-chroma_fmt <int> E..V....... Specify the output chroma format for down subsampling (from -1 to 7) (default 0)
auto -1 E..V.......
400 1 E..V.......
420 4 E..V.......
422 5 E..V.......
444 7 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 (low latency, disable async encoding)
./ffmpeg -f lavfi -i testsrc2=s=1920x1080,format=nv12 -c:v h264_rkmpp -flags +low_delay -b:v 4M -minrate 2M -maxrate 5M -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
- 1080p MJPEG, CQP rate control (low latency, disable async encoding)
./ffmpeg -f lavfi -i testsrc2=s=1920x1080,format=bgra -c:v mjpeg_rkmpp -flags +low_delay -qp_init 80 -vframes 1000 -y /tmp/tmp%d.jpg
- 1080p MJPEG, CQP rate control
./ffmpeg -f lavfi -i testsrc2=s=1920x1080,format=bgra -c:v mjpeg_rkmpp -qp_init 80 -vframes 1000 -y /tmp/tmp%d.jpg