Add device pick

This commit is contained in:
Kuba Orlik 2022-09-20 20:25:48 +02:00
parent 259ce49c1e
commit 5fee511315
1 changed files with 6 additions and 1 deletions

View File

@ -15,6 +15,11 @@ function sleep(time: number) {
}
void (async function () {
const pick_device =
await $`ls -1 /dev/video* | xargs -I {} bash -c "v4l2-ctl --device {} --info | grep --extended-regexp \\"(Model|Card type)\\" | awk -F: '{print \\$2}' | awk '{print \"{}\" \",\" \\$0}' | tr , '\n'" | zenity --list --column=device --column=name`;
const dev = `/dev/video${pick_device.stdout.split(" ")[0]}`;
const source = spawn("ffmpeg", [
"-f",
"video4linux2",
@ -25,7 +30,7 @@ void (async function () {
"-video_size",
"3840x2160",
"-i",
"/dev/video2",
dev,
"-f",
"nut",
"-c",