Sample Code and It's Compilation Process
  • 20 May 2022
  • 2 Minutes to read
  • Contributors
  • Dark

Sample Code and It's Compilation Process

  • Dark

Article Summary

For the EVA samples, please refer to github site: and clone the source code:

git clone cd EVA-Sample

Change to master branch to view all the samples provided:

git branch master

In Master branch are the samples developed around EVASDK 3.5.3 and before. Samples in new-samples branch are developed for the version after 3.5.3 with the purpose of more systematic illustrating each aimed function specifically instead of hybrid them too advanced.

Build Process

Step 1. Install require packages

  • gstreamer-1.0 >= 1.14.1
  • opencv >= 4.5.0 for windows and Linux x86_x64; opencv >= 4.1.1 for Linux ARM

Step 2. [Windows] Open Visual Studio Prompt

For windows compiler, open windows vs prompt. Take vs2019 as example:

Menu > Visual Studio 2019 > x64 Native Tools Command Prompt for VS 2019

In windows, use this tool to run the commands below.

Step 3. Install build tool

$ pip3 install meson ninja boto3

Step 4. Set environment variable

Run the script file described in Installation Guide in INSTALLING THE ADLINK EVA SDK - Set Environment Variables.

Linux version, assume installed default path to EVA SDK is /opt/adlink/eva, run:

$ source /opt/adlink/eva/scripts/

For windows, assume installed default path to EVA SDK is C:\ADLINK\eva, run gstreamer and EVA bat file:

> C:\ADLINK\gstreamer\setupvars.bat
> C:\ADLINK\eva\scripts\setup_eva_envs.bat

Set gstreamer and opencv required path to system path, if you had installed EVA. Add those path to system variables, "Path":


If you don't want to set opencv path to system variables, remember copy the opencv dependencies besides the built binary.

Note: The samples used OpenCV GStreamer Wrapper, so it is required to use OpenCV which build with GStreamer.

Step 5. Go to sample folder

Assume EVA is installed in EVA_ROOT:


Make sure you have the permission to samples folder first.

$ cd <EVA_ROOT>
$ sudo chmod +447 samples/
$ cd samples


> cd C:\<EVA_ROOT>\samples

Step 6. Build binary

For Linux, use meson to configure the source code and use ninja to build for linux.

$ meson build
$ ninja -C build

If opencv was installed at other directory location, assign target directory to opencv_dir option like below commands.

$ meson build -Dopencv_dir=PATH_TO_OPENCV
$ ninja -C build

Remind that the opencv_dir is depends on where user installed. If not provide -Dopencv_dir in command, the default path will used where it can be found set in meson_options.txt. Besides, check 2 parameters "libs_cv"(for libraries) and "inc_cv"(for include files) relative to opencv_dir used in for the opencv. Check join_paths to where your opencv relative files located is important both in Linux and windows.

If samples are built in windows, meson can set build backend to vs. Also set the opencv_dir option. One more path need to set is eva_root to EVA installed path. Here we assumed EVA is installed in C:\ADLINK\eva. Then build it using meson:

$ meson --buildtype=release --backend=vs build -Dopencv_dir=PATH_TO_OPENCV -Deva_root=C:\ADLINK\eva
$ meson compile -C build

Then following binary/library will generated in build folder

  • ex_app
  • appsrcsink
  • appsrcsink_ad
  • getAdMetadata
  • (for Linux)/adfiltertemplate.dll (for windows)

Remind copy (for Linux)/adfiltertemplate.dll (for windows) to plugins folder under <EVA_ROOT> for convenient use it.

Was this article helpful?