目前需要在 RK3568 上播放多路视频,比如 16 路 720P 视频。总结了以下几种方案。
1. 使用 libyuv 将 YUV 转成 RGB 后播放。优点是 libyuv 可以调用各个平台的 SIMD 硬件加速进行转码,可以在自己的电脑上调试好之后再烧录。
2. 使用 rga 将 YUV 转成 RGB 后播放。性能比 libyuv 高,但仅支持瑞芯微平台,需要烧录之后才能调试。
3. 使用 OpenGL 将 YUV 转成 RGB 后播放。优点是可以利用闲置的 GPU 资源,不增加 CPU 负担,但有爆显存的风险(遇到过几次)。也许可以增加显存来解决,但没有实操过。
最近在看使用 DRM/Wayland 直接播放 YUV,但是不知道怎么和 Qt 结合起来,因为需要用到 Qt 的按钮、输入框、菜单这些控件。因为 Wayland/DRM 是支持支持 YUV 的格式的,使用 gstreamer 的多路 waylandsink 播放视频可以观察到 CPU 的占用只有方案一的三分之二。
至于 Wayland/DRM 是怎么支持 YUV 的,目前还不清楚,推测也是转成 RGB,但应该在内存拷贝等方面有优势。
想用 u-boot 去烧录固件到 SD NAND,之前用的是晕哥的镜像挂载 U 盘。
看了很多论坛的教程,都是用的 2017 的 u-boot,确实在改了之后支持 tftp,但不想用旧的。感觉全志有点偏心,h3 的支持明显比 v3s 好,不用改就能支持 tftp。
现在 linux、u-boot、buildroot 都是主线最新的,舒服了。
已经发邮件提交合并申请,第一次发,还要弄 Signed-off-by,好麻烦,不知道什么时候能合并。
https://github.com/u-boot/u-boot/pull/430
不能写 0x44000000 之后的地址,被 linux-sunxi 的教程坑了,它说 0x48000000。
U-Boot SPL 2023.10-rc4-gb9b83a86-dirty (Sep 23 2023 - 15:47:57 +0800)
DRAM: 64 MiB
Trying to boot from MMC1
U-Boot 2023.10-rc4-gb9b83a86-dirty (Sep 23 2023 - 15:47:57 +0800) Allwinner Technology
CPU: Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM: 64 MiB
Core: 34 devices, 15 uclasses, devicetree: separate
WDT: Not starting watchdog@1c20ca0
MMC: mmc@1c0f000: 0
Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1...
In: serial@1c28000
Out: serial@1c28000
Err: serial@1c28000
Net: eth0: ethernet@1c30000
Hit any key to stop autoboot: 0
=> setenv ipaddr 169.254.1.216
=> setenv serverip 169.254.1.114
=> mw.b 0x41000000 0x0 0x400
=> tftp 0x41000000 u-boot/u-boot-sunxi-with-spl.bin
ethernet@1c30000 Waiting for PHY auto negotiation to complete. done
Using ethernet@1c30000 device
TFTP from server 169.254.1.114; our IP address is 169.254.1.216
Filename 'u-boot/u-boot-sunxi-with-spl.bin'.
start: 0x40000000, size: 0x4000000
image_load_addr 0x41000000
Load address: 0x41000000
Loading: ################################
1.2 MiB/s
done
Bytes transferred = 459788 (7040c hex)