VPU

From FriendlyELEC WiKi
Revision as of 06:24, 17 January 2024 by Tzs (Talk | contribs) (updated by API)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

查看中文

1 How to test VPU

1.1 OS

Tested on the following OS:

1.1.1 Debian11 (bullseye)

  • rk3588-sd-debian-bullseye-desktop-6.1-arm64-20240116.img.gz
  • rk3568-sd-debian-bullseye-desktop-6.1-arm64-20231113.img.gz

1.1.2 Ubuntu20 (focal)

  • rk3588-sd-ubuntu-focal-desktop-6.1-arm64-20240116.img.gz

1.2 Re-compile mpp (optional)

sudo apt update
sudo apt install gcc g++ cmake make
cd ~
git clone https://github.com/friendlyarm/mpp
    # Or git clone https://github.com/rockchip-linux/mpp.git
cd mpp/build/linux/aarch64/
sed -i 's/aarch64-linux-gnu-gcc/gcc/g' ./arm.linux.cross.cmake
sed -i 's/aarch64-linux-gnu-g++/g++/g' ./arm.linux.cross.cmake
./make-Makefiles.bash
make -j$(nproc)
sudo make install
cd test
sudo cp mpp_info_test /usr/local/bin/mpp_info_test
sudo cp mpi_dec_test /usr/local/bin/mpi_dec_test
sudo cp mpi_enc_test /usr/local/bin/mpi_enc_test

1.3 Check mpp version

mpp_info_test
tail /var/log/messages

1.4 Test hardware video decoding

wget http://112.124.9.243/test/200frames_count.h264 -O 200frames_count.h264
mpi_dec_test -t 7 -i 200frames_count.h264
tail /var/log/messages

1.5 Test hardware video encoding

Encoding nv12 video streams to h264:

wget http://112.124.9.243/test/4k_nv12.yuv.tar.gz -O 4k_nv12.yuv.tar.gz
tar xzf 4k_nv12.yuv.tar.gz
mpi_enc_test -w 3840 -h 2160 -t 7 -i 4k_nv12.yuv -f 0 -o 4k_nv12.h264
tail /var/log/messages

Packaged as playable mp4 file:

ffmpeg -i 4k_nv12.h264 -vcodec copy -f mp4 4k_nv12.mp4

Note: The above video stream file 4k_nv12.yuv was grabbed on the T6 via HDMI-In with the following command:

v4l2-ctl  -d /dev/video0 --set-fmt-video=width=3840,height=2160,pixelformat='NV12' --stream-mmap=4 --stream-skip=10  --stream-to=/tmp/4k_nv12.yuv --stream-count=240 --stream-poll