You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jamie Quigley ce064834af
Merge pull request #19 from Sciencentistguy/renovate/clap-3.x
4 days ago
src Update argument parser to clap v3 3 weeks ago
.gitignore It doesn't work yet, obviously. I think I might have to give up and parse ffprobe 1 year ago
Cargo.lock Update Rust crate clap to 3.0.10 5 days ago
Cargo.toml Update Rust crate clap to 3.0.10 5 days ago
LICENCE Rename LICENSE to LICENCE 1 year ago
PKGBUILD Update pkgbuild to use correct pkgver 5 months ago Update 6 months ago
renovate.json Add renovate.json 2 months ago



Install with cargo install --git

There is also a PKGBUILD provided.


videoconverter [path].

[path] is optional, and defaults to .

Run videoconverter -h to see all possible arguments and their defaults.

If TV show mode is enabled, the program will ask for the following:

  • The show name
  • The current season
  • The first episode in the current directory. (This one is useful for when you've got a season of a show split amongst multiple directories, i.e. a DVD box set)

The program will attempt to read the previous values of these from a statefile (by default /tmp/videoconverter.state). If this is present it will suggest these to you as default values.


The program will analyse each file, and convert audio and video streams appropriately, to the following:

  • Container:
    • .mkv
  • Video:
    • If the original stream is h.264 or h.265, it will be copied.
    • If GPU mode is enabled (--gpu), the stream will be encoded as h.265 (nvenc) with the following flags: -rc constqp -qp 20 -preset slow -profile:v main -b:v 0 -rc-lookahead 32.
    • Else, it will be encoded as h.264 (libx264) with the following flags: -profile:v high -rc-lookahead 250 -preset slow -crf 20 -x264opts opencl.
  • Audio:
    • If the original stream is aac or flac, it will be copied.
    • If the original stream is DTS-MA or Dolby TrueHD, it will be encoded as flac.
    • Else, it will be encoded as aac (libfdk_aac) with the following flags: -cutoff 18000 -vbr 5.
  • Subtitles
    • If the original stream is HDMV_PGS (Bluray) or DVD, it will be copied.
    • Else, it will be encoded as ssa (ass).

If there are English audio and subtitle streams, then other languages' streams will be discarded. This can be overridden with --all-streams.

If the file contains more than one video stream, only the first will be kept. If it contains zero video streams, the program will panic.


This program uses libav* from the ffmpeg project to analyse the input files. It then constructs a command for ffmpeg to convert the files, and then runs it.


  • Write a backend that uses libav* directly.

Available under the terms of version 3 of the GNU GPL.