summaryrefslogtreecommitdiff
path: root/bin/vidsize
diff options
context:
space:
mode:
authorSam Nystrom <sam@samnystrom.dev>2026-01-15 22:34:35 -0500
committerSam Nystrom <sam@samnystrom.dev>2026-01-15 22:34:35 -0500
commitc40794b2040330ec2625bedf7df961115680c08b (patch)
tree4ff1d4fda76d5d59d5d3604a015cc474438ab470 /bin/vidsize
parent8fdacc55625a04f94d3e364d53aeec84bc93f6be (diff)
update bin
Diffstat (limited to 'bin/vidsize')
-rwxr-xr-xbin/vidsize10
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/vidsize b/bin/vidsize
new file mode 100755
index 0000000..9d07e85
--- /dev/null
+++ b/bin/vidsize
@@ -0,0 +1,10 @@
+#!/bin/sh -eu
+
+printf 'DURATION\tSIZE\tB/MIN\tFILE\n'
+for f in "$@"; do
+ dur=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "$f" | cut -d. -f1)
+ size=$(ls -l "$f" | awk '{print $5}')
+ hsize=$(ls -lh "$f" | awk '{print $5}')
+ bpm=$((size/dur))
+ printf '%dh%02dm%02ds\t%s\t%d\t%s\n' $((dur/3600)) $((dur/60%60)) $((dur%60)) $hsize $bpm "$f"
+done