sakaki- / gentoo-on-rpi-64bit

Bootable 64-bit Gentoo image for the Raspberry Pi4B, 3B & 3B+, with Linux 5.4, OpenRC, Xfce4, VC4/V3D, camera and h/w codec support, weekly-autobuild binhost
GNU General Public License v3.0
921 stars 126 forks source link

Hardware accelerated videos on youtube? #132

Closed wof2 closed 4 years ago

wof2 commented 4 years ago

Hi, first of all thanks for a hell of a job :) I'm running Gentoo v1.5.3 on RPI4. I've tried watching 1080p videos on youtube via Chromium and Firefox. The videos are unwatchable - stuttering and CPUs are @ 100%. Is this expected behavior? Shouldn't there be a hardware acceleration running?

PS. Glxgears scores around 500fps.

sakaki- commented 4 years ago

Hi @wof2,

unfortunately, although the image now supports access to the RPi's built-in h/w video codecs via both V4L2-M2M and MMAL endpoints (and ships with a custom version of ffmpeg that can utilise both), neither firefox nor chromium currently exploit these out of the box (see e.g. this post and this thread), although I think Raspbian's 32-bit custom Chromium build can use MMAL codecs, so it may be possible to adopt some of their patches (not something I've looked at yet). PRs on this topic welcome!

Hint: one thing you can do is to play youtube videos using ApplicationsMultimediaSMPlayer, as this has got acceleration enabled. In this app, you can specify the default quality you want via OptionsPreferences, Network (left tab), and open streams via OpenURL... (just paste in the youtube URL you want to watch).

On my RPi4B (4GB), with a fast IP connection, this plays back 1080p videos smoothly; for instance:

SMPlayer streaming YouTube video at 1080p, MMAL codec

If you like this route, you can also install media-video/smtube as a front end:

demouser@pi64 ~ $ sudo emaint sync --repo genpi64
demouser@pi64 ~ $ sudo emerge -v media-video/smtube

Once built, this YouTube browser front-end can be launched by pressing F11 from within SMPlayer.

hth, sakaki

sakaki- commented 4 years ago

Closing now - please re-open if any issues with the SMPlayer solution above.

Thanks, sakaki