Jump to content

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


Minh

Recommended Posts

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines