測試VPU
編譯mpp
sudo apt update
sudo apt install gcc g++ cmake make
cd ~
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
查看mpp版本
mpp_info_test
tail /var/log/syslog
測試硬解碼
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/syslog
mpi_dec_test: decode 200 frames time 213 ms delay 3 ms fps 934.71
- 這條日志詳細記錄了解碼性能的關鍵指標:
- 解碼了200幀
- 總耗時213毫秒
- 平均每幀延遲3毫秒
- 幀率為934.71 FPS(每秒幀數),這是一個非常高的幀率,顯示了解碼過程的高效性。
測試硬編碼
wget http://112.124.9.243/test/4k_nv12.yuv.gz -O 4k_nv12.yuv.gz
gzip -d 4k_nv12.yuv.gz
mpi_enc_test -w 3840 -h 2160 -t 7 -i 4k_nv12.yuv -f 0 -o 4k_nv12.h264
tail /var/log/syslog
mpi_enc_test: chn 0 encode 241 frames time 31623 ms delay 107 ms fps 7.62 bps 32174975
- 這條信息提供了編碼任務的性能匯總:
encode 241 frames
表示共編碼了241幀。time 31623 ms
表示總耗時約31秒。delay 107 ms
表示平均每幀延遲107 毫秒。fps 7.62
表示平均每秒編碼約7.62 幀,顯示編碼速度。bps 32174975
表示平均每秒傳輸的比特數,即編碼的視頻流的比特率。