Building squishrunner with Video Support

Building squishrunner from source is very rarely necessary. In the instructions from Installing Squish for Qt from Desktop Source Packages or Installing Squish for Qt from Embedded Source Packages, we avoid building it entirely, since it is only squishserver that needs to be binary-compatible with your AUT, while squishrunner can be taken from one of our official binary releases and typically runs on a desktop or a CI server that is using a popular operating system/platform.

However, in the rare cases where you do need to build squishrunner, (perhaps to support a different version of one of our supported script interpreters) this section explains how to build it with optional support for recording videos.


Before we can configure squish, we need to satisfy these requirements:

  1. Install the development packages of the script languages you plan to use, for Python, Ruby, Perl or TCL (JavaScript is included with Squish).
  2. Qt 4.8 or greater must be available. If the path to qmake is in our PATH, it is picked up automatically by Squish's configure script.
  3. A C++ compiler matching the version used for building Qt, and on Windows, a way to open a command shell window with the compiler's command line tools in our PATH.

Setting Up Build Directory

Next, we set up a build directory, which we will refer to as <BUILDDIR> in the steps below. This directory needs to have the following contents:

  1. Sources to build openh264 v2.1.1 library
  2. Sources to build ffmpeg 4.4 library
  3. Sources to build Squish 7.0 or later. Download the source archive from Squish Download Center. If you can not see it there, ask your sales rep for access to the desktop or embedded source packages.
  4., a cross-platform script for building ffmpeg with openh264 support:
    cd $topDir/openh264
    make $OPENH264_ARGS
    make install-static $OPENH264_ARGS PREFIX=$topDir/install/openh264
    make install-headers $OPENH264_ARGS PREFIX=$topDir/install/openh264
    cd $topDir/ffmpeg
    export PKG_CONFIG_PATH=$topDir/install/openh264/lib/pkgconfig
    ./configure $FFMPEG_ARGS --prefix=$topDir/install/ffmpeg \
                --disable-static --enable-shared --disable-all \
                --disable-autodetect --enable-ffmpeg --disable-doc \
                --enable-avcodec --enable-avformat --enable-swscale \
                --disable-everything --enable-libopenh264 --enable-encoder=libopenh264 \
                --enable-protocol=file --enable-muxer=mp4 --build-suffix=Squish \
                --enable-debug --disable-stripping
    make install
    cd $topDir/install/ffmpeg
    for i in `find . -name "*Squish.lib" -o -name "*" -o -name "*Squish.dylib"`
        cp -Pv $i `echo $i | sed s/Squish././`
    tar -czf $topDir/$packageName -C $topDir/install ffmpeg
  5. On Windows only, build.bat, a batch file for building ffmpeg on Windows that uses MSYS2 to run
    set MSYS2_PATH_TYPE=inherit
    set OPENH264_ARGS=OS=msvc %OPENH264_ARGS%
    set FFMPEG_ARGS=--toolchain=msvc %FFMPEG_ARGS%
    set PATH=c:\msys64\usr\bin;%LOCALAPPDATA%\bin\NASM;%PROGRAMFILES%\Git\usr\bin;%PATH%
    bash -l ffmpeg-4.4-squish-windows-x64.tar.gz

For 32-bit Builds

If you are using a 32-bit compiler and a 32-bit Qt, ffmpeg and openh264 need to be built for 32 bits also. To do this, we set some environment variables near the top of Set them to the following values depending on your platform.

Debian Linux/Ubuntu
FFMPEG_ARGS="--arch=i686 --extra-cflags=-m32 --extra-cxxflags=-m32 --extra-ldflags=-m32"

Building ffmpeg with openh264 Support

The official binary releases of ffmpeg on Windows use Windows Media Foundation for H.264 by default. On Linux, they use libx264. These binaries have issues when used with Squish. Configuring ffmpeg using the script below disables everything except Openh264 to avoid such issues.

WindowsInstall nasm.

Install MSYS2

Open an MSYS2 terminal and from there, install some additional packages:

$ pacman -sYY
$ pacman -S make pkg-config tar git

Open an developer's command line shell, such as x64 Native Tools Command Prompt for Visual Studio

C:\builddir> git clone -b v2.1.1
C:\builddir> git clone -b n4.4
C:\builddir> build.bat
Debian Linux/Ubuntu
$ sudo apt-get build-dep ffmpeg
$ git clone -b v2.1.1
$ git clone -b n4.4
$ ./ ffmpeg-4.4-squish-linux-x64.tar.gz

After this step is done, if all is successful, you should see in <BUILDDIR> a directory called install, containing the built ffmpeg, and a ffmpeg-4.4-squish.tar.gz archive containing the same files.

Configuring and Building squishrunner with Video Support

WindowsWe need to specify in the configure line, the location of things like qmake, Python, and whatever other script interpreters we want to use, if they are not already in our PATH:
C:\builddir> mkdir squish-build
C:\builddir> cd squish-build
C:\builddir\squish-build> ..\squish-7.0-qt-src\configure --with-qmake=C:\Qt\5.15.7\msvc2019_64\bin\qmake
   --with-python3=C:\Python38\python.exe --disable-all --enable-runner --with-ffmpeg=..\install\ffmpeg\
C:\builddir\squish-build> build
Debian Linux/UbuntuQt, Python and other script interpreters are usually found automatically by configure as long as they were installed using the system package manager.
$ sudo apt-get install libperl-dev ruby-dev python3-dev qt5-qmake
$ mkdir squish-build
$ cd squish-build
$ ../squish-7.0-qt-src/configure --disable-all --enable-runner --with-ffmpeg=../install/ffmpeg/
$ ./build