ff-rknn revisited. A single thread, cpu/gpu/npu ondemand governor.
The File:
curl -O -J -L https://vod-progressive.akamaized.net/exp=1709328217~acl=%2Fvimeo-prod-skyfire-std-us%2F01%2F2323%2F19%2F486618242%2F2180394928.mp4~hmac=d6d1453f95f315050a666830c2010cfe9c4a3dd5db84913ec862147f585ba29d/vimeo-prod-skyfire-std-us/01/2323/19/486618242/2180394928.mp4?download=1&filename=pexels-george-morina-6059506+(1080p).mp4
g++ -O3 --permissive -o ff-rknn ff-rknn.c postprocess.cc -D_FILE_OFFSET_BITS=64 -D REENTRANT -I./ -I/usr/include/drm -I/usr/include -I/usr/include/SDL2 -lSDL2 -lSDL2_ttf -lz -lm -lpthread -ldrm -lrockchip_mpp -llzma -lrtmp -lssl -lcrypto -lbz2 -lxml2 -lX11 -lxcb -lXv -lXext -lv4l2 -lrga -lva -lxcb-shm -lxcb-xfixes -lxcb-render -lxcb-shape -lxcb -lXau -lXdmcp -lxcb -lxcb-shape -lXmu -lXext -lXi -lv4l2 -lasound -lpulse -lsndio -lGL -lpulse -lGL -lGLESv2 -lsndio -lfreetype -lvorbis -lvorbisenc -lopus -lrknnrt -lmp3lame -L ./lib1.5 -lavutil -lavcodec -lavformat -lavdevice -lavfilter -lswscale -lswresample -lpostproc
-
The project is in the ~/rockchip/npu/ff-rknn path.
-
Decoding a mp4 file, FullHD (1920x1080) resized to 960x580 and positioned at 0,0 (weston):
rock@rock5b:~/rockchip/npu/ff-rknn$ ./ff-rknn -i 2180394928.mp4 -x 960 -y 580 -l 0 -t 0 -m ./model/RK3588/yolov5s-640-640.rknn
Model: ./model/RK3588/yolov5s-640-640.rknn - size: 8502208.
sdk version: 1.5.0 (e6fe0c678@2023-05-25T08:09:20) driver version: 0.8.2
model input num: 1, output num: 3
model: 640x640x3
INFO: SDL: compiled with=2.0.20 linked against=2.0.20
arm_release_ver of this libmali is ‘g6p0-01eac0’, rk_so_ver is ‘6’.
[h264_rkmpp @ 0x557dd4efc0] Decoder noticed an info change (1920x1080), format=0
rga_api version 1.9.3_[0]
loadLabelName ./model/coco_80_labels_list.txt
INFO: Program quit after 5630 ticks
Avg FPS: 23.0
- Decoding an RTSP camera example:
rock@rock5b:~/rockchip/npu/ff-rknn$ ./ff-rknn -f rtsp -i rtsp://192.168.254.205:554/user=admin_password=kiFDlXTz_channel=1_stream=1.sdp?real_stream -m ./model/RK3588/yolov5s-640-640.rknn
Model: ./model/RK3588/yolov5s-640-640.rknn - size: 8502208.
sdk version: 1.5.0 (e6fe0c678@2023-05-25T08:09:20) driver version: 0.8.2
model input num: 1, output num: 3
model: 640x640x3
INFO: SDL: compiled with=2.0.20 linked against=2.0.20
arm_release_ver of this libmali is ‘g6p0-01eac0’, rk_so_ver is ‘6’.
[h264_rkmpp @ 0x55b403a0f0] Decoder noticed an info change (640x360), format=0
rga_api version 1.9.3_[0]
loadLabelName ./model/coco_80_labels_list.txt
INFO: Program quit after 34221 ticks
Avg FPS: 12.3
SD card Image with weston/Wayland with Ubuntu Minimum:
sb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy
OS Image is a bare minimum, specific to my tablet-like needs. HDMI works, the sound needs some workout, Wifi/bt disabled. For educational purposes only, use as is.
sdl2 port attached, SD card to be finished and hosted somewhere…
sdl2_port.patch.zip (1.6 KB)
For HDMI output, change the line in the file /boot/extlinux/extlinux.conf:
DEFAULT kernel-5.10.110-rk3588-v4l2_TABLET
to
DEFAULT kernel-5.10.110-rk3588-v4l2