Skip to content

MPP

MPP (Media Process Platform) is the hardware encoding and decoding framework for Rockchip platforms, providing 4K ultra‑HD hardware encoding and decoding capabilities. It is suitable for Debian / Ubuntu systems.

Specifications Overview

Hardware Decoding

Codec Format Specification Max Resolution / Frame Rate
H.265 HEVC Main10 L5.1 yuv444 4K@120fps
H.264 AVC High10 L5.1 yuv422 4K@60fps
H.264 MVC 1080P@60fps
VP9 Profile 0/2 L5.1 4K@120fps
AVS2 Profile 0/2 L10.2.6 4K@120fps
AV1 Main10 L5.3 4K@120fps

Hardware Encoding

Codec Format Max Resolution / Frame Rate
H.264 AVC 4K@60fps
H.265 HEVC 4K@60fps

Debugging

Enable debugging:

export mpp_syslog_perror=1
echo 0x100 > /sys/module/rk_vcodec/parameters/mpp_dev_debug

After enabling, when hardware codec is called, dmesg will output the time taken for each frame:

[  893.134037] rk_vcodec: 27b00100.rkvdec:0 session 3705:19 time: 1333 us hw 1312 us
[  893.167444] rk_vcodec: 27b00100.rkvdec:0 session 3705:19 time: 1381 us hw 1313 us
[  893.200503] rk_vcodec: 27b00100.rkvdec:0 session 3705:19 time: 1420 us hw 1313 us

Note

time: total software + hardware time; hw: pure hardware time

Disable debugging:

export mpp_syslog_perror=0
echo 0 > /sys/module/rk_vcodec/parameters/mpp_dev_debug

Hardware Encoding Test

Use the mpi_enc_test tool to test hardware encoding. Check results with tail -f /var/log/syslog.

H.264 Encoding — 4K 100 frames:

mpi_enc_test -w 4096 -h 2160 -t 7 -o ./test.h264 -n 100

Example output:

kickpi mpp[3557]: mpi_enc_test: chn 0 encode 100 frames time 3763 ms delay 27 ms fps 26.57 bps 10605252

H.265 Encoding — 4K 100 frames:

mpi_enc_test -w 4096 -h 2160 -t 16777220 -o ./test.h265 -n 100

Example output:

kickpi mpp[3560]: mpi_enc_test: chn 0 encode 100 frames time 4086 ms delay 36 ms fps 24.47 bps 19594276

Hardware Decoding Test

Use the mpi_dec_test tool to test hardware decoding. Check results with tail -f /var/log/syslog.

H.264 Decoding — 4K 100 frames:

mpi_dec_test -t 7 -i test.h264 -n 100

Example output:

kickpi mpp[3564]: mpi_dec_test: decode 100 frames time 596 ms delay 25 ms fps 167.53

H.265 Decoding — 4K 100 frames:

mpi_dec_test -t 16777220 -i test.h265 -n 100

Example output:

kickpi mpp[3569]: mpi_dec_test: decode 100 frames time 803 ms delay 49 ms fps 124.47

Browser Video Test (Chromium)

Connect a display to the board and run the following command to launch the Chromium video test:

source /rockchip-test/chromium/test_chromium_with_video.sh

If Chromium does not use hardware decoding, run the fix script:

source /rockchip-test/chromium/chromium_mpp_fix.sh

Note

After configuration, Chromium will use hardware decoding by default.

GStreamer Video Test

The presence of mpp in the logs indicates that hardware decoding has been successfully invoked.

sudo GST_DEBUG=2 gst-launch-1.0 playbin uri=file:///usr/local/test.mp4 video-sink="autovideosink" audio-sink=fakesink

To enable hardware decoding in GStreamer, run the fix script (network connection required):

source /rockchip-test/gstreamer/gstreamer_mpp_fix.sh

Compatibility Note: On Ubuntu systems, hardware decoding configurations for Rockchip Chromium and GStreamer are mutually exclusive. Chromium hardware decoding is prioritised by default. To switch to GStreamer, run the fix script above.