Skip to content

rdavid/transcode

Repository files navigation

Transcode

About

Transcode is a command-line tool that converts whole directories of video files in one run. It wraps Lisa Melton’s Video Transcoding and applies the same workflow to every video in a directory, so a folder of clips takes a single command instead of one invocation per file.

Transcode can:

  • Convert an entire directory to .m4v in a single run.

  • Select the main audio and burned-in subtitle stream for each file.

  • Extract audio to .mp3.

  • Scan files to list their available audio and subtitle streams.

  • Print a summary table of the results.

It recognizes these input formats: avi, flv, m2ts, m4v, mkv, mp4, mpg, mpeg, mov, ts, webm, vob, and wmv.

Installation

The tool runs on macOS, GNU/Linux, Windows, and other Unix-like systems. It is packaged as a Ruby gem and requires Ruby 3.2 or later. See Installing Ruby if Ruby 3.2+ is not available on your platform.

Install with:

gem install transcode

Updating

Update with:

gem update transcode

Requirements

See Video Transcoding’s requirements for external dependencies.

Usage

transcode [options]
  -a, --act      Perform actual encoding.
  -u, --aud aud  Audio stream numbers.
  -d, --dir dir  Source directory to transcode.
  -m, --mp3      Convert files to MP3.
  -o, --out out  Output directory.
  -s, --sca      Scan files in the directory.
  -t, --sub sub  Subtitle stream numbers.
  -i, --tit tit  Specific title number.
  -v, --version  Show version.
  -w, --wid wid  Width of the table.

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

Without --dir and --out, Transcode reads from and writes to the current directory. The --aud and --sub options take comma-separated stream numbers, either one value applied to every file or one value per file.

Example

Scan the source directory to inspect the available audio and subtitle streams:

transcode --sca --dir [source]

Transcode three files from [source] to [destination] with the selected audio and subtitle streams. Add --act once the plan looks right:

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

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

transcode --mp3 --act

License

transcode is copyright David Rabkin and available under a Zero-Clause BSD license.

About

The tool designed to transcode, inspect, and convert video files.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages