blob: 0705e54ccf01598c8c7a10d814a8e0f2ff6bfa07 [file] [log] [blame] [view]
Jianhui Daiaa455032023-12-05 18:06:191**This document is deprecated. See
2[vaapi.md](https://source.chromium.org/chromium/chromium/src/+/main:docs/gpu/vaapi.md)
3instead.**
4
nodira6074d4c2015-09-01 04:26:455# Enabling hardware <video> decode codepaths on linux
andybons3322f762015-08-24 21:37:096
andybonsad92aa32015-08-31 02:27:447Hardware acceleration of video decode on Linux is
8[unsupported](https://crbug.com/137247) in Chrome for user-facing builds. During
9development (targeting other platforms) it can be useful to be able to trigger
10the code-paths used on HW-accelerated platforms (such as CrOS and win7) in a
11linux-based development environment. Here's one way to do so, with details based
12on a gprecise setup.
andybons3322f762015-08-24 21:37:0913
andybonsad92aa32015-08-31 02:27:4414* Install pre-requisites: On Ubuntu Precise, at least, this includes:
andybons3322f762015-08-24 21:37:0915
andybonsad92aa32015-08-31 02:27:4416 ```shell
17 sudo apt-get install libtool libvdpau1 libvdpau-dev
18 ```
andybons3322f762015-08-24 21:37:0919
andybonsad92aa32015-08-31 02:27:4420* Install and configure [libva](http://cgit.freedesktop.org/libva/)
andybons3322f762015-08-24 21:37:0921
andybonsad92aa32015-08-31 02:27:4422 ```shell
23 DEST=${HOME}/apps/libva
24 cd /tmp
25 git clone git://anongit.freedesktop.org/libva
26 cd libva
27 git reset --hard libva-1.2.1
28 ./autogen.sh && ./configure --prefix=${DEST}
29 make -j32 && make install
30 ```
andybons3322f762015-08-24 21:37:0931
andybonsad92aa32015-08-31 02:27:4432* Install and configure the
33 [VDPAU](http://cgit.freedesktop.org/vaapi/vdpau-driver) VAAPI driver
andybons3322f762015-08-24 21:37:0934
andybonsad92aa32015-08-31 02:27:4435 ```shell
36 DEST=${HOME}/apps/libva
37 cd /tmp
38 git clone git://anongit.freedesktop.org/vaapi/vdpau-driver
39 cd vdpau-driver
40 export PKG_CONFIG_PATH=${DEST}/lib/pkgconfig/:$PKG_CONFIG_PATH
41 export LIBVA_DRIVERS_PATH=${DEST}/lib/dri
42 export LIBVA_X11_DEPS_CFLAGS=-I${DEST}/include
43 export LIBVA_X11_DEPS_LIBS=-L${DEST}/lib
44 export LIBVA_DEPS_CFLAGS=-I${DEST}/include
45 export LIBVA_DEPS_LIBS=-L${DEST}/lib
46 make distclean
47 unset CC CXX
48 ./autogen.sh && ./configure --prefix=${DEST} --enable-debug
49 find . -name Makefile |xargs sed -i 'sI/usr/lib/xorg/modules/driversI${DEST}/lib/driIg'
50 sed -i -e 's/_(\(VAEncH264VUIBufferType\|VAEncH264SEIBufferType\));//' src/vdpau_dump.c
51 make -j32 && rm -f ${DEST}/lib/dri/{nvidia_drv_video.so,s3g_drv_video.so} && make install
52 ```
andybons3322f762015-08-24 21:37:0953
Daniel Bratellf73f0df2018-09-24 13:52:4954* Add to args.gn:
55 * `target_os = "chromeos"` to link in `VaapiVideoDecodeAccelerator`
56 * `proprietary_codecs = true` and `ffmpeg_branding = "Chrome"` to
57 allow Chrome to play h.264 content, which is the only codec
58 VAVDA knows about today.
andybonsad92aa32015-08-31 02:27:4459* Rebuild chrome
60* Run chrome with `LD_LIBRARY_PATH=${HOME}/apps/libva/lib` in the environment,
61 and with the `--no-sandbox` command line flag.
62* If things don't work, a Debug build (to include D\*LOG's) with
63 `--vmodule=*content/common/gpu/media/*=10,gpu_video*=1` might be
64 enlightening.
andybons3322f762015-08-24 21:37:0965
nodira6074d4c2015-09-01 04:26:4566** note
67NOTE THIS IS AN UNSUPPORTED CONFIGURATION AND LIKELY TO BE BROKEN AT ANY
68POINT IN TIME
69**
andybonsad92aa32015-08-31 02:27:4470
71This page is purely here to help developers targeting supported HW `<video>`
72decode platforms be more effective. Do not expect help if this setup fails to
73work.