Docu review done: Mon 03 Jul 2023 16:16:06 CEST

byzanz

Table of Content

General

byzanz is a desktop recorder and command line tool allowing you to record your current desktop or parts of it to an animated GIF, Ogg Theora, Flash or WebM. This is especially useful for publishing on the web. byzanz also allows recording of audio, when the output format supports it.

Installation

If you are running debian, than it will be easy for you, just use apt

$ apt install byzanz

Usage

To start the recording, run

$ byzanz-record [OPTOIN...] </path/output_file>

And to stop the recording, just wait till the time specified with -d/--duration (default 10 seconds) are over

or

You can just specify instead of -d the parameter -e <command>. The capture will run till the <command> finished.

Capture

The capture is done with the binary byzanz-record which offers you some parameters/options to specify what you need:

ParameterDescription
-?/--helpShow help options
--help-allShow all help options
--help-gtkShow GTK+ Options
-d/--duration=SECSDuration of animation (default: 10 seconds)
-e/--exec=COMMANDCommand to execute and time
--delay=SECSDelay before start (default: 1 second)
-c/--cursorRecord mouse cursor
-a/--audioRecord audio
-x/--x=PIXELX coordinate of rectangle to record
-y/--y=PIXELY coordinate of rectangle to record
-w/--width=PIXELWidth of recording rectangle
-h/--height=PIXELHeight of recording rectangle
-v/--verboseBe verbose
--display=DISPLAYX display to use

X and Y

As you know, your screens have x and y coordinates. 0(x),0(y) is the top left corner of your most left defined screen.

  x ---------->
  ┌─────────────┐┌─────────────┐
y │             ││             │
¦ │             ││             │
¦ │   Screen1   ││   Screen2   │
¦ │             ││             │
v │             ││             │
  └─────────────┘└─────────────┘

Sample with 1920x1080 resolution

Screen1 goes from 0,0 till 1920,1080

Screen2 goes from 1921,0 till 3841,1080

Sample capture

This will start from

$ byzanz-record -x 0 -y 40 -w 500 -h 500 ./temp/zzzzz.gif

xy from full window with xwininfo

If you are lazy to type the coordinates and the highs, you could use something like xwininfo to get for you the informaion and put it in a small script. This will fully capture a window, does not metter which size. It will open a vim and keeps recording it untill you close it ;)

$!/bin/bash

dwininfo_data=$(xwininfo)
declare -A xwin_data=(
    ["x"]="$(awk -F: '/Absolute upper-left X/{print $2}' <<<"${xwininfo_data}")"
    ["y"]="$(awk -F: '/Absolute upper-left Y/{print $2}' <<<"${xwininfo_data}")"
    ["w"]="$(awk -F: '/Width/{print $2}' <<<"${xwininfo_data}")"
    ["h"]="$(awk -F: '/Height/{print $2}' <<<"${xwininfo_data}")"
)

notify-send -u low -t 5000 "capture starts in 5 seconds"
sleep 5
notify-send -u critical -t 5000 "starting capture"

byzanz-record -e vim -x ${xwin_data["x"]} -y ${xwin_data["y"]} -w ${xwin_data["w"]} -h ${xwin_data["h"]} ./$(date +"%F_%T").gif