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.

How I can use hardware-acceleration to encode/transcode video on Orange Pi 5 using FFmpeg? (or I need to use gstreamer?)

Featured Replies

I searched & tried all materials I can find, trying to set up FFmpeg to work with hardware acceleration on Orange Pi 5.

But it did NOT work. 

Anyone else succeeds in using GPU hardware acceleration to encode/transcode video on Orange Pi 5 using FFmpeg? (or using gstreamer?)

Could you please share with me the way to do it?

 

Thank you very much indeed!

@MinhIt is not GPU hw acc but VPU you need.
Are you using the @amazingfate multimedia ppa?
 

sudo add-apt-repository ppa:liujianfeng1994/panfork-mesa            #Panfork GPU ppa
sudo add-apt-repository ppa:liujianfeng1994/rockchip-multimedia     #Multimedia ppa for VPU acceleration
sudo apt update
sudo apt dist-upgrade
sudo apt install mali-g610-firmware rockchip-multimedia-config

I suspect you might need gstreamer. That's included. My knowledge ain't great in these things, so maybe amazingfate or someone else can add to it.

  • Author

@NicoD Thank you, I tried it before but it doesn't work. I also installed gstreamer:

# gst-launch-1.0 filesrc location=Screen_Recording.mp4 ! decodebin ! videoconvert ! omxh264enc ! video/x-h264, width=1280, height=720 ! mp4mux ! filesink location=output_hwaccel_omx.mp4 

WARNING: erroneous pipeline: no element "omxh264enc"

 

  • Author

@amazingfate yeah it's just one option I tried. I tried many options for each hwaccels, encoders, decoders,... it doesn't work. 

Surprisingly, we don't have an good guide for an essentials task like this...

Edited by Minh

After some research, I achieved the video encoding with hw accelerate with gstreamer, both h264 and h265 codecs. For this, you have to use mpph264enc/mpph265enc options (h264/h265) , and also  gstreamer1.0-rockchip. There are the full installation steps:

 

- For 3d hw drivers:

 

sudo add-apt-repository ppa:liujianfeng1994/panfork-mesa            
sudo add-apt-repository ppa:liujianfeng1994/rockchip-multimedia     
sudo apt update
sudo apt dist-upgrade
sudo apt install mali-g610-firmware rockchip-multimedia-config

 

- Install gstreamer and some plugins:

 

sudo apt install gstreamer1.0-rockchip
sudo apt install gstreamer1.0-plugins-base-apps
sudo apt install gstreamer1.0-plugins-bad
sudo apt install gstreamer1.0-plugins-good

 

- Use gstreamer, in this case getting the video from an usb webcam
 

# for h264
gst-launch-1.0 v4l2src device=/dev/video0 ! image/jpeg,width=640,height=480,framerate=30/1 ! jpegdec ! mpph264enc ! h264parse ! mp4mux ! filesink location=test_h264.mp4 -e

# for h265
gst-launch-1.0 v4l2src device=/dev/video0 ! image/jpeg,width=640,height=480,framerate=30/1 ! jpegdec ! mpph265enc ! h265parse ! mp4mux ! filesink location=test_h265.mp4 -e

 

 

I'm still getting used to gstreamer, so any advice about the usability is welcome, and also I will update this post if I found any improvement

 

 

 

Edited by Simon Sepulveda

  • Author

Thank @simaidensepul! Could you share with me the image/distro you're using?

Currently, I have 3 images:

  1. Armbian_23.5.1_Orangepi5_jammy_legacy_5.10.160_gnome_desktop.img (and Armbian_23.5.1_Orangepi5_jammy_legacy_5.10.160.img) 

  2. ubuntu-22.04.2-preinstalled-server-arm64-orangepi5.img

  3. Orangepi5_1.1.4_ubuntu_jammy_server_linux5.10.110.img

Thank you very much! 

Edited by Minh

Hi, have you solved this problem(use hardware-acceleration to encode/transcode video on Orange Pi 5 using FFmpeg)? How? Thank you

sudo apt install gstreamer1.0-rockchip 
ERROR:
E: Unable to locate package gstreamer1.0-rockchip
E: Couldn't find any package by glob 'gstreamer1.0-rockchip'

I use this version https://github.com/nyanmisaka/ffmpeg-rockchip
of ffmpeg with Orange Pi5+ (rockchip-rk3588) Linux Debian.

 

For my test, the input.mp4 file is a 60 second recording from rtsp Reolink h264 Camera.
 

% ffmpeg -i input.mp4 -c:v h264_rkmpp -c:a aac -y output-h264.mp4

Input: Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 2560x1920, 8348 kb/s, 29.72 fps, 30 tbr, 90k tbn (default)
Output:  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 2560x1920, q=2-31, 2000 kb/s, 30 fps, 15360 tbn (default)

frame= 1804 fps=131 q=-0.0 Lsize=   15327kB time=00:01:00.10 bitrate=2089.1kbits/s dup=20 drop=1 speed=4.38x    
 

% ffmpeg -i input.mp4 -c:v hevc_rkmpp -c:a aac -y output-hevc.mp4

Input: Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 2560x1920, 8348 kb/s, 29.72 fps, 30 tbr, 90k tbn (default)

Output:  Stream #0:0(und): Video: hevc (Main) (hev1 / 0x31766568), yuv420p(progressive), 2560x1920, q=2-31, 2000 kb/s, 30 fps, 15360 tbn (default)

frame= 1804 fps=128 q=-0.0 Lsize=   15299kB time=00:01:00.10 bitrate=2085.3kbits/s dup=20 drop=1 speed=4.26x    
 

% du -b input.mp4 output-h264.mp4 output-hevc.mp4

63077390        input.mp4
15913277        output-h264.mp4
15978009        output-hevc.mp4

 

The rate of hardware encoding is around 130 fps with h264_rkmpp or hevc_rkmpp.

From a human perspective, there's no video quality difference between these files.
 

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.

Guest
Reply to this topic...

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.