Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lsmkv

A CLI tool for auditing Matroska .mkv files. lsmkv reports each file's average bitrate, size, duration, and codec.

Metadata is read directly from the .mkv container without decoding, so it stays fast across large libraries.

Features

  • Recursively scans directories for .mkv files
  • Reports average bitrate, size, duration, and codec for each
  • Accepts directories and individual files as command line arguments

Installation

From source

git clone https://github.com/mininit/lsmkv.git
cd lsmkv
cargo build --release

The binary will be at target/release/lsmkv.

Via Homebrew

brew install mininit/tap/lsmkv

Usage

lsmkv [OPTIONS] [PATHS]...

If no path is given, lsmkv recursively scans the current directory.

Arguments

Argument Description
PATHS Files or directories to scan. Defaults to . if omitted

Options

Flag Description
-h, --help Print help
-V, --version Print version

Output columns

Column Description
Bitrate Average bitrate in Mbps
Size File size (binary units, e.g. 25.7M)
Duration Runtime in minutes
Codec Video codec (e.g. AV1, H.265)

Examples

Recursively scan the current directory:

lsmkv

Recursively scan a media library:

lsmkv ~/Videos

Check specific files:

lsmkv video_1.mkv video_2.mkv

Mixed files and directories:

lsmkv video_1.mkv ~/Videos

Sample output

$ lsmkv .
  18.4Mbps   25.7M   11.7min   AV1 ./video_3.mkv
   5.7Mbps   11.0M   16.1min H.265 ./video_1.mkv
   3.4Mbps    7.8M   19.1min H.264 ./video_2.mkv

Sorting

lsmkv streams output instantly and does not sort. Pipe through sort instead:

lsmkv ~/Videos | sort -k1,1 -rn   # highest bitrate first

Filtering

lsmkv ~/Videos | grep 'H\.264'   # show only H.264 encoded files

grep matches anywhere in the line, so it's fine for quick checks. For exact column matching, use awk:

lsmkv ~/Videos | awk '$4 == "AV1"'   # show only AV1 encoded files

About

A CLI tool for auditing Matroska (.mkv) files

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages