intel / libva

Libva is an implementation for VA-API (Video Acceleration API)
http://intel.github.io/libva/
Other
648 stars 299 forks source link

[vaapi @ 0x63acd0] Failed to create a VAAPI device #230

Open Lcmasdf opened 6 years ago

Lcmasdf commented 6 years ago

I try to do hardware decode on Intel(R) Core(TM) i7-7700K using ffmpeg and vaapi. I installed libva libva-utils libdrm intel-vaapi-driver and recompiled ffmpeg with --enable-vaapi configure.

xxx@xxx:~/lcm$ ls -l /dev/dri total 0 crw-rw---- 1 root video 226, 0 8月 29 18:10 card0 crw-rw---- 1 root video 226, 128 8月 29 18:10 renderD128

xxx@xxx:~/lcm$ vainfo libva info: VA-API version 1.2.0 libva info: va_getDriverName() returns 0 libva info: User requested driver 'iHD' libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so libva info: Found init function __vaDriverInit_1_0 libva info: va_openDriver() returns 0 vainfo: VA-API version: 1.2 (libva 2.0.1.pre1) vainfo: Driver version: 16.8.69021-ubit vainfo: Supported profile and entrypoints

xxx@xxx:~/lcm$ lspci -v -s $(lspci | grep VGA | cut -d" " -f 1)00:02.0 VGA compatible controller: Intel Corporation Device 5912 (rev 04) (prog-if 00 [VGA controller]) Subsystem: Intel Corporation Device 0000 Flags: bus master, fast devsel, latency 0, IRQ 140 Memory at de000000 (64-bit, non-prefetchable) [size=16M] Memory at c0000000 (64-bit, prefetchable) [size=256M] I/O ports at f000 [size=64] [virtual] Expansion ROM at 000c0000 [disabled] [size=128K] Capabilities: Kernel driver in use: i915

It seems all right, but when I run "ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -i video.mov output.yuv" try to do decode and a get the following error:

[vaapi @ 0x63acd0] Failed to create a VAAPI device vaapi hwaccel requested for input stream #0:0, but cannot be initialized. [h264 @ 0x12a8ce0] decode_slice_header error [h264 @ 0x12a8ce0] no frame! Error while decoding stream #0:0: Invalid data found when processing input

It seems to show there are some errors with vaapi, but I can't find any doc about it . Any tips is appreciate。

chivakker commented 6 years ago

I guess your problem might be on ffmpeg configuration and if it is indeed able to find iHD driver. Normally I'd need to export LIBVA_DRIVER_NAME=IHD and then ffmpeg just works.

$ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i -f null -

I don't keep yuv file.

darren-steven commented 6 years ago

Are you using Wayland - there are a number of open tickets that seem to have similar behaviours with Wayland.