The Robservatory

Robservations on everything…

 

Detailed instructions for installing the transcode-video tools

My method of ripping Blu-ray discs relies on Don Melton’s video_transcoding tools. While these tools work great, they are command-line only (i.e. Terminal required). In my guide, I glossed over the installation bit, referring back to Don’s basic guide. But for those new to Terminal, even Don’s instructions may be too light on the details.

Hence this detailed installation guide for Don’s video_transcoding tools. This guide walks a new user through every step of the process, hopefully getting even someone brand new to Terminal up and running with Don’s tools. This will only be of interest if you’re having trouble getting the video_transcoding tools installed. If that’s you, though, hopefully this will be helpful.

The entire installation of the video_transcoding tool set and all its dependencies will take place in Terminal, which is the direct line to the Unix core of macOS. Open Terminal, which you’ll find in /Applications > Utilities, and you’ll be greeted by a window with some text; something like this:

This lovely interface is where you’ll spend the next chunk of time, installing the video_transcoding tools, and all the programs it uses to get its work done.

Note that this guide is not a detailed introduction to Terminal or Unix. (There are many such guides on the net, and if you’re interested, they’re well worth reading.) This guide is focused solely on how to use Terminal to install the video_transcoding tools, not how to use Terminal on its own. So let’s get started…

From here on out, all the instructions you see will happen in Terminal. I’ll show each command on its own line, for easy copy and paste, and then show the input and output as you’d see it in Terminal.

Step 1: Install video_transcoding

Don’s tools are packaged as a gem in Ruby. If that sounds like gobbledygook, don’t worry about it. All it means is that installation in macOS is as easy as this:

sudo gem install video_transcoding

You will be prompted for your administrator’s password, enter it and press Return, and you should see this in Terminal:

$ sudo gem install video_transcoding
Password:
Fetching: video_transcoding-0.12.3.gem (100%)
Successfully installed video_transcoding-0.12.3
Parsing documentation for video_transcoding-0.12.3
Installing ri documentation for video_transcoding-0.12.3
1 gem installed
$

The video_transcoding tools are now installed, but they’re not usable. That’s because these tools have many dependencies, or programs that are referenced by the video_transcoding tools. Unless we install those programs, video_transcoding can’t do its job.

So on to the dependencies (and there are many)…

Step 2: Install the Xcode command line tools

I just lied to you, in a way, because the Xcode command line tools are not required by the video_transcoding tools: As such, they’re not a dependency of the video_transcoding tools.

However, they are a dependency of the next thing we’ll install, which in turn will be used to install many other programs, so it’s pretty important to get them installed now, with this command:

xcode-select --install

When you hit Return, you’ll see a single line in response to your command:

$ xcode-select --install
xcode-select: note: install requested for command line developer tools

At this point, macOS will pop up a dialog, which is somewhat surprising as you’re working in the decidedly non-GUI Terminal:

Do not click Get Xcode, unless you want to wait while 5GB of data downloads and installs on your Mac. Instead, click the Install button, which will display an onscreen license agreement. Click Agree, then let the install finish—it’ll only take a couple of minutes.

If you’re curious as to what just happened, the installer created a folder structure in the top-level Library folder (/Library > Developer > CommandLineTools), and installed a slew of programs in the usr folder within the CommandLineTools folder.

Step 3: Agree to the license agreement

[Note: This step is only required if you try step four and it fails because you haven’t accepted the Xcode license agreement. If you’ve never installed Xcode, it’s likely that you’ll have to do the following…so you might as well do it before trying to install Homebrew.]

Before you (or rather, the tools you’re installing) can use any of these new programs, you need to agree to the Xcode license agreement:

sudo xcodebuild -license

Enter your admin password when prompted, then press Return to open a long…really long…license agreement. Press the Space bar to advance to the next page, until you reach the end (seemingly 500 Space Bar presses away).

When you get to the end, you’ll see this:

By typing 'agree' you are agreeing to the terms of the software license agreements. Type 'print' to print them or anything else to cancel, [agree, print, cancel]

Type agree and press Return, and you should see the system’s “all clear” language:

You can view the license agreements in Xcode's About Box, or at /Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf

With the legalese out of the way, you can finally install the tool that required the Xcode command line tools.

Step 4: Install Homebrew

Homebrew is a package manager for macOS. A package manager makes it easier to install, delete, and update other software programs; they’re very common in Unix operating systems, but there’s not one included by default in macOS. We’re going to use Homebrew to install the other video_transcoding dependencies, because it makes that task about a million times easier than doing it by hand.

As seen on the Homebrew web site, installation requires one long and ugly looking line of text. Copy and paste this into the Terminal window:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

When you press Return, lots of text is going to go scrolling by on your screen; it’ll look something like this:

Homebrew is now installed, and that opens up a world of possibilities for exploring the Unix side of macOS…but such an exploration is well beyond the scope of this how-to.

Step 5: Install Handbrake CLI

Note: These instructions have been updated as of January 15, 2017. The Handbrake CLI used to require the installation of Homebrew cask, but no longer—it’s now part of the core brew install, making installation much simpler.

Handbrake (specifically, the command line interface, or CLI) is used to process the videos, in conjunction with ffmpeg, installed in the next step. With Homebrew installed, installing handbrake (and the rest of the required apps) takes only a single line per command:

brew install handbrake

This is a simple installation, and it should proceed pretty quickly.

$ brew install handbrake
==> Downloading https://homebrew.bintray.com/bottles/handbrake-1.0.1.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring handbrake-1.0.1.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/handbrake/1.0.1: 8 files, 22.2M
$

In a nod to its naming, Homebrew uses a 🍺 to indicate the succesful installation of one of its apps.

Step 6: Install ffmpeg

ffmpeg is the tool that does the conversion work behind the scenes.

brew install ffmpeg

When installing ffmpeg, you’ll see that it has its own dependencies, which brings to mind this wonderful XKCD cartoon. But no worries, because Homebrew makes sure that everything you need to run the program is installed.

$ brew install ffmpeg
==> Installing dependencies for ffmpeg: lame, x264, xvid
==> Installing ffmpeg dependency: lame
==> Downloading https://homebrew.bintray.com/bottles/lame-3.99.5.sierra.bottle.
######################################################################## 100.0%
==> Pouring lame-3.99.5.sierra.bottle.1.tar.gz
🍺  /usr/local/Cellar/lame/3.99.5: 26 files, 2M
==> Installing ffmpeg dependency: x264
==> Downloading https://homebrew.bintray.com/bottles/x264-r2728.sierra.bottle.t
######################################################################## 100.0%
==> Pouring x264-r2728.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/x264/r2728: 11 files, 3.3M
==> Installing ffmpeg dependency: xvid
==> Downloading https://homebrew.bintray.com/bottles/xvid-1.3.4.sierra.bottle.t
######################################################################## 100.0%
==> Pouring xvid-1.3.4.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/xvid/1.3.4: 9 files, 1.2M
==> Installing ffmpeg 
==> Downloading https://homebrew.bintray.com/bottles/ffmpeg-3.2.2.sierra.bottle
######################################################################## 100.0%
==> Pouring ffmpeg-3.2.2.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/ffmpeg/3.2.2: 239 files, 50.4M
$
Step 7: Install mkvtoolnix

MKVToolNix is a collection of tools for working with MKV files, which is what you’ll get after ripping the data off your Blu-ray disc.

brew install mkvtoolnix

This one has a lot of dependencies, and could take a while to install.

$ brew install mkvtoolnix
==> Installing dependencies for mkvtoolnix: libogg, libvorbis, flac, libmagic, boost, libebml, libmatroska
==> Installing mkvtoolnix dependency: libogg
==> Downloading https://homebrew.bintray.com/bottles/libogg-1.3.2.sierra.bottle
######################################################################## 100.0%
==> Pouring libogg-1.3.2.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/libogg/1.3.2: 96 files, 457.4K
==> Installing mkvtoolnix dependency: libvorbis
==> Downloading https://homebrew.bintray.com/bottles/libvorbis-1.3.5.sierra.bot
######################################################################## 100.0%
==> Pouring libvorbis-1.3.5.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/libvorbis/1.3.5: 158 files, 2.3M
==> Installing mkvtoolnix dependency: flac
==> Downloading https://homebrew.bintray.com/bottles/flac-1.3.1.sierra.bottle.t
######################################################################## 100.0%
==> Pouring flac-1.3.1.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/flac/1.3.1: 52 files, 2.2M
==> Installing mkvtoolnix dependency: libmagic
==> Downloading https://homebrew.bintray.com/bottles/libmagic-5.29.sierra.bottl
######################################################################## 100.0%
==> Pouring libmagic-5.29.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/libmagic/5.29: 293 files, 5.8M
==> Installing mkvtoolnix dependency: boost
==> Downloading https://homebrew.bintray.com/bottles/boost-1.62.0.sierra.bottle
######################################################################## 100.0%
==> Pouring boost-1.62.0.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/boost/1.62.0: 12,405 files, 396.4M
==> Installing mkvtoolnix dependency: libebml
==> Downloading https://homebrew.bintray.com/bottles/libebml-1.3.4.sierra.bottl
######################################################################## 100.0%
==> Pouring libebml-1.3.4.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/libebml/1.3.4: 35 files, 576.9K
==> Installing mkvtoolnix dependency: libmatroska
==> Downloading https://homebrew.bintray.com/bottles/libmatroska-1.4.5.sierra.b
######################################################################## 100.0%
==> Pouring libmatroska-1.4.5.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/libmatroska/1.4.5: 35 files, 1.7M
==> Installing mkvtoolnix 
==> Downloading https://homebrew.bintray.com/bottles/mkvtoolnix-9.6.0.sierra.bo
######################################################################## 100.0%
==> Pouring mkvtoolnix-9.6.0.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/mkvtoolnix/9.6.0: 51 files, 14.0M
$
Step 8: Install mp4v2

mp4v2 is a library of tools for working with mp4 files, as you might guess from its name.

brew install mp4v2

No dependencies here, and the install is tiny and fast.

$ brew install mp4v2
==> Downloading https://homebrew.bintray.com/bottles/mp4v2-2.0.0.sierra.bottle.
######################################################################## 100.0%
==> Pouring mp4v2-2.0.0.sierra.bottle.1.tar.gz
🍺  /usr/local/Cellar/mp4v2/2.0.0: 33 files, 4.7M
$
Step 9: Install mplayer

Mplayer is a Linux/Unix movie player; there used to be a macOS GUI port, but it seems abandoned.

brew install mplayer

This is another dependency-free install, so it should go quickly.

$ brew install mplayer
==> Downloading https://homebrew.bintray.com/bottles/mplayer-1.3.0.sierra.bottl
######################################################################## 100.0%
==> Pouring mplayer-1.3.0.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/mplayer/1.3.0: 10 files, 27.4M
$

And believe it or not, that’s it! You’ve now installed the video_transcoding tools, and all their dependencies.

Staying current

As with normal applications, command line tools need occasional updating, too. Unfortunately, they may not tell you they need updating, so you’re left to your own devices: Open Terminal every so often and run these commands to stay current.

To update the video_transcoding tools, run this command:

sudo gem update video_transcoding

If there’s something to update, it will update and tell you so:

$ sudo gem update video_transcoding
Updating installed gems
Updating video_transcoding
Fetching: video_transcoding-0.13.0.gem (100%)
Successfully installed video_transcoding-0.13.0
Parsing documentation for video_transcoding-0.13.0
Installing ri documentation for video_transcoding-0.13.0
Installing darkfish documentation for video_transcoding-0.13.0
Gems updated: video_transcoding
$

To update Homebrew, you need to run two commands:

brew update
brew upgrade

You can also use brew outdated to see which packages are outdated before you upgrade them. Here’s how that process looks on my actual Homebrew installation. (This will also update Cask, because it’s installed under Homebrew.)

$ brew update
Updated 1 tap (homebrew/core).
==> Updated Formulae
abcm2ps                                gmime                                  python
$ brew outdated
ffmpeg (2.8.5) < 3.2.2
libebml (1.3.3) < 1.3.4
libmagic (5.25) < 5.29
libmatroska (1.4.4) < 1.4.5
mkvtoolnix (8.8.0_1) < 9.6.0
mplayer (1.2_1) < 1.3.0
x264 (r2601) < r2728
$ brew upgrade
==> Upgrading 7 outdated packages, with result:
ffmpeg 3.2.2, libebml 1.3.4, libmagic 5.29, libmatroska 1.4.5, mkvtoolnix 9.6.0, mplayer 1.3.0, x264 r2728
==> Upgrading ffmpeg 
==> Installing dependencies for ffmpeg: x264
==> Installing ffmpeg dependency: x264
==> Downloading https://homebrew.bintray.com/bottles/x264-r2728.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring x264-r2728.sierra.bottle.tar.gz
&#x1F37A;  /usr/local/Cellar/x264/r2728: 11 files, 3.3M
==> Installing ffmpeg 
==> Downloading https://homebrew.bintray.com/bottles/ffmpeg-3.2.2.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring ffmpeg-3.2.2.sierra.bottle.tar.gz
&#x1F37A;  /usr/local/Cellar/ffmpeg/3.2.2: 239 files, 50.4M
==> Upgrading libebml 
==> Downloading https://homebrew.bintray.com/bottles/libebml-1.3.4.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libebml-1.3.4.sierra.bottle.tar.gz
&#x1F37A;  /usr/local/Cellar/libebml/1.3.4: 35 files, 576.9K
==> Upgrading libmagic 
==> Downloading https://homebrew.bintray.com/bottles/libmagic-5.29.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libmagic-5.29.sierra.bottle.tar.gz
&#x1F37A;  /usr/local/Cellar/libmagic/5.29: 293 files, 5.8M
==> Upgrading libmatroska 
==> Downloading https://homebrew.bintray.com/bottles/libmatroska-1.4.5.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libmatroska-1.4.5.sierra.bottle.tar.gz
&#x1F37A;  /usr/local/Cellar/libmatroska/1.4.5: 35 files, 1.7M
==> Upgrading mkvtoolnix 
==> Downloading https://homebrew.bintray.com/bottles/mkvtoolnix-9.6.0.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring mkvtoolnix-9.6.0.sierra.bottle.tar.gz
&#x1F37A;  /usr/local/Cellar/mkvtoolnix/9.6.0: 51 files, 14.0M
==> Upgrading mplayer 
==> Downloading https://homebrew.bintray.com/bottles/mplayer-1.3.0.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring mplayer-1.3.0.sierra.bottle.tar.gz
&#x1F37A;  /usr/local/Cellar/mplayer/1.3.0: 10 files, 27.4M
$

This is the beauty of Homebrew: All those programs would have had to be separately downloaded and installed if you weren’t using a package manager. Instead, a few simple commands update everything you’ve installed.

Wrap up

Hopefully you found these steps easy to follow, and you’re now up and running with the transcode_video tools, and ripping your Blu-ray discs. If you are, great! If not, please post in the comments and I’ll do my best (time allowed, this is just a free time hobby) to help you out.

11 Comments

Add a Comment
  1. Hi Rob. I am stuck on step 6: Install Handbrake CLI.

    In the example response, it shows that it downloads version 0.10.5. Is it possible that show how it needs to find version 1.0 given Handbrake just released version 1.0?

    1. The error message I get is:

      Error: No available Cask for Handbrake like
      Error: nothing to install

  2. I clicked on the install it manually link and have downloaded the .dmg file, but have not installed it yet because I am not sure if it will install in the same way or to the same place.

    1. Everything else installed without any issues. It is just the “handbrakecli” that gave me the error code.

  3. By the way, your instructions were fantastic. I never would have known to do all of that without them. Thanks!

  4. “brew install handbrake” worked for me. Many thanks for this. Never would have pulled if off without your help!

    1. Yea it looks like they moved it out of cask, which makes the install a bit easier. Glad you got it working.

      -rob.

Leave a Reply

The Robservatory © 2017 Built from the Frontier theme