树莓派 linux 硬解,树莓派RaspberryPi 4B设置显存开启硬件加速 支持Emby|Plex|JellyFin转码...

本文介绍了如何在树莓派4B上通过升级内核固件、调整显存大小来启用硬件加速,以改善Emby、Plex和JellyFin的1080P视频转码性能。详细步骤包括运行'rpi-update'、修改/config.txt文件设置GPU内存,并验证Docker和ffmpeg-transcode的硬件加速效果。
AI助手已提取文章相关产品:

前言

尝试在树莓派上装Emby,然后转码播放1080P的视频,发现非常非常非常的卡,一看CPU….全满了:

656.html

但是RaspberryPi本身硬件是支持硬解码的,所以需要做一些配置来开启功能。

升级内核固件

pi@raspberrypi:/ $ sudo rpi-update

*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom

*** Performing self-update

% Total % Received % Xferd Average Speed Time Time Time Current

Dload Upload Total Spent Left Speed

100 18058 100 18058 0 0 59794 0 --:--:-- --:--:-- --:--:-- 59794

*** Relaunching after update

*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom

*** We're running for the first time

*** Backing up files (this will take a few minutes)

*** Backing up firmware

*** Backing up modules 4.19.97-v7l+

#############################################################

WARNING: 'rpi-update' updates to pre-releases of the linux

kernel tree and Videocore firmware.

'rpi-update' should only be used if there is a specific

reason to do so - for example, a request by a Raspberry Pi

engineer.

DO NOT use 'rpi-update' as part of a regular update process.

##############################################################

Would you like to proceed? (y/N)

*** Downloading specific firmware revision (this will take a few minutes)

% Total % Received % Xferd Average Speed Time Time Time Current

Dload Upload Total Spent Left Speed

100 168 100 168 0 0 1083 0 --:--:-- --:--:-- --:--:-- 1083

100 115M 0 115M 0 0 2911k 0 --:--:-- 0:00:40 --:--:-- 3233k

*** Updating firmware

*** Updating kernel modules

*** depmod 4.19.108-v8+

*** depmod 4.19.108-v7l+

*** depmod 4.19.108+

*** depmod 4.19.108-v7+

*** Updating VideoCore libraries

*** Using HardFP libraries

*** Updating SDK

*** Running ldconfig

*** Storing current firmware revision

*** Deleting downloaded files

*** Syncing changes to disk

*** If no errors appeared, your firmware was successfully updated to b524f5e7ace11ed7500fc39e63247fe9756fbddf

*** A reboot is needed to activate the new firmware

这里先不要重启,先修改一下显存大小,在sudo nano /boot/config.txt中增加一行:

gpu_mem=320

然后重启树莓派,重启后查看一下GPU显存的情况:

pi@raspberrypi:~ $ vcgencmd get_mem arm && vcgencmd get_mem gpu

arm=704M

gpu=320M

设置Docker硬件(可选)

656.html

另外volume也要加上这个:/opt/vc/lib:/opt/vc/lib

开启硬件加速

656.html

之后验证一下,在JellyFin后台Dashboard > Logs里面点击ffmpeg-transcode日志,查看Stream mapping信息:

Stream mapping:

Stream #0:0 (hevc) -> overlay:main (graph 0)

Stream #0:4 (pgssub) -> scale (graph 0)

scale (graph 0) -> Stream #0:0 (h264_omx)

Stream #0:1 -> #0:1 (dts (dca) -> mp3 (libmp3lame))

可以看到使用了h264_omx硬件加速~实际CPU的压力也小了很多

This article is under CC BY-NC-SA 4.0 license.

Please quote the original link:https://i-blog.csdnimg.cn/blog_migrate/fca367c5447a5457ddbf2d2c4df8d1cf.png

您可能感兴趣的与本文相关内容

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值