skip to content
~/docs/development
Development

Building from source

updated 2026-11-042 min read edit this page

You need Zig 0.16. The C and C++ dependencies are fetched by zig build: openh264, Dear ImGui, GLFW, FreeType, NASM, and the NVENC and VA-API headers.

On Linux, install the system libraries for the UI and capture:

# Arch
sudo pacman -S libportal pipewire libx11 libxext libxfixes wayland libxkbcommon libxrandr libxinerama libxcursor libxi
# Debian / Ubuntu
sudo apt install libgl-dev libportal-dev libpipewire-0.3-dev libx11-dev libxext-dev libxfixes-dev \
  libwayland-dev libxkbcommon-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev

Then build:

zig build                          # Linux app + Windows .exe + dedicated server
zig build run                      # run the app
zig build test                     # unit, server integration and codec tests
zig build bench                    # video pipeline benchmark
zig build loadtest -- 8 40 1       # 8 viewers plus one on a 2 Mbit/s link, for 40 s
zig build server -Dserver-only     # server only, without the app dependencies

Binaries land in zig-out/bin/. Add -Dcpu=x86_64_v2 for portable builds that run on x86-64 CPUs from about 2009 on, as CI does.

Command-line options

The flags are in Portuguese, matching the codebase.

--nome X              your display name
--criar [port]        create a room
--entrar host:port    join a room (also accepts a telinha://… invite)
--senha X             room password
--admin TOKEN         join a dedicated server as admin
--publico             with --criar: open the public link right away
--transmitir          go live as soon as you connect
--assistir            watch everyone who is live
--fps N --qualidade N --modo tela|jogo --software
--estatisticas        always show stats
Environment variables for troubleshooting
Variable Effect
TELINHA_DEBUG=1 Print the timing of every pipeline stage. Without a terminal, use Settings → Debugging instead.
TELINHA_IDIOMA=en|pt Force the interface language.
TELINHA_PASTA_CONFIG, TELINHA_PASTA_CLIPES Use other config and clips folders for a portable setup.
TELINHA_SEM_GPU_CAPTURA=1 Disable the zero-copy GPU capture path.
TELINHA_SEM_D3DVP=1 Windows Intel/AMD: send the image to the encoder through the CPU instead of as a GPU texture.
TELINHA_SEM_CUDAGL=1 Disable CUDA–OpenGL sharing: NVDEC straight to a texture when watching, and NVIDIA zero-copy capture when streaming.
TELINHA_SEM_SHADER=1 Do color conversion on the CPU.
TELINHA_SEM_DMABUF=1 Capture through shared memory instead of DMA-BUF.
TELINHA_CURSOR_EMBUTIDO=1 Let the compositor draw the cursor into the video (Hyprland).
TELINHA_SEM_VAAPI=1 Skip the VA-API encoder on Linux.
TELINHA_SEM_NVENC=1 Skip the NVENC encoder.
TELINHA_SEM_MF=1 Skip the Media Foundation encoder on Windows.
TELINHA_SEM_WGC=1 Capture windows with PrintWindow on Windows.
TELINHA_SEM_SOM=1 Don't play received audio.

If capture fails or is slow, zig build captest reports the method, the pixel format and the real frame rate, and saves a frame.

To turn a crash report's stack trace into source lines, use tools/simbolos.py with telinha-simbolos.tar.gz from the same release.