rwx/sh/ffmpeg.sh
2025-01-12 17:26:29 +01:00

23 lines
784 B
Bash

# ╭────────┬─────────┬───────╮
# │ ffmpeg │ devices │ reset │
# ╰────────┴─────────┴───────╯
_rwx_cmd_rwx_ffmpeg_devices_reset() { rwx_ffmpeg_devices_reset "${@}"; }
rwx_ffmpeg_devices_reset() {
local module="uvcvideo"
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}"
}