title: Using hardware acceleration with libavcodec
body: <p>I have downloaded a software (<a href="https://info-beamer.com/" rel="nofollow">info-beamer</a>) and I would like to use the GPU acceleration to decode H.264 videos. I know my platform is able to decode H.264 videos by using the GPU. I performed some tests with gstreamer using the following command and the video plays smoothly without too much CPU usage:</p>
  
  <pre><code>gst-launch-1.0 filesrc location=./Sintel.mp4 ! qtdemux ! vaapidecode ! vaapisink
  </code></pre>
  
  <p>But when I play the same video with info-beamer 100% of the CPU is used. I thought libavcodec would automatically use VAAPI if available ... Should I use another library? What am I doing wrong?</p>
  
  <p>My platform is running an Atom E3826 with intel HD and has Ubuntu 14.04 installed.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I think I installed all the required libraries:</p>
  
  <pre><code>nap@nap:~$ dpkg -l | grep libva
  ii  libva-dev:amd64                             1.3.0-2                                             amd64        Video Acceleration (VA) API for Linux -- development files
  ii  libva-drm1:amd64                            1.3.0-2                                             amd64        Video Acceleration (VA) API for Linux -- DRM runtime
  ii  libva-egl1:amd64                            1.3.0-2                                             amd64        Video Acceleration (VA) API for Linux -- EGL runtime
  ii  libva-glx1:amd64                            1.3.0-2                                             amd64        Video Acceleration (VA) API for Linux -- GLX runtime
  ii  libva-intel-vaapi-driver                    1.3.0-1ubuntu1                                      all          VAAPI driver for Intel G45 &amp; HD Graphics family (transitional package)
  ii  libva-tpi1:amd64                            1.3.0-2                                             amd64        Video Acceleration (VA) API for Linux -- TPI runtime
  ii  libva-wayland1:amd64                        1.3.0-2                                             amd64        Video Acceleration (VA) API for Linux -- Wayland runtime
  ii  libva-x11-1:amd64                           1.3.0-2                                             amd64        Video Acceleration (VA) API for Linux -- X11 runtime
  ii  libva1:amd64                                1.3.0-2                                             amd64        Video Acceleration (VA) API for Linux -- runtime
  nap@nap:~$ dpkg -l | grep vaapi
  ii  gstreamer1.0-vaapi:amd64                    0.5.7-0ubuntu4                                      amd64        VA-API plugins for GStreamer
  ii  libgstreamer-vaapi1.0-0:amd64               0.5.7-0ubuntu4                                      amd64        GStreamer libraries from the "vaapi" set
  ii  libva-intel-vaapi-driver                    1.3.0-1ubuntu1                                      all          VAAPI driver for Intel G45 &amp; HD Graphics family (transitional package)
  </code></pre>
  
  <p>Here is the output of vainfo:</p>
  
  <pre><code>nap@nap:~$ sudo vainfo 
  error: XDG_RUNTIME_DIR not set in the environment.
  libva info: VA-API version 0.35.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_35
  libva info: va_openDriver() returns 0
  vainfo: VA-API version: 0.35 (libva 1.3.0)
  vainfo: Driver version: Intel i965 driver - 1.3.0
  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
        VAProfileVC1Simple              : VAEntrypointVLD
        VAProfileVC1Main                : VAEntrypointVLD
        VAProfileVC1Advanced            : VAEntrypointVLD
        VAProfileNone                   : VAEntrypointVideoProc
        VAProfileJPEGBaseline           : VAEntrypointVLD
  </code></pre>