mirror of
https://github.com/iAmInActions/random-scripts.git
synced 2024-11-10 06:00:12 +00:00
Add elgato2v4l2
Simple script to automatically configure and pipe the streams from the elgato game capture card to a virtual camera. Ideal for use with OBS.
This commit is contained in:
parent
865ea5f02b
commit
aae0945c85
25
elgato2v4l2.sh
Normal file
25
elgato2v4l2.sh
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
rmmod v4l2loopback
|
||||||
|
modprobe v4l2loopback
|
||||||
|
|
||||||
|
if [ "$1" = "hdmi" ]; then
|
||||||
|
echo "HDMI mode selected."
|
||||||
|
gchd -i hdmi -c rgb $2 $3 -of fifo /dev/elgatotmp.ts &
|
||||||
|
sleep 6
|
||||||
|
ffmpeg -i /dev/elgatotmp.ts -vcodec rawvideo -f v4l2 $(ls /dev/video* | tail -n1)
|
||||||
|
elif [ "$1" = "composite" ]; then
|
||||||
|
echo "Composite mode selected."
|
||||||
|
gchd -i composite -of fifo /dev/elgatotmp.ts &
|
||||||
|
sleep 6
|
||||||
|
ffmpeg -i /dev/elgatotmp.ts -f v4l2 $(ls /dev/video* | tail -n1)
|
||||||
|
elif [ "$1" = "component" ]; then
|
||||||
|
echo "Component mode selected."
|
||||||
|
gchd -i component -c rgb $2 $3 -of fifo /dev/elgatotmp.ts &
|
||||||
|
sleep 6
|
||||||
|
ffmpeg -i /dev/elgatotmp.ts -vcodec rawvideo -f v4l2 $(ls /dev/video* | tail -n1)
|
||||||
|
else
|
||||||
|
echo "ERROR:"
|
||||||
|
echo "Please specify a mode."
|
||||||
|
echo "Usage: elgato2v4l2.sh [mode] <options>"
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user