screen capture

Resizing macOS app windows for 16:9 screen capture

I frequently need to capture a window of some Mac app for a recording (usually for my YouTube channel), and I've used a little AppleScript I wrote years ago for the purpose.

Somehow, that script (which I saved as a 'one shot' App (.app extension) that just runs then quits) got deleted off my Script Editor folder in my iCloud Drive, so I had to re-create it.

Luckily, the syntax for this operation is dead simple:

tell application "Safari"
    set bounds of front window to {0, 50, 1280, 770}
end tell

You can adjust the {X, Y, width, height} parameters accordingly—note that the width and height seem to be additive to the X/Y. So I use 770 instead of 720 for the height (720 + 50).

In Script Editor, save the file as a .app, with the option to keep it running unchecked. Now, whenever you want a window sized perfectly for capture, just press Command + Spacebar, then type in the name of the Script/App you saved, and hit enter. The top-most window in Safari will scale to exactly 720p resolution.

Making a Terminal window the right aspect ratio for streaming or recording

Recently I've been spending a bit of time producing video content of both browser windows and Terminal windows for screen recordings and livestreams on my YouTube channel.

One common issue I have to deal with is trying to optimize the aspect ratio of the window for the video dimensions. In 99% of all cases, I need the window to be 16:9. And ideally, I want the window to be recorded at 1280x720 at 2x 'retina' resolution, so when I capture the window, it will be nice and sharp at 1080p, which is my typical output resolution.

In the past, I'd open up a 1280x720 image at 2x resolution, then drag the Terminal window over it. However, getting that to be pixel perfect is sometimes frustrating, and it's always annoying since it takes me an extra 10-20 seconds per recording.

In my searching, I found this handy article from way back in 2013: How to Resize Windows on your Mac to Specific Sizes.

How I record my own conference presentations

At this year's php[tek] conference, I decided to record my own sessions (one on a cluster of Raspberry Pis, and another on tips for successfully working from home). Over the years, I've tried a bunch of different methods of recording my own presentations, and I've settled on a pretty good method to get very clear audio and visuals, so I figured I'd document my method here in case you want to do the same.

Grab a Single Frame from a Video in QuickTime X

Update: More recent versions of QuickTime Player have the ability to copy frames of the video by using 'Command + C'. In recent versions, to grab a frame, do the following:

  1. In QuickTime Player: Pause on the frame you want to capture (use arrow keys to go forward/backward by 1 frame).
  2. Press 'Command-C' (or select Edit > 'Copy').
  3. In Preview: Press 'Command-N' (or select File > 'New from Clipboard')
  4. Save the new file where you'd like.

There are many things to like about QuickTime X, and many improvements were included over QuickTime Pro 7... but there were also a ton of features removed (like being able to set advanced export options, save a movie as images, and do some other more advanced edits/exports.

However, I'm glad I finally figured out how I can grab one frame from a movie in QuickTime Player X. The problem I was having is this: If you pause the video and use the left/right arrow keys to move the playhead exactly to the frame you want, the player controls are still showing over the video (in addition to the video title bar/window chrome.