This is not a Linux problem; Windows 10 would fare way worse. Maybe similar on a Pi 5, I've seen a review and it handles Full HD on either OS (only Linux can get consistent 1080p60 though).
There’s hardware video encoding/decoding support. I used a Pi3b+ to transcode video for a while and would easily get 2x or better on full 1080p video. The 4 is better and I’ve heard even better on the 5, but I’ve not had a compelling reason to spend that much to find out.
The issue is trying to run a video in Firefox. Modern web browsers consume a lot of resources. Also they don't use your hardware efficiently for video playing. You need to take some time to set up a native video player application to play YouTube videos. This better uses the SBC hardware acceleration without wasting precious resources.
How to play YouTube through SMPlayer
Use your operating systems software installer to Install the latest versions of smplayer, smtube, and mpv. Use smtube to select a YouTube video. This sends the network stream URL to smplayer which detects its a YouTube video and downloads the latest yt-dlp to help stream it. If everything is up to date, it plays great.
Not all OS keep their software up to date. Some prefer older stable packages. So its important to use a OS that keeps this software updated. I know for sure MX Linux works with its default software repos out of the box. Its available for Pis, though I have not personally installed on a PI.
Configure SMTube To Use Invidious
Once you get YouTube videos playing, go into settings of smtube to change the web page from tonvid to a custom invidious instance. Pick one thats ideally from your country and that lets you register an account. That way you can import subscriptions and personalize stuff.
Hiccups when using smtube to load an invidious site: the default language will be some foreign language. Make sure you know how to go to settings in invidious and change to english.
To load the video click on small youtube icon bottom right of video.
Old Hardware Given New Life
I have revived lots of old PCs over the years. Giving them a new lease on life with up to date linux operating systems for friends and family. I have a 15 year old laptop that was finally having a hard time running latest linux mint xfce. This week I got to work reviving it.
I gave mx linux a shot as I liked ExplainingComputers review of the OS and thought it good fit for my use case. Installing these programs right from MX's software repositiories was a breeze. Youtube played effortlessly! MX is pretty minimal and im sure most pis can run it okay, so give it a shot if you want a OS with up to date repos for these packages if youtube is one of your main concerns.
Raspberry PIs don't have a proper GPU with decoding. That's part of why they stink. The other issue is that they are locked to the Raspberry Pi kernel. They are absolutely proprietary!
You just need a program that actually supports the hardware video decoder. I've played 30-40mbps bluray rips on a Raspberry Pi 1B without any issues in kodi. The video played smoothly with no frame drops. The user interface was very sluggish though.
The GPU and video acceleration on the Pi is weird, so software has to be built specifically for it.
Huh. I use a Raspberry Pi 5 as a media center PC running Kodi / libreelec.. Literally all it does is play videos and music. Even 4k h.265. This meme makes no sense to me.
Let me know if you find a fix. I'm trying to stream 3 of my cameras to the Synology surveillance GUI, and it's a fucking slideshow. I get a few frames a minute.
Gonna try the same thing on an orange pi