From 3e0459b85cd8a15ae8ecdb017aa5169411f20720 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 12 Jan 2025 17:26:29 +0100 Subject: [PATCH] ffmpeg/formats --- sh/ffmpeg.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sh/ffmpeg.sh b/sh/ffmpeg.sh index c8471f6..0fb29e1 100644 --- a/sh/ffmpeg.sh +++ b/sh/ffmpeg.sh @@ -8,3 +8,16 @@ rwx_ffmpeg_devices_reset() { modprobe --remove "${module}" && modprobe "${module}" } + +# ╭────────┬────────┬─────────╮ +# │ ffmpeg │ device │ formats │ +# ╰────────┴────────┴─────────╯ + +rwx_ffmpeg_device_formats() { + local device="${1}" + [ -n "${device}" ] || device="/dev/video0" + ffmpeg \ + -f "v4l2" \ + -list_formats "all" \ + -i "${device}" +}