Created
December 6, 2020 19:54
-
-
Save ntaraujo/eb6f00fd6bd47cf0c2d09c747d43e3b4 to your computer and use it in GitHub Desktop.
IP webcam connection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Exit if error | |
set -e | |
# My cam | |
WEBCAM="~/Projects/ipwebcam-gst/run-videochat.sh -w 1920 -h 1080" | |
# Unsure | |
case "$1" in | |
wifi) | |
;; | |
*) | |
# adb isn't using a port | |
adb kill-server | |
# smartphone is connected | |
adb wait-for-device | |
;; | |
esac | |
# Reload module (with right arguments) | |
sudo modprobe -r v4l2loopback | |
sudo modprobe v4l2loopback exclusive_caps=1 | |
# Ensure audio is connected to increase the volume | |
sleep 10 && pacmd set-source-volume ipwebcam.monitor 65863 & | |
# Start video and audio | |
case "$1" in | |
wifi) | |
# with wifi | |
eval "$WEBCAM --use-wifi XXX.XXX.X.XX" | |
;; | |
*) | |
# with usb | |
eval "$WEBCAM" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment