Add device pick

This commit is contained in:
Kuba Orlik 2022-09-20 20:25:48 +02:00
parent 259ce49c1e
commit 5fee511315

View File

@ -15,6 +15,11 @@ function sleep(time: number) {
} }
void (async function () { 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", [ const source = spawn("ffmpeg", [
"-f", "-f",
"video4linux2", "video4linux2",
@ -25,7 +30,7 @@ void (async function () {
"-video_size", "-video_size",
"3840x2160", "3840x2160",
"-i", "-i",
"/dev/video2", dev,
"-f", "-f",
"nut", "nut",
"-c", "-c",