[FFmpeg-user] hwaccel vaapi and "No VA display found for device"

desktop ready desktop.ready at gmail.com
Wed Nov 23 13:48:52 EET 2016


On Wed, 23 Nov 2016 10:00:25 +0000, Mark Thompson <sw at jkqxz.net> wrote :

> On 23/11/16 03:09, desktop ready wrote:
> > Hello,
> >
> > I would like to confirm a bug/problem before submitting a bug
> > report. I am working on Debian Jessie/Stable amd64 on an Intel
> > Skylake i3-6320 and would like to decode an HEVC 8-bit encoded UHD
> > movie.
> >
> > With a fresh ffmpeg github checkout I am able to use the following
> > command without errors:
> > ffmpeg -hwaccel vaapi -i castle.mp4 -f null -
> >
> > However with ffmpeg release 3.2, I have the following errors:
> > [AVHWDeviceContext @ 0x7fdcf83adba0] No VA display found for
> > device: . [vaapi @ 0x30a61e0] Failed to create a VAAPI device
> > vaapi hwaccel requested for input stream #0:0, but cannot be
> > initialized.
> > [hevc @ 0x52bad20] Error parsing NAL unit #0.
>
> The device selection for VAAPI works as follows, stopping at the
> first usable device it finds:
>
> 1) If the user passed a device name, try to open that name an X11
> display. 2) If they didn't, try to open the default X11 display (i.e.
> $DISPLAY). 3) If the user passed a device name, try to open that name
> as the path to a DRM device. 4) If they didn't, try to
> open /dev/dri/renderD128 as a DRM device.
>
> Step 4 was added after the release of ffmpeg 3.2, so you only get
> steps 1-3 there.  Since you didn't pass a device name and
> (presumably) aren't running X, it doesn't manage to open anything.
>
> In general, you always want to give it a device name; the implicit
> selection may be right in some cases but it's better not to rely on
> it.
>
> ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -i
> castle.mp4 -f null -
>

Indeed it works with ffmpeg 3.2 (and the decoding is very fast),
thanks !

Now the mystery I have to solve is why Debian ffmpeg 3.2.2 is decoding
this file without error, but very slowly (with high CPU load).

Here is the output first with ffmpeg 3.2 from github and after that the
output from Debian ffmpeg 3.2.

I would be grateful if someone can point the meaningful differences.

~/bin/ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -i castle.mp4
-f null -
ffmpeg version n3.2-65-gee56777 Copyright (c) 2000-2016 the FFmpeg
developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: --prefix=/home/user/ffmpeg_build
--pkg-config-flags=--static
--extra-cflags=-I/home/user/ffmpeg_build/include
--extra-ldflags=-L/home/user/ffmpeg_build/lib --bindir=/home/user/bin
--enable-gpl --enable-nonfree
  libavutil      55. 34.100 / 55. 34.100
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.100 / 57. 56.100
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
libva info: VA-API version 0.39.4
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_39
libva info: va_openDriver() returns 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/user/castle.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomhvc1
    creation_time   : 2015-07-11T20:44:48.000000Z
  Duration: 00:00:50.02, start: 0.000000, bitrate: 49613 kb/s
    Stream #0:0(eng): Video: hevc (Main) (hvc1 / 0x31637668), yuvj420p(pc,
bt709), 3840x2160, 49417 kb/s, 29.97 fps, 29.97 tbr, 120k tbn, 120k tbc
(default)
    Metadata:
      creation_time   : 2015-07-11T20:44:48.000000Z
      handler_name    : VideoHandler
      encoder         : DRIMeV HEVC Encoder
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 190 kb/s (default)
    Metadata:
      creation_time   : 2015-07-11T20:44:48.000000Z
      handler_name    : SoundHandler
Output #0, null, to 'pipe:':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomhvc1
    encoder         : Lavf57.56.100
    Stream #0:0(eng): Video: wrapped_avframe, yuvj420p, 3840x2160, q=2-31,
200 kb/s, 29.97 fps, 29.97 tbn, 29.97 tbc (default)
    Metadata:
      creation_time   : 2015-07-11T20:44:48.000000Z
      handler_name    : VideoHandler
      encoder         : Lavc57.64.101 wrapped_avframe
    Stream #0:1(eng): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
(default)
    Metadata:
      creation_time   : 2015-07-11T20:44:48.000000Z
      handler_name    : SoundHandler
      encoder         : Lavc57.64.101 pcm_s16le
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> wrapped_avframe (native))
  Stream #0:1 -> #0:1 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
[hevc @ 0x2dc4120] Hardware accelerated decoding with frame threading is
known to be unstable and its use is discouraged.
Input stream #0:0 frame changed from size:3840x2160 fmt:yuvj420p to
size:3840x2160 fmt:nv12
[swscaler @ 0x3d85740] deprecated pixel format used, make sure you did set
range correctly
frame=   29 fps=0.0 q=-0.0 Lsize=N/A time=00:00:01.08 bitrate=N/A speed=
1.7x


/usr/bin/ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -i
castle.mp4 -f null -
ffmpeg version 3.2-2~bpo8+2 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: --prefix=/usr --extra-version='2~bpo8+2'
--toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
--incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-libtesseract
--disable-stripping --disable-decoder=libschroedinger --enable-avresample
--enable-avisynth --enable-gnutls --enable-ladspa --enable-libass
--enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio
--disable-libebur128 --enable-libflite --enable-libfontconfig
--enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm
--enable-libmodplug --enable-libmp3lame --enable-libopenjpeg
--enable-libopus --enable-libpulse --enable-librubberband
--enable-libschroedinger --enable-libshine --enable-libsnappy
--enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora
--enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack
--enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq
--enable-libzvbi --enable-opengl --enable-sdl2 --enable-x11grab
--enable-libdc1394 --enable-libiec61883 --enable-openal --enable-frei0r
--enable-libopencv --enable-libx264 --enable-chromaprint --enable-shared
  libavutil      55. 34.100 / 55. 34.100
  libavcodec     57. 64.100 / 57. 64.100
  libavformat    57. 56.100 / 57. 56.100
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
libva info: VA-API version 0.39.4
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_39
libva info: va_openDriver() returns 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/user/castle.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomhvc1
    creation_time   : 2015-07-11T20:44:48.000000Z
  Duration: 00:00:50.02, start: 0.000000, bitrate: 49613 kb/s
    Stream #0:0(eng): Video: hevc (Main) (hvc1 / 0x31637668), yuvj420p(pc,
bt709), 3840x2160, 49417 kb/s, 29.97 fps, 29.97 tbr, 120k tbn, 120k tbc
(default)
    Metadata:
      creation_time   : 2015-07-11T20:44:48.000000Z
      handler_name    : VideoHandler
      encoder         : DRIMeV HEVC Encoder
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 190 kb/s (default)
    Metadata:
      creation_time   : 2015-07-11T20:44:48.000000Z
      handler_name    : SoundHandler
Output #0, null, to 'pipe:':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomhvc1
    encoder         : Lavf57.56.100
    Stream #0:0(eng): Video: wrapped_avframe, yuvj420p, 3840x2160, q=2-31,
200 kb/s, 29.97 fps, 29.97 tbn, 29.97 tbc (default)
    Metadata:
      creation_time   : 2015-07-11T20:44:48.000000Z
      handler_name    : VideoHandler
      encoder         : Lavc57.64.100 wrapped_avframe
    Stream #0:1(eng): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
(default)
    Metadata:
      creation_time   : 2015-07-11T20:44:48.000000Z
      handler_name    : SoundHandler
      encoder         : Lavc57.64.100 pcm_s16le
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> wrapped_avframe (native))
  Stream #0:1 -> #0:1 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
frame=   34 fps= 32 q=-0.0 Lsize=N/A time=00:00:01.25 bitrate=N/A
speed= 1.2x


More information about the ffmpeg-user mailing list