Compiled ffmpeg with HW decoding mjpeg (Rockchip) #18033
Deoptim
started this conversation in
Show and tell
Replies: 1 comment 1 reply
|
FYI ffmpeg-rockchip has got RKMPP MJPEG decoder in the latest commit. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hardware-accelerated MJPEG Decoding with
mjpeg_rkmppin FFmpeg for Frigate (Rockchip)I have compiled FFmpeg for Frigate (Rockchip) with support for hardware-accelerated MJPEG decoding using
mjpeg_rkmpp. The patch was based on this Pull Request.Using hardware decoding with the parameter
input_args: -c:v mjpeg_rkmpp ...significantly reduces CPU load for MJPEG cameras. Previously, withinput_args: -c:v mjpegin myconfig.yaml, I observed high CPU usage: "Camera1 has high FFMPEG CPU usage (60%)". After applying the patch and switching to hardware decoding, the CPU usage dropped to "Camera1 has high FFMPEG CPU usage (21%)" (assuming the correcthwaccel_argsare set in the configuration).FFmpeg Decoder Information
Instructions for Using Custom FFmpeg in Frigate Container (Docker Compose)
Below are the steps to use a custom FFmpeg version in a Frigate container (assuming Docker Compose is used, as this is my setup):
Prerequisites: Ensure Frigate is already installed and working correctly.
Copy FFmpeg Binaries: Extract the contents of the archive
jellyfin-ffmpeg_7.1.1-2_portable_linuxarm64-gpl.tar.xz(filesffmpegandffprobe) to a convenient location on your single-board computer. For example, I chose/usr/local/bin/(since I made them the default for my system). If you already have an installed version of FFmpeg, you don’t need to remove it — you can choose a different location to copy the files used by Frigate.Edit the Frigate Configuration File
docker-compose.yml:We are interested in the
volumesparameter:(where
/usr/local/bin/ffmpegis our file on the host system, and/tmp/bin/ffmpegis inside the Frigate container)If you start the container via the command line, it should look something like this:
Edit the Frigate Configuration File
config.yaml:(add the parameter
path: /tmpto theffmpeg:section. Frigate will automatically appendbin/ffmpegto it. By default, Frigate for Rockchip includes three precompiled FFmpeg versions, which can be used by setting thepath:parameter to/usr/lib/ffmpeg/5.0,/usr/lib/ffmpeg/6.0, or/usr/lib/ffmpeg/7.0— these are Frigate’s internal versions)Link to the Archive
Compiled binary: jellyfin-ffmpeg_7.1.1-2_portable_linuxarm64-gpl.tar.xz
Building FFmpeg for Rockchip with
mjpeg_rkmppSupportIf you want to build FFmpeg for Rockchip with support for
mjpeg_rkmppdecoding yourself:jellyfin-ffmpeg/debian/patches/. Ensure the patch number in the filename is sequential, especially if later versions already include patches with the same number.jellyfin-ffmpeg/debian/patches/series, adding the patch filename to the end of the list.jellyfin-ffmpeg/build-linux-arm64as a regular user (root is not required) on WSL2.0089-add-mjpeg-decoding-rk-ffmpeg.patch
All reactions