简体   繁体   中英

Mac Terminal: How to get faster screencaptures?

I've written the following script to help me get successive screencaptures. I'm able to get the screencaptures to happen in successive files, but not as fast as I'd like them. The sleep rate isn't recognized after a certain point.

What are the decimal limits for 'sleep'? If it can in fact go lower, is there something wrong with my script that is preventing the captures from happening at faster rate?

#!/bin/bash
while true; do
CAPTURE_FILE_NAME=`date "+%Y_%m_%d_%H%M%S.jpg"`
screencapture $CAPTURE_FILE_NAME
sleep .001
done
exit 0

Haven't used a mac for a while, but try adding time in front of the screencapture command - it should output information about how long it takes to execute. Could just be that it cannot go as fast as you want.

Based on your desired sleep time, you don't want a series of screencaptures, you want a video screen recording :) If you need to go higher than 30 fps, that will be tricky, but you can get a solid 30 out of ScreenFlow, as long as you have enough i/o bandwidth for it to write the uncompressed frames to disk during capture. I do this with a Mac Pro and two sata disks in raid 0, which is well fast enough for it to capture 1920 x 1200 at 30 fps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM