1

Anyone knows how to build ffmpeg with x11grab support in a headless session, e.g. Open Build Service? I can build it in a normal X11 session, but not without the X.

As OBS essentially creates a headless session when building a package and ffmpeg tries to automatically deduce the features from the environment, the resulting binary and libraries don't include x11grab device. I only guess it's a matter of installing the proper libraries and their devel counterparts in the build session, but have been unable to figure out the right combination.

Anyone to point me in the right direction?

1 Answer 1

2

The x11grab device requires [/usr/include]/xcb/xcb.h, so install whatever package provides that file. In Ubuntu this is provided by libxcb1-dev package. You'll probably also want xcb/shm.h (libxcb-shm0-dev), xcb/shape.h (libxcb-shape0-dev), and xcb/xfixes.h (libxcb-xfixes0-dev).

You may need a virtual X server environment (see xvfb-run).

3
  • You are right, basically. For the greater completeness, I installed the following libraries on the build system: libXcomposite-devel, libXinerama-devel, libv4l-devel, libxcb-devel, libxcb-shm0, libxcb-xfixes0, libxcb-shape0, libxcb-sync1, libxcb-util1, libX11-devel, libXrandr-devel, libXext-devel, libXrender-devel, libXau-devel, libXfixes-devel. Then built the project with explicit options --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-libxcb-shape
    – Peter R.
    Sep 11, 2019 at 13:44
  • 1
    @PeterR. The --enable-libxcb* options are autodetected so you don't need to explicitly list them. Refer to ./configure --help to see what else is auto.
    – llogan
    Sep 12, 2019 at 20:55
  • Yes, I saw that, but I added it "just in case" :).
    – Peter R.
    Sep 16, 2019 at 6:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .