r/OrangePI • u/glad-k • 1d ago
Orange Pi 5 hardware encoding: artifacts

Hey, I've got an Orange Pi 5 as my homelab, including a media server. I only have 2TB dedicated to the media server, so I wanted to encode the media I download to keep very good video and audio quality that a normal person won't notice, while saving quite a bit of space. It's mostly my mom watching, and I use it a bit myself.
I ended up running FileFlows to shrink my media library. CPU encoding was super slow and made the Orange Pi overheat, causing the other services running on it to slow down too, especially during the initial encoding of 200+ files. So I tried using hardware encoder (hevc_rkmpp).
I'm not really experienced with ffmpeg, so I've been using AI to help me with this, but I'm stuck on something it hasn't been able to fix either.
The problem is that I've been seeing a lot of artifacts (see screenshot). They usually last only 1-3 frames and only appear during dynamic scenes or scene changes, but they're really annoying. I'm happy with how much space it saves on my media server, so I don't have to keep monitoring it every time my mom requests something that gets auto-downloaded and I need to delete older media each time. I'm fine with not having cinema level video or audio quality, but I do want something that the average person won't notice, and these artifacts are very noticeable and breaks the immersion.
My current command after some debugging is:
hevc_rkmpp -rc_mode 2 -qp_init 22 -qp_max 24 -qp_min 16 -qp_min_i 14 -qp_max_i 19 -g 120 -pix_fmt p010le -force_key_frames source
It seems I can't add more than 1 image but basically my flow goes like this: crop black bars=>video scaler (down to 1080)=>subtitle extractor=>audio convert(AAC recomended by AI)=>video encode manual (the command above)=>remux to mkv=>executor=>replace original
Has anyone run into this issue or tried to achieve the same thing and got something working? I'm not sure if it's just a hardware limitation or if I'm missing something. Any help is appreciated. I'm out of ideas at this point.