transcodex: a terminal interface to preserve my DVD and Blu-ray collection

·

Also available in Spanish: leer en castellano.

I have a shelf full of DVDs and Blu-rays that I don’t want to lose. Discs scratch, players break, and sooner or later the optical drive becomes the rarest piece of hardware in the house. So I decided to do what many people do: make digital copies of the movies I own, in a format my Apple TV plays without fuss.

The tool for that job is obvious, and it’s excellent: HandBrake. But there is a catch. I find its graphical interface uncomfortable for this kind of work. Converting one disc is fine; converting a whole collection means opening the same dialogs, choosing the same titles and the same settings, and waiting in front of a window, again and again.

What I actually wanted was simple: point something at a folder full of ISOs, let it run quietly in the background, and see at a glance what is done, what is running and what failed.

From a shell script to a terminal app

It began as a small shell script around HandBrakeCLI, HandBrake’s command-line version. It extracted the video titles from a disc image and converted them with settings that suit Apple TV. It worked, but it told me nothing about what was going on.

Over time the script grew into transcodex, a terminal user interface:

  • It takes ISO/IMG images and ordinary video files (mkv, mp4, avi, ts, m2ts, vob…), loose or by folder.
  • It produces .m4v files that Apple TV plays: H.264 High@4.1 up to 720p, AC3 audio (copied when it is already AC3), chapter markers and fast start.
  • It shows a live queue with the status and finish time of every file, HandBrake’s log or a summary of each conversion, and CPU, RAM and disk usage.
  • It runs at the lowest priority, so the computer stays usable while it works.
  • It writes to a .m4v.part file and renames it only when the conversion succeeds, so a half-finished file is never mistaken for a good one.
  • It includes a built-in ISO browser, and the output folder can be changed from the interface.

It is a single Python file with no third-party modules. The interface is in Spanish for now.

Standing on the shoulders of HandBrake

I want to be very clear about something: transcodex does not convert anything by itself. All the real work, the decoding, the filtering and the encoding, is done by HandBrake. I only wrote the comfortable front door.

HandBrake was created in 2003 by Eric Petit and has been developed ever since by a community of volunteers who have kept it free, open source and alive for more than twenty years. That is a remarkable piece of work, and every converted movie in my collection exists thanks to them. Thank you.

HandBrake in turn relies on other great open source projects, such as FFmpeg, x264 and the VideoLAN libraries that read discs. My thanks go to those teams too.

transcodex is an independent project and is not affiliated with, or endorsed by, the HandBrake team.

Try it

You need HandBrakeCLI installed. Then, depending on your system:

# macOS and Linux (Homebrew)
brew install mgoreiro/transcodex/transcodex

# any system with Python
pipx install transcodex

# Debian / Ubuntu: download the .deb from the releases page
sudo apt install ./transcodex_1.3.1_all.deb

And to convert everything in a folder:

transcodex ~/isos/ -r

The code is on GitHub under the GPL-3.0 license, and the releases are here. Issues, ideas and pull requests are welcome.

A word on discs: use it only to make copies of discs and files you own, and check what your local law allows when a disc is copy-protected.