Gustavo A. Díaz Posted August 22, 2020 Posted August 22, 2020 (edited) Armbianmonitor: http://ix.io/2uTB Hi, I need some guide and steps required (and if possible) to enable hardware acceleration using FFmpeg. Is the only thing I need since the idea is to use this SBC as Surveillance platform (for example, with Motion+Motioneye or Shinobi). Currencly without hardware accel, using 3 rtsp cams uses each 100% of a core (which translate to 300%). I've searching a lot, but I saw hwaccel with others apps, but not in particular with ffmpeg. I already managed to compile it with --enable-rkmpp (h264_rkmpp hevc_rkmpp vp8_rkmpp vp9_rkmpp) and available hwaccels: vdpau cuda vaapi drm opencl. Any help will be much appreciated. Currently fresh installed OS: Armbian Focal Thanks in advance. Edited August 23, 2020 by Gustavo A. Díaz 0 Quote
Igor Posted August 22, 2020 Posted August 22, 2020 2 hours ago, gusarg81 said: Currently fresh installed OS: Armbian Focal I think basic conditions for possible having some hw acceleration support is coming with 5.7.y kernel. In 5.4.y, there is no support at all AFAIK. Its not my field, so I don't know how to proceed to get this working. 0 Quote
Tido Posted August 22, 2020 Posted August 22, 2020 6 hours ago, gusarg81 said: hwaccel I don't know if you need decoding, endcoding or both. It is maybe not updated for the latest armbian release @JMCC ? but it maybe inspires you and/or work with JMCC on an update if it is on Gitlab/hub https://forum.armbian.com/topic/9310-rk3328-media-script-rock64-renegade/ 0 Quote
JMCC Posted August 23, 2020 Posted August 23, 2020 Currently, FFmpeg only supports HW decoding for rockchips, not encoding. Acceleration on mainline kernel is a work in progress, so I still recommend the legacy 4.4 kernel for video tasks. 17 hours ago, Gustavo A. Díaz said: I already managed to compile it adding encoders h264_rkmpp hevc_rkmpp vp8_rkmpp vp9_rkmpp You need the legacy kernel for these codecs to work. And, again, they are only for decoding. If you want HW encoding, then you need to use gstreamer with the rockchip plugin. 1 Quote
Gustavo A. Díaz Posted August 23, 2020 Author Posted August 23, 2020 Hi, Thanks all for the reply. Currently installed the latest armbian with 5.7. So @JMCC, I can install linux-image-legacy-rockchip (4.4.213) to avoid reinstall all again, right? Thanks. 0 Quote
JMCC Posted August 23, 2020 Posted August 23, 2020 47 minutes ago, Gustavo A. Díaz said: I can install linux-image-legacy-rockchip (4.4.213) to avoid reinstall all again, right? Yes, you can do that. Besides, you will probably also need to sort out the permissions for the VPU kernel nodes. Better try first to run FFmpeg/gstreamer as root, to make sure everything is working. In any case, you can also try a legacy Bionic image, and install my media script, which will configure everything automatically in a few minutes. 0 Quote
Gustavo A. Díaz Posted August 26, 2020 Author Posted August 26, 2020 @JMCC Hi! Thanks for the tips. Quote you will probably also need to sort out the permissions for the VPU kernel nodes How I can do that? Actually I would to prefer to compile all by hand, so what I need is: - libmali - rockchip-vcodec (https://github.com/Miouyouyou/rockchip-vcodec -> this is the right repository? ) - mpp (https://github.com/rockchip-linux/mpp) - gstreamer-rockchip (https://github.com/rockchip-linux/gstreamer-rockchip) - gstreamer-rockchip-extras (https://github.com/rockchip-linux/gstreamer-rockchip-extra) - ffmpeg (compiled with --enable-rkmpp and what else?) Anything else I am missing (or not necessary from this list)? BTW, last time I've compiled gstreamer-rockchip, I don't know why the compiled version does not include mpph264enc. Thanks in advance. 0 Quote
JMCC Posted August 26, 2020 Posted August 26, 2020 2 hours ago, Gustavo A. Díaz said: How I can do that? By checking the rules in /etc/udev/rules.d . I think there is something broken for rk3328 until you use my script. More specifically, I think Armbian defines the mali node as "/dev/mali0", as for rk3399, while rk3328 uses "/dev/mali". I want to find some time to check it out. 2 hours ago, Gustavo A. Díaz said: Anything else I am missing (or not necessary from this list)? You can look in my script, there is info about the sources on each directory. 0 Quote
Gustavo A. Díaz Posted October 1, 2020 Author Posted October 1, 2020 @JMCCnot all the dirs have sources info. Also would be nice to know the options to used to compile the libs in your script if possible, so one can compile it by hand. Thanks. 0 Quote
JMCC Posted October 1, 2020 Posted October 1, 2020 I have plans to incorporate the media packages compilation into the build script. Let's see if I get the chance to do it 2 Quote
Kwinz Posted October 14, 2021 Posted October 14, 2021 (edited) Did you ever try H.264 hardware encoding on the Rock64? What was your experience with the quality? On my Raspberry Pi 4 I did hardware encode my webcam stream for a while, but the quality was so much worse at similar bitrate than libx264, that I ended up using software encoding after all. Edited October 14, 2021 by Kwinz 0 Quote
JMCC Posted October 16, 2021 Posted October 16, 2021 On 10/14/2021 at 9:15 AM, Kwinz said: Did you ever try H.264 hardware encoding on the Rock64? No, I don't own a Rock64. I only tried HW encoding on the Tinker Board (RK3288), and quality was quite acceptable. 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.