msojocs / bilibili-linux

基于哔哩哔哩官方客户端移植的Linux版本 支持漫游
MIT License
719 stars 34 forks source link

Vaapi的思路 #45

Closed DoveKi closed 1 year ago

DoveKi commented 1 year ago

在目前ubuntu chrome 下可以通过flag启用avc/h264硬件加速 b站需在播放设置里手动改avc 播放时在chrome://media-internals 可以看到VaapiVideoDecoder正常启用,4k60fps的视频基本无cpu占用 Wayland- /usr/bin/google-chrome-stable --disable-features=UseChromeOSDirectVideoDecoder --use-gl=egl --enable-features=VaapiVideoDecoder Xorg- /usr/bin/google-chrome-stable --disable-features=UseChromeOSDirectVideoDecoder --use-gl=desktop --enable-features=VaapiVideoDecoder 通过以上参数启动chrome只要系统本身vaapi配置没问题都可以正常启用vaapi,我只在i卡和a卡测试过,n卡用走的是vdpau,我没有n卡不清楚 Electron在Linux下理论上也可以通过flag启用vaapi app.commandLine.appendSwitch('disable-features', 'UseChromeOSDirectVideoDecoder') app.commandLine.appendSwitch('use-gl', 'egl') Wayland app.commandLine.appendSwitch('use-gl', 'desktop') Xorg app.commandLine.appendSwitch('enable-features', 'VaapiVideoDecoder')