Don't use a raspberry pi.
RPI5 only has h265 decoding, everithing else is handled by the cpu. Which is fine for 1080 as long as that's all the sbc is doing, but if you are also running some server, or you want anything h264 above 1080 you are out of luck.
RPI4 should be a little better, it has h264 and h265, don't know the supported resolutions/framerates, but the cpu is considerably less powerful. Also, the cpu lacks encryption acceleration, so if your are getting your movies over https that's gonna take a toll.
Older Pis are goint to be unsupported by kodi and jellyfin, so don't get those.
None of these is a dead no-go, listen to other peoples experiences. But I personally would advise against any Raspberry Pi. Maybe and Orange Pi is better? I don't know. My suggestion is to avoid the SBC, and get a cheap second hand Intel pc instead (possibly a very low power one). Intel's quicksynk video accelerator is gonna run laps around any sbc at any resolution, and it's gonna support more decoders, and even some encoders if you want to run transcoding in a jellyfin server.
Edit: If intel sold a quicksink pcie card, I would put one in my rpi5. But it don't.
Edit 2: I should add that some streaming services block 4k on Linux