Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Rock64: Hardware acceleration with FFmpeg

Featured Replies

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 by Gustavo A. Díaz

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.

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.

  • Author

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.

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.

  • Author

@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.

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.

 

  • Author

@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.

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 by Kwinz

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.