rwx/sh/ffmpeg.sh

24 lines
784 B
Bash
Raw Normal View History

2025-01-12 15:26:56 +00:00
# ╭────────┬─────────┬───────╮
# │ 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}"
}
2025-01-12 16:26:29 +00:00
# ╭────────┬────────┬─────────╮
# │ ffmpeg │ device │ formats │
# ╰────────┴────────┴─────────╯
rwx_ffmpeg_device_formats() {
local device="${1}"
[ -n "${device}" ] || device="/dev/video0"
ffmpeg \
-f "v4l2" \
-list_formats "all" \
-i "${device}"
}