升级到 Ubuntu 21.10 后,我失去了硬件加速。现在,如果我尝试使用以下方法播放 H264 视频,vlc
我会得到:
$ vlc myvideo-h264.mkv
VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2)
[0000561a354c2640] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[00007ff614003f80] gl gl: Initialized libplacebo v2.72.0 (API v72)
libva info: VA-API version 1.12.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_10
libva info: va_openDriver() returns 0
[00007ff62cc14b40] avcodec decoder: Using Intel iHD driver for Intel(R) Gen Graphics - 21.1.1 () for hardware decoding
并且没有显示任何窗口。
使用 QtMultimedia(gstreamer)播放相同的视频,它看起来像 Powerpoint 演示文稿,这里是调试输出:
0:00:00.251065182 48500 0x7fed0c004d60 WARN alsa conf.c:5112:parse_args: alsalib error: Parameter DEV must be an integer
0:00:00.251174286 48500 0x7fed0c004d60 WARN alsa conf.c:5217:snd_config_expand: alsalib error: Parse arguments error: Invalid argument
0:00:00.251222397 48500 0x7fed0c004d60 WARN alsa pcm.c:2660:snd_pcm_open_noupdate: alsalib error: Unknown PCM hw:0,0:{AES0 0x02 AES1 0x82 AES2 0x00 AES3 0x02}
0:00:00.259240965 48500 0x7fed0c004d60 WARN alsa conf.c:5112:parse_args: alsalib error: Parameter DEV must be an integer
0:00:00.259330535 48500 0x7fed0c004d60 WARN alsa conf.c:5217:snd_config_expand: alsalib error: Parse arguments error: Invalid argument
0:00:00.259379567 48500 0x7fed0c004d60 WARN alsa pcm.c:2660:snd_pcm_open_noupdate: alsalib error: Unknown PCM hw:0,3:{AES0 0x02 AES1 0x82 AES2 0x00 AES3 0x02}
0:00:00.260670799 48500 0x7fed0c004d60 WARN alsa conf.c:5112:parse_args: alsalib error: Parameter DEV must be an integer
0:00:00.260759615 48500 0x7fed0c004d60 WARN alsa conf.c:5217:snd_config_expand: alsalib error: Parse arguments error: Invalid argument
0:00:00.260808595 48500 0x7fed0c004d60 WARN alsa pcm.c:2660:snd_pcm_open_noupdate: alsalib error: Unknown PCM hw:0,7:{AES0 0x02 AES1 0x82 AES2 0x00 AES3 0x02}
0:00:00.262005268 48500 0x7fed0c004d60 WARN alsa conf.c:5112:parse_args: alsalib error: Parameter DEV must be an integer
0:00:00.262091364 48500 0x7fed0c004d60 WARN alsa conf.c:5217:snd_config_expand: alsalib error: Parse arguments error: Invalid argument
0:00:00.262141293 48500 0x7fed0c004d60 WARN alsa pcm.c:2660:snd_pcm_open_noupdate: alsalib error: Unknown PCM hw:0,8:{AES0 0x02 AES1 0x82 AES2 0x00 AES3 0x02}
0:00:00.263337573 48500 0x7fed0c004d60 WARN alsa conf.c:5112:parse_args: alsalib error: Parameter DEV must be an integer
0:00:00.263424765 48500 0x7fed0c004d60 WARN alsa conf.c:5217:snd_config_expand: alsalib error: Parse arguments error: Invalid argument
0:00:00.263472896 48500 0x7fed0c004d60 WARN alsa pcm.c:2660:snd_pcm_open_noupdate: alsalib error: Unknown PCM hw:0,9:{AES0 0x02 AES1 0x82 AES2 0x00 AES3 0x02}
0:00:00.264637580 48500 0x7fed0c004d60 WARN alsa conf.c:5112:parse_args: alsalib error: Parameter DEV must be an integer
0:00:00.264725613 48500 0x7fed0c004d60 WARN alsa conf.c:5217:snd_config_expand: alsalib error: Parse arguments error: Invalid argument
0:00:00.264775638 48500 0x7fed0c004d60 WARN alsa pcm.c:2660:snd_pcm_open_noupdate: alsalib error: Unknown PCM hw:0,10:{AES0 0x02 AES1 0x82 AES2 0x00 AES3 0x02}
0:00:00.288314145 48500 0x7fed0c004d60 WARN GST_ELEMENT_FACTORY gstelementfactory.c:467:gst_element_factory_make: no such element factory "imxvideoconvert_g2d"!
0:00:00.304106355 48500 0x7fed0c004d60 WARN basesrc gstbasesrc.c:3688:gst_base_src_start_complete:<source> pad not activated yet
0:00:00.305157970 48500 0x7fed0c004d60 WARN basesrc gstbasesrc.c:3688:gst_base_src_start_complete:<source> pad not activated yet
0:00:00.306201095 48500 0x7fed0c004d60 WARN GST_ELEMENT_FACTORY gstelementfactory.c:467:gst_element_factory_make: no such element factory "imxvideoconvert_g2d"!
0:00:00.335300435 48500 0x7fecd4002360 WARN qtdemux qtdemux_types.c:244:qtdemux_type_get: unknown QuickTime node type tmcd
0:00:00.335397596 48500 0x7fecd4002360 WARN qtdemux qtdemux_types.c:244:qtdemux_type_get: unknown QuickTime node type pasp
0:00:00.335465069 48500 0x7fecd4002360 WARN qtdemux qtdemux_types.c:244:qtdemux_type_get: unknown QuickTime node type nmhd
0:00:00.335516833 48500 0x7fecd4002360 WARN qtdemux qtdemux_types.c:244:qtdemux_type_get: unknown QuickTime node type tmcd
0:00:00.335678829 48500 0x7fecd4002360 WARN qtdemux qtdemux.c:3066:qtdemux_parse_trex:<qtdemux0> failed to find fragment defaults for stream 1
0:00:00.336025234 48500 0x7fecd4002360 WARN qtdemux qtdemux.c:3066:qtdemux_parse_trex:<qtdemux0> failed to find fragment defaults for stream 2
0:00:00.337197863 48500 0x7fed0c004d60 WARN GST_ELEMENT_FACTORY gstelementfactory.c:467:gst_element_factory_make: no such element factory "imxvideoconvert_g2d"!
...
这里的输出是vainfo
:
$ vainfo
libva info: VA-API version 1.12.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_10
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.12 (libva 2.10.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 21.1.1 ()
vainfo: Supported profile and entrypoints
VAProfileNone : VAEntrypointVideoProc
VAProfileNone : VAEntrypointStats
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointFEI
VAProfileH264Main : VAEntrypointEncSliceLP
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointFEI
VAProfileH264High : VAEntrypointEncSliceLP
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointFEI
VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointFEI
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
知道如何恢复 20.04 中的硬件加速功能吗?