У меня есть пара идей...
Во-первых, и самое простое, вы можете запустить Quicktime (который поставляется с macOS) и перейти к File
->New screen recording
и записать произвольную область экрана и сохранить ее в ролике, а затем проанализировать кадры. .
Во-вторых, вы можете использовать screencapture
(/usr/sbin/screencapture
) и либо указать прямоугольник для захвата, либо идентификатор окна. Страница руководства неверна и бесполезна, поэтому используйте следующее, чтобы увидеть фактические параметры:
screencapture -h
Вывод
usage: screencapture [-icMPmwsWxSCUtoa] [files]
-c force screen capture to go to the clipboard
-b capture Touch Bar - non-interactive modes only
-C capture the cursor as well as the screen. only in non-interactive modes
-d display errors to the user graphically
-i capture screen interactively, by selection or window
control key - causes screen shot to go to clipboard
space key - toggle between mouse selection and
window selection modes
escape key - cancels interactive screen shot
-m only capture the main monitor, undefined if -i is set
-M screen capture output will go to a new Mail message
-o in window capture mode, do not capture the shadow of the window
-P screen capture output will open in Preview
-I screen capture output will in a new Messages message
-s only allow mouse selection mode
-S in window capture mode, capture the screen not the window
-t<format> image format to create, default is png (other options include pdf, jpg, tiff and other formats)
-T<seconds> Take the picture after a delay of <seconds>, default is 5
-w only allow window selection mode
-W start interaction in window selection mode
-x do not play sounds
-a do not include windows attached to selected windows
-r do not add dpi meta data to image
-l<windowid> capture this windowsid
-R<x,y,w,h> capture screen rect
-B<bundleid> screen capture output will open in app with bundleidBS
files where to save the screen capture, 1 file per screen
Как видите, опции -l
, -R
очень полезны.
Я написал небольшую программу, чтобы получить список windowids
в другом ответе, здесь.
Размер окна и формат файла влияют на скорость. Я считаю, что JPEG
обычно самый быстрый, а PNG
обычно самый медленный. Я могу получить 20 кадров в секунду с окном разумного размера, используя это:
time for i in {0..99}; do screencapture -l 56 -t jpg fred-$i.jpg; done
где я получил 56
из программы windowlist
в моем другом связанном ответе.
person
Mark Setchell
schedule
25.03.2017