aos capture
Screenshots
12 commands. Run aos capture --help for the same list from the binary, or see every group.
Screenshots and screen recordings. screenshot captures a monitor, a region or one app window to a file, without bringing the window to the front. The video commands record with ffmpeg and render a second cut where the camera follows the action; see recording a demo. On macOS the terminal needs Screen Recording permission for all of them. text OCRs a screen area and prints its lines in reading order: --region (global, or relative to --monitor), or a whole monitor. It uses the same OCR as window text --source=ocr: Vision on macOS, Windows.Media.Ocr on Windows, tesseract on Linux. qr decodes every QR code in a PNG, JPEG or GIF file, or in a screen area captured the same way as text, in pure Go (gozxing, MIT), so it needs no OCR engine and works the same on every OS; it exits 1 when there is none.
Commands
Section titled “Commands”aos capture qr
Section titled “aos capture qr”Decode the QR codes in an image file, a screen region or a whole monitor
needs a display
Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works
aos capture qr [<image>] [--region=<x,y,w,h>] [--monitor=<n>] [--json]| flag | values | meaning |
|---|---|---|
<image> |
Optional positional argument | |
--region |
<x,y,w,h> |
Optional. comma-separated |
--monitor |
<n> |
Optional |
--json |
Optional |
aos capture qr ticket.png # decode a PNG, JPEG or GIF fileaos capture qr --region=100,100,400,400 # decode what is on screen thereaos capture qr --monitor=2 --json # every QR code on monitor 2, with its boundsaos capture screenshot
Section titled “aos capture screenshot”Take a screenshot
needs a display alias: aos screenshot
Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works
aos capture screenshot [fullscreen|region|window] [--monitor=<n>] [--region=<x,y,w,h>] [--app=<name>] [--copy] [--out=<path>] [--cover=<x,y,w,h[;x,y,w,h...]>] [--cover-app=<name> | --cover-title=<s>] [--cover-find=<text>] [--cover-pad=<px>] [--cover-color=<c>] [--cover-text=<s>] [--cover-text-color=<c>] [--cover-preset=<name>]| flag | values | meaning |
|---|---|---|
--monitor |
<n> |
Optional |
--region |
<x,y,w,h> |
Optional. comma-separated |
--app |
<name> |
Optional |
--copy |
Optional | |
--out |
<path> |
Optional |
--cover |
<x,y,w,h[;x,y,w,h...]> |
Optional. comma-separated |
--cover-app |
<name> |
Optional |
--cover-title |
<s> |
Optional |
--cover-find |
<text> |
Optional |
--cover-pad |
<px> |
Optional |
--cover-color |
<c> |
Optional |
--cover-text |
<s> |
Optional |
--cover-text-color |
<c> |
Optional |
--cover-preset |
<name> |
Optional |
aos screenshotaos capture screenshot region --copyaos capture screenshot --monitor=2aos capture screenshot --app=Chrome --out=/tmp/term.pngaos capture screenshot --region=0,0,800,600aos screenshot --cover-app=Preview --out=/tmp/s.pngaos screenshot --app=Terminal --cover-app=Terminal --cover-find=ghp_ --out=/tmp/t.pngaos screenshot --cover=10,10,300,40 --cover-text="Private" --out=/tmp/s.png# --cover* paints the covers into the file's pixels; live `draw cover` covers are painted in too# fail closed: a cover that cannot be placed (exit 3), a tint, or no permission writes no fileaos capture text
Section titled “aos capture text”OCR a screen region or a whole monitor and print its text in reading order
needs a display
Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works
aos capture text [--region=<x,y,w,h>] [--monitor=<n>] [--max-chars=<n>] [--json]| flag | values | meaning |
|---|---|---|
--region |
<x,y,w,h> |
Optional. comma-separated |
--monitor |
<n> |
Optional |
--max-chars |
<n> |
Optional |
--json |
Optional |
aos capture text --region=100,100,800,400aos capture text --monitor=2 --jsonaos capture text --monitor=1 --region=0,0,600,300 # region relative to monitor 1# a window's text: aos window text --app=Preview --source=ocraos capture video devices
Section titled “aos capture video devices”List the screens, microphones and system-audio sources ffmpeg can record
needs a display
Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works
aos capture video devices [--json]| flag | values | meaning |
|---|---|---|
--json |
Optional |
aos capture video devicesaos capture video focus
Section titled “aos capture video focus”Point the camera at a place until unfocus (or –hold)
needs a display
Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works
aos capture video focus (--rect=<x,y,w,h> | --at=<x,y> [--size=640x360] | --app=<name>|--title=<s> [--find=<text> [--role=<r>]]) [--hold=<duration>] [--zoom=<factor>]| flag | values | meaning |
|---|---|---|
--rect |
<x,y,w,h> |
One of these is required. comma-separated |
--at |
<x,y> |
One of these is required. comma-separated |
--size |
<640x360> |
Optional. default 640x360 |
--app |
<name> |
One of these is required |
--title |
<s> |
One of these is required |
--find |
<text> |
Optional |
--role |
<r> |
Optional |
--hold |
<duration> |
Optional |
--zoom |
<factor> |
Optional |
aos capture video focus --rect=100,100,800,450aos capture video focus --at=640,400 --size=800x450 --hold=4saos capture video focus --app=Chrome --find="Sign in" --zoom=2aos capture video follow
Section titled “aos capture video follow”Switch the live camera: follow the mouse, an app, smart, or off
needs a display
Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works
aos capture video follow mouse|app|smart|off [--app=<name>|--title=<s>]| flag | values | meaning |
|---|---|---|
--app |
<name> |
Optional |
--title |
<s> |
Optional |
aos capture video follow mouseaos capture video follow app --app=Chromeaos capture video follow offaos capture video mark
Section titled “aos capture video mark”Add a labelled event to the recording (a camera target with –rect)
needs a display
Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works
aos capture video mark <label...> [--rect=<x,y,w,h>]| flag | values | meaning |
|---|---|---|
<label...> |
Required positional argument | |
--rect |
<x,y,w,h> |
Optional. comma-separated |
aos capture video mark "login works"aos capture video mark "the chart" --rect=200,150,800,450aos capture video start
Section titled “aos capture video start”Start recording the screen with ffmpeg (detached; ask the person first)
needs a display
Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works
aos capture video start [smart|monitor|window|region|app|mouse] [--monitor=<n>] [--app=<name>|--title=<s>] [--region=<x,y,w,h>] [--fps=30] [--audio=none|mic|system|both] [--mic=<name|index>] [--zoom=2] [--out=<path.mp4>] [--max=10m] [--indicator=false] [--json]| flag | values | meaning |
|---|---|---|
--monitor |
<n> |
Optional |
--app |
<name> |
Optional |
--title |
<s> |
Optional |
--region |
<x,y,w,h> |
Optional. comma-separated |
--fps |
<30> |
Optional. default 30 |
--audio |
none, mic, system, both |
Optional |
--mic |
name, index |
Optional |
--zoom |
<2> |
Optional. default 2 |
--out |
<path.mp4> |
Optional |
--max |
<10m> |
Optional. default 10m |
--indicator |
<false> |
Optional |
--json |
Optional |
aos capture video start smart --audio=mic --out=~/Movies/demo.mp4aos capture video start monitor --monitor=2aos capture video start mouse --zoom=2aos capture video start app --app=Chromeaos capture video start window --app=Terminalaos capture video start region --region=0,0,1280,720 --max=2m# exit 2 when ffmpeg (or a loopback device for --audio=system) is missingaos capture video status
Section titled “aos capture video status”Is a recording running, and where is it going
needs a display
Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works
aos capture video status [--json]| flag | values | meaning |
|---|---|---|
--json |
Optional |
aos capture video statusaos capture video stop
Section titled “aos capture video stop”Stop recording, finalize the mp4 and render <out>.final.mp4 with the auto camera
needs a display
Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works
aos capture video stop [--raw] [--json]| flag | values | meaning |
|---|---|---|
--raw |
Optional | |
--json |
Optional |
aos capture video stopaos capture video stop --raw --jsonaos capture video unfocus
Section titled “aos capture video unfocus”Send the camera back to its automatic mode
needs a display
Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works
aos capture video unfocusaos capture video unfocusaos capture video zoom
Section titled “aos capture video zoom”Re-render an aos recording with the auto camera, from its events file
needs a display
Under WSL / SSH: runs on the Windows host (the machine with the screen). How the host works
aos capture video zoom <in.mp4> [--events=<file>] [--out=<file>] [--pad=0.15] [--max-zoom=2.5] [--ease=0.6] [--hold-wide=1.0] [--zoom=2] [--follow=mouse|app|smart|off] [--size=1920x1080] [--json]| flag | values | meaning |
|---|---|---|
<in.mp4> |
Required positional argument | |
--events |
<file> |
Optional |
--out |
<file> |
Optional |
--pad |
<0.15> |
Optional. default 0.15 |
--max-zoom |
<2.5> |
Optional. default 2.5 |
--ease |
<0.6> |
Optional. default 0.6 |
--hold-wide |
<1.0> |
Optional. default 1.0 |
--zoom |
<2> |
Optional. default 2 |
--follow |
mouse, app, smart, off |
Optional |
--size |
<1920x1080> |
Optional. default 1920x1080 |
--json |
Optional |
aos capture video zoom ~/Movies/demo.mp4aos capture video zoom demo.mp4 --max-zoom=2 --ease=0.8 --out=demo.cut.mp4aos capture video zoom demo.mp4 --follow=off