About

Transcode is a command-line tool that transcodes, inspects, and converts videos. It runs Lisa Melton’s Video Transcoding on every video in a directory.

Transcode can:

  • Convert videos to .m4v.

  • Keep the chosen audio track and burn in the chosen subtitle track.

  • Extract audio to .mp3.

  • List the audio and subtitle tracks of each file.

  • Print a summary table of the results.

It reads avi, flv, m2ts, m4v, mkv, mov, mp4, mpeg, mpg, ts, vob, webm, and wmv files. It also reads subdirectories, such as ripped disc folders.

Install

Transcode needs Ruby 3.2 or later. It runs on macOS, GNU/Linux, Windows, and any other system Ruby supports. See Installing Ruby if Ruby is missing.

Install the gem:

gem install transcode

Or install with Homebrew from the tap:

brew install rdavid/tap/transcode

Transcode also needs the tools Video Transcoding uses. See its requirements.

Usage

transcode [options]
  -a, --act      Performs actual encoding.
  -u, --aud aud  Sets the audio stream numbers.
  -d, --dir dir  Sets the directory to transcode.
  -m, --mp3      Converts files to MP3.
  -o, --out out  Sets the output directory.
  -s, --sca      Scans files in the directory.
  -t, --sub sub  Sets the subtitle stream numbers.
  -i, --tit tit  Sets the title number.
  -v, --version  Shows the version.
  -w, --wid wid  Sets the output table width.

Transcode performs a dry run by default. It prints the commands it would run and a summary table without changing any files. Add --act to start encoding.

Without --dir and --out, Transcode uses the current directory for both. The --aud and --sub options take comma-separated track numbers. One value applies to every file. A list sets one value per file, in name order. The value 0 keeps the default audio track or burns no subtitle.

List the audio and subtitle tracks in [source]:

transcode --sca --dir [source]

Convert three files from [source] to [destination] with the chosen tracks:

transcode \
  --act \
  --aud 1,3,1 \
  --dir [source] \
  --out [destination] \
  --sub 2,1,3

Convert titles 1 and 3 when [source] holds one file or disc folder:

transcode --act --dir [source] --tit 1,3

Extract the audio of every file in the current directory to .mp3:

transcode --act --mp3

License

Copyright David Rabkin. Transcode ships under the Zero-Clause BSD license.