Minh Posted June 6, 2023 Posted June 6, 2023 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! 0 Quote
NicoD Posted June 6, 2023 Posted June 6, 2023 @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. 1 Quote
royk Posted June 6, 2023 Posted June 6, 2023 @Minh I've seen a GitHub of someone who added hw encoding to ffmpeg but can't find it atm. Perhaps this will help you: https://github.com/rigaya/rkmppenc Not sure if this one works for rk3588: https://github.com/jjm2473/ffmpeg-rk 1 Quote
Minh Posted June 7, 2023 Author Posted June 7, 2023 @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" 0 Quote
amazingfate Posted June 7, 2023 Posted June 7, 2023 @Minh do you know what does `omxh264enc` mean? I recommend you to google it first. 1 Quote
Minh Posted June 7, 2023 Author Posted June 7, 2023 (edited) @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 June 7, 2023 by Minh 0 Quote
amazingfate Posted June 7, 2023 Posted June 7, 2023 @MinhYou have to read docs from rockchip: https://gitlab.com/rk3588_linux/linux/bsp/docs/-/tree/linux-5.10-gen-rkr3.5/Linux/Multimedia There should be a lot of guides in the internet world. 1 Quote
Minh Posted June 7, 2023 Author Posted June 7, 2023 Never seen these docs before. Thank @amazingfate 0 Quote
simaidensepul Posted June 9, 2023 Posted June 9, 2023 (edited) 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 June 9, 2023 by Simon Sepulveda 1 Quote
Minh Posted June 13, 2023 Author Posted June 13, 2023 (edited) Thank @simaidensepul! Could you share with me the image/distro you're using? Currently, I have 3 images: 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) ubuntu-22.04.2-preinstalled-server-arm64-orangepi5.img Orangepi5_1.1.4_ubuntu_jammy_server_linux5.10.110.img Thank you very much! Edited June 13, 2023 by Minh 0 Quote
ZZY Posted July 27, 2023 Posted July 27, 2023 Hi, have you solved this problem(use hardware-acceleration to encode/transcode video on Orange Pi 5 using FFmpeg)? How? Thank you 0 Quote
ZZY Posted July 27, 2023 Posted July 27, 2023 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' 0 Quote
royk Posted July 27, 2023 Posted July 27, 2023 (edited) @ZZY For ffmpeg check: https://github.com/hbiyik/FFmpeg rkmppenc is what I use with tvheadend to transcode to hevc. https://github.com/rigaya/rkmppenc For gstreamer you'll need to add the repo of amazingfate. Search packages in apt with "apt search ..." Edited July 27, 2023 by royk 0 Quote
jyce Posted July 3 Posted July 3 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. 0 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.