Download ffmpeg from jellyfin repo, it has rockchip support:
https://repo.jellyfin.org/?path=/ffmpeg/debian/latest-7.x/arm64
for example:
wget "https://repo.jellyfin.org/files/ffmpeg/debian/latest-7.x/arm64/jellyfin-ffmpeg7_7.1.1-7-bookworm_arm64.deb"
install it:
sudo dpkg -i jellyfin-ffmpeg7_7.1.1-7-bookworm_arm64.deb
sudo apt-get install -f
create links:
sudo ln -s /usr/lib/jellyfin-ffmpeg/ffmpeg /usr/local/bin/ffmpeg
sudo ln -s /usr/lib/jellyfin-ffmpeg/ffprobe /usr/local/bin/ffprobe
install requirements
sudo apt install git build-essential cmake libdrm-dev pkg-config
cd /opt
sudo git clone https://github.com/rockchip-linux/mpp.git
cd mpp/build
sudo cmake ..
sudo make -j$(nproc)
sudo make install
sudo ldconfig
download mp4 example:
wget "https://sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4"
encode using software:
ffmpeg -i "big_buck_bunny_720p_1mb.mp4" soft.mp4
result:
frame= 132 fps=8.8 q=-1.0 Lsize= 1262KiB time=00:00:05.20 bitrate=1987.7kbits/s speed=0.346x
speed=0.346x
encode using hardware:
ffmpeg -i "big_buck_bunny_720p_1mb.mp4" -vcodec h264_rkmpp hard.mp4
result:
frame= 132 fps= 73 q=-0.0 Lsize= 1437KiB time=00:00:05.24 bitrate=2247.0kbits/s speed=2.91x
speed=2.91x