Estou usando um dispositivo incorporado (Udoo) com um processador Atom com o hardware de vídeo 965, com o Ubuntu 17.10. Em geral (especificamente para h264) o vídeo de hardware está funcionando muito bem. Eu posso começar vlc usando o seguinte:
$ vlc --avcodec-hw=vaapi_x11 -vv Alice.m4v
Na saída de depuração, consigo ver claramente "libva info:" usando o driver i965.
O utilitário vainfo mostra suporte para o perfil principal do hevc.
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_40
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.40 (libva )
vainfo: Driver version: Intel i965 driver for Intel(R) CherryView - 1.8.3
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264MultiviewHigh : VAEntrypointEncSlice
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointEncSlice
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileVP8Version0_3 : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD
Quando eu tenho vlc decodificar o seguinte (hevc main), a saída de depuração claramente não consegue encontrar o módulo decodificador de hardware.
$ vlc --avcodec-hw=vaapi_x11 -vv channel_39_1.mp4
Este arquivo é todo vídeo e não tem áudio. As partes de saída de depuração interessantes são mostradas abaixo (coisas do trabalho de lua art removidas):
[00007f7630c35ec8] avcodec decoder debug: CPU flags: 0x010013db
[00007f7630c35ec8] avcodec decoder debug: trying to use direct rendering
[00007f7630c35ec8] avcodec decoder debug: allowing 4 thread(s) for decoding
[hevc @ 0x7f7630c7a3c0] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x7f7630c7a3c0] Decoding VPS
[hevc @ 0x7f7630c7a3c0] Main profile bitstream
[hevc @ 0x7f7630c7a3c0] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x7f7630c7a3c0] Decoding SPS
[hevc @ 0x7f7630c7a3c0] Main profile bitstream
[hevc @ 0x7f7630c7a3c0] Decoding VUI
[hevc @ 0x7f7630c7a3c0] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x7f7630c7a3c0] Decoding PPS
[00007f7630c35ec8] avcodec decoder debug: avcodec codec (MPEG-H Part2/HEVC (H.265)) started
[00007f7630c35ec8] avcodec decoder debug: using frame thread mode with 4 threads
[00007f7630c35ec8] core decoder debug: using decoder module "avcodec"
[00007f7634000c08] core input debug: 'file:///home/lab/Videos/channel_39_1.mp4' successfully opened
[00007f7630c021f8] mp4 demux debug: track 1 enabled!
[00007f7630c021f8] mp4 demux debug: Select track id 1
[00007f7630c021f8] mp4 demux debug: fragment matched 1851 << 1851 << 357941
[00007f7630c021f8] mp4 demux debug: Default sample duration 0 size 0 firstdts 0
[00007f7634000c08] core input debug: Buffering 0%
[00007f7634000c08] core input debug: Buffering 5%
[hevc @ 0x7f7630c7a3c0] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x7f7630c7a3c0] nal_unit_type: 20(IDR_N_LP), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x7f7630c7a3c0] Decoding SEI
[hevc @ 0x7f7630c7a3c0] Skipped PREFIX SEI 0
[hevc @ 0x7f7630c7a3c0] Decoding SEI
[hevc @ 0x7f7630c7a3c0] Skipped PREFIX SEI 1
[00007f7630c35ec8] avcodec decoder debug: available hardware decoder output format 53 (vaapi_vld)
[00007f7630c35ec8] avcodec decoder debug: available hardware decoder output format 109 (vdpau)
[00007f7630c35ec8] avcodec decoder debug: available software decoder output format 0 (yuv420p)
[00007f761c0edda8] core generic debug: looking for hw decoder module matching "vaapi_x11": 4 candidates
[00007f761c0edda8] core generic debug: no hw decoder modules matched
[00007f7634000c08] core input debug: Stream buffering done (1000 ms in 5 ms)
Parece que o plugin está testando os dados de vídeo e emitindo um erro por algum motivo, forçando o VLC a reverter para a decodificação de software.
Eu posso usar o utilitário mpv e ele aparentemente usa aceleração de hardware, e eu posso construir um pipline gstream usando o plugin decodificador vaapidecodebin e ele pode funcionar.
Neste ponto, eu teria duas perguntas. Existe um plugin VLC que resolva o problema? Isso poderia ser resolvido usando uma versão anterior do Ubuntu (como 17.04 ou 16.04)?
Muito obrigado.