FFMPEG: decode with rkmpp, encode with software

Hi,

I am having trouble figuring out an ffmpeg command that would let me decode a video using rkmpp and then encode using software AV1 (SVT-AV1). It always compains about not being able to use drm-prime, like so:

[AVHWFramesContext @ 0xffff7c0016b0] Transfer non-linear DRM_PRIME frame is not supported!                                                                            
[hevc_rkmpp @ 0xaaab0c612fd0] Failed to transfer data to output frame: -38.                                                                                           
[vist#0:0/hevc @ 0xaaab0c614170] [dec:hevc_rkmpp @ 0xaaab0c614710] Error while processing the decoded data                                                            
[vist#0:0/hevc @ 0xaaab0c614170] [dec:hevc_rkmpp @ 0xaaab0c614710] Error processing packet in decoder: Function not implemented                                       
[vist#0:0/hevc @ 0xaaab0c614170] [dec:hevc_rkmpp @ 0xaaab0c614710] Task finished with error code: -38 (Function not implemented)                                      
[vist#0:0/hevc @ 0xaaab0c614170] [dec:hevc_rkmpp @ 0xaaab0c614710] Terminating thread with return code -38 (Function not implemented)                                 
[vost#0:0/libsvtav1 @ 0xaaab0c622af0] Could not open encoder before EOF                                                                                              
[vost#0:0/libsvtav1 @ 0xaaab0c622af0] Task finished with error code: -22 (Invalid argument)                                                                           
[vost#0:0/libsvtav1 @ 0xaaab0c622af0] Terminating thread with return code -22 (Invalid argument)                                                                      
[out#0/matroska @ 0xaaab0c5ed590] Nothing was written into output file, because at least one of its streams received no packets.                                      

The command was something like this:

jellyfin-ffmpeg -f matroska -init_hw_device rkmpp=rk -hwaccel rkmpp -afbc rga -i file:input.mkv -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 libsvtav1 -preset 8 -crf 35 -c:a copy output.mkv

When I removed -init_hw_device rkmpp=rk -hwaccel rkmpp, it worked, but I’d like to use hardware decoding if possible. To create it I snatched a jellyfin ffmpeg command and used this guide: https://trac.ffmpeg.org/wiki/Encode/AV1

I succeeded with something like this:

jellyfin-ffmpeg -f matroska -hwaccel rkmpp -hwaccel_output_format drm_prime -afbc rga -i input.mkv -c:a copy -vf scale_rkrga=w=3840:h=2160:format=nv12,hwmap=mode=read,format=nv12 -map_metadata -1 -map_chapters -1 -threads 0 -c:v libsvtav1 -pix_fmt yuv420p10le -preset 6 -crf 30 output.mkv

but it seems to be slower than the first command.
Can someone please offer suggestions on how to automate this? Right now I need to specify the decoder manually, I’d like automatically populate this field and the rga resolution fields to transcode many videos to AV1 automatically.