Skip to content

Unix

Get more details from transcode-video

While working on my massive Blu-ray ripping comparison, I wanted more information about what some of the transcode-video presets were doing. That is, if you pick --target big, exactly what settings are being used to rip the video?

It turns out there's --dry-run option for transcode-video that will tell you exactly that. (I've added some line breaks for readability here.)

What's neat is that you can also use this to see what the default options are for transcode-video when you don't supply it with any options. Just use the --dry-run parameter option but leave off any of the presets (i.e. --target big), and the output will show you the defaults.

In addition, you can use it on already-ripped media to get their details as well, regardless as to how you ripped the movie.

In a related vein, I was having issues with the above rip, because I thought that the surround sound track wasn't being ripped. Again, thanks to Don, I learned about a second command line option for transcode-video that reveals exactly what's in a ripped video.

[continue reading…]



Semi-automatic Homebrew and video-transcode updates

As I've written about in the past, I use Don Melton's video transcoding tools to rip Blu-Ray discs. I also use Homebrew to install some of the transcode video dependencies, as well as other Unix tools.

Keeping these tools current isn't overly difficult; it only requires a few commands in Terminal:

$ brew update
$ brew upgrade
$ sudo gem update video_transcoding

My problem is that I often forget to do this, because—unlike most GUI Mac apps and the Mac App Store—there's no built-in "hey, there's an update!" system. Suddenly, two months and many revisions later, I finally remember (usually when I see a tweet about a new version of something.) So I thought I'd try to write my own simple update reminder.

I didn't really want a scheduled task, like a launchd agent—it's not like these tools need to stay current on a daily basis. (And one of them needs to run with admin privileges, which complicates things.) I just wanted something that would remind me if it'd been a while since I last checked for updates, and then install the updates if I wanted it to do so.

After mulling it over, I came up with a script that runs each time I open a Terminal window (which I do daily). The referenced script looks at the date on a check file, and asks me if I'd like to check for updates if that date is more than a week older than today's date. This is perfect for my needs: The reminder is automatic, but I can choose when to install the updates based on what I'm doing at the time. If it's been under a week since I last checked, nothing at all is different about my Terminal launch.

Read on for the script and implementation details. (Note: This is not written for a Terminal beginner, as it assumes some knowledge about how the shell works in macOS.)

[continue reading…]



Use sips to quickly, easily—and freely—convert image files

Quite often, I find myself with a number of images (screenshots, typically) that I'll want to convert from one format to another. If you search the Mac App Store, there are probably 300 apps that will let you do this; many are probably free. You could also use Automator, which has some good image conversion abilities, but can't (for example) specify the quality of a JPEG conversion.

But the best way I've ever found is to use a tool that's been included with every copy of macOS since the release of Mac OS X 10.3 (Panther) in October of 2003: A command line tool called sips. Yes, it requires using Terminal, but it's quite easy to use. sips can modify one file, or any number of files, converting from one format to another. You can also use sips to resize images, rotate images, and more.

Basic usage of sips is straightforward. (The following is written for Terminal neophytes, so apologies for any over-explaining). Assume you have an image named Beach party.tiff that you'd like to convert into a smaller JPEG, but with a relatively high quality setting. Here's how you'd do it using sips:

  1. Open Terminal, in Applications > Utilities.
  2. Type cd, then press the Space Bar, then drag in the folder that contains the image(s) to be converted. (Alternatively, you can use this tip to directly open the selected Finder folder in Terminal.)
  3. Type this, then press Return: sips -s format jpeg -s formatOptions 80 "Beach party.tiff" --out "Beach party.jpg"

When you press Return, sips will convert your image file—and it's really fast, even on larger files. The formatOptions item lets you set the quality of the JPEG in either percentage (as I used), or you can use words: low, normal, high, or best. Hopefully obviously, you specify the new filename after the --out string.

Note that the filename is enclosed in quotes. Those quotes are required, otherwise any spaces in your filenames will cause the command to break.

The real power of sips isn't in converting one file, though; it's in batch converting many files. Here's how to do that…

[continue reading…]