Transcode converts a whole directory of video files in one run from the command line. It wraps Lisa Melton’s Video Transcoding, which converts one file per invocation. Transcode applies that same workflow to every video in a directory with one command.
Transcode can:
-
Convert an entire directory to
.m4vin 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.
Transcode ships as a Ruby gem and requires Ruby 3.2 or later. It runs on macOS, GNU/Linux, Windows, and any other system Ruby supports. See Installing Ruby if your platform lacks Ruby 3.2+.
Install with:
gem install transcodeSee Video Transcoding’s requirements for external dependencies.
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.
Adding --act starts 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: one
value applies to every file, or each file takes its own value.
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,3Extract the audio of every file in the current directory to .mp3:
transcode --mp3 --acttranscode carries copyright by David Rabkin and ships under a
Zero-Clause BSD license.