aboutsummaryrefslogtreecommitdiffstats
path: root/ffget-audio-extension
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2024-11-26 22:08:22 +0100
committerMattias Andrée <m@maandree.se>2024-11-26 22:08:22 +0100
commit5da5e89beec8ad11f3dc7c9598ab69d97ad82468 (patch)
treedcb65e9afe179583dec3a54fd142dc2b8f483e00 /ffget-audio-extension
downloadffutils-5da5e89beec8ad11f3dc7c9598ab69d97ad82468.tar.gz
ffutils-5da5e89beec8ad11f3dc7c9598ab69d97ad82468.tar.bz2
ffutils-5da5e89beec8ad11f3dc7c9598ab69d97ad82468.tar.xz
First commit
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'ffget-audio-extension')
-rwxr-xr-xffget-audio-extension26
1 files changed, 26 insertions, 0 deletions
diff --git a/ffget-audio-extension b/ffget-audio-extension
new file mode 100755
index 0000000..7f0156f
--- /dev/null
+++ b/ffget-audio-extension
@@ -0,0 +1,26 @@
+#!/bin/sh
+# See LICENSE file for copyright and license details.
+
+set -e
+
+usage () {
+ printf 'usage %s: in-file\n' "$0" >&2
+ exit 1
+}
+
+while test "${1::1}" = '-'; do
+ if test "${1}" = '--'; then
+ shift
+ break
+ elif test "${1}" = '-'; then
+ break
+ else
+ usage
+ fi
+done
+
+if test ! $# = 1; then
+ usage
+fi
+
+exec ffprobe -v error -select_streams a:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 -- "$1"