Pimp my webcam (stream) project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

62 lines
4.1 KiB

#!/bin/bash
#
# virtcam.sh
#
# History:
# --------
# 05.05.20/KQ Initial version
# 09.05.20/KQ Automatic virtual port detection (via getvirtualvideo.py), several fixed values turned into parameters
# 12.05.20/KQ Local RSS feed added, more parameters ...
# 21.05.20/KQ A LOT more parameters now!
# 24.05.20/KQ Pick webcam video device by 'name' automatically
#
# 1. Install akvcam virtual camera devices
# 2. Activate (cv) environment script
# (previously generated via: virtualenv cv --python="python3")
# 3. Evaluate virtual cameras & run python stream modifier script
# 4. external --> run your webcam using application (guvcview, browser etc.)
# 5. external --> terminate (all) your webcam accessor(s)
# 6. Enforce user abort in script w/ [Ctrl-C]
# 7. Remove akvcam kernel module (& thus the virtual camera devices)
#
# Hint: After installation of a new kernel, you will have to 'make' akvcam again (kernel module!) ...
#
echo "Running virtcam ..."
NAMEPLATE="Expert (+++)"
# Adjust clear name! To find out, the program will list what's avail. (just start!)
WEBCAMID="HD Webcam C525"
WEBCAM=`python3 getvideobyname.py $WEBCAMID`
cd ~/cv
echo "Installing virtual devices ..."
ls /dev/video? >videolist1.txt
cd ~/akvcam/src
sudo modprobe videodev
sudo insmod akvcam.ko
echo "Starting 'stream modifier' application ..."
# The stream client program (browser, guvcview etc.) shall not be 'backgrounded' because of dynamic module load/unload within script!
echo "Activating (cv) environment ..."
source ~/cv/bin/activate
cd ~/cv
PWD=`pwd`
ls /dev/video? >videolist2.txt
CAMPORT=`python3 getvirtualvideo.py videolist`
echo "Actual webcam hardware assumed as: /dev/video$WEBCAM"
echo "1st virtual video port is : $CAMPORT"
echo ""
echo "*** For best video conference experience (currently, 5/2020) use chromium-browser ..."
# Alternate background (beta) not activated by default
# python3 funcam.py --webcam $WEBCAM --clock 505 472 0x101010 --date 494 428 0xffffff 0.8 --id "$NAMEPLATE" --logo 12 12 100 60 ' LIVE' 'Constance/Germany' emblem.png --turn --rss "https://www.heise.de/security/rss/news-atom.xml" --d3d --altb alternate_background.jpg > $CAMPORT
# python3 funcam.py --webcam $WEBCAM --clock 505 472 0x101010 --date 494 428 0xffffff 0.8 --id "$NAMEPLATE" --logo 12 12 100 60 ' LIVE' 'Constance/Germany' emblem.png --rss "file://$PWD/FakeNews.xml" --alarm 21:50 --d3d --ttf DejaVuSansCondensed-Bold.ttf --altb alternate_background.jpg --movie 100 180 150 100 spaceships.mp4 > $CAMPORT
# python3 funcam.py --webcam $WEBCAM --clock 505 472 0x101010 --date 494 428 0xffffff 0.8 --id "$NAMEPLATE" --logo 12 12 100 60 ' LIVE' 'Constance/Germany' emblem.png --turn --rss "https://www.hacknology.de/index.xml" --d3d --ttf DejaVuSansCondensed-Bold.ttf > $CAMPORT
# python3 funcam.py --webcam $WEBCAM --clock 505 472 0x101010 --date 494 428 0xffffff 0.8 --id "$NAMEPLATE" --logo 12 12 100 60 ' LIVE' 'Constance/Germany' emblem.png --turn --rss "https://www.hacknology.de/index.xml" --alarm 21:49 --d3d --ttf DejaVuSansCondensed-Bold.ttf --altb alternate_background.jpg --minimize 320 100 200 200 > $CAMPORT
# python3 funcam.py --webcam $WEBCAM --clock 505 472 0x101010 --date 494 428 0xffffff 0.8 --id "$NAMEPLATE" --logo 12 12 100 60 ' LIVE' 'Constance/Germany' emblem.png --turn --rss "https://www.hacknology.de/index.xml" --alarm 21:49 --d3d --ttf DejaVuSansCondensed-Bold.ttf --altb alternate_background.jpg --blur > $CAMPORT
# python3 funcam.py --webcam $WEBCAM --clock 505 472 0x101010 --date 494 428 0xffffff 0.8 --id "$NAMEPLATE" --turn --rss "https://www.hacknology.de/index.xml" --alarm 21:49 --d3d --ttf DejaVuSansCondensed-Bold.ttf --logo 12 12 120 69 ' LIVE' 'Constance/Germany' emblem.png --altb alternate_background_scifi.jpg --greenscreen --movie 100 180 150 100 spaceships.mp4 > $CAMPORT
python3 funcam.py --webcam $WEBCAM --clock 505 472 0x101010 --date 494 428 0xffffff 0.8 --id "$NAMEPLATE" --logo 12 12 100 60 ' LIVE' 'Constance/Germany' emblem.png --turn --rss "https://www.hacknology.de/index.xml" --alarm 21:49 --d3d --ttf DejaVuSansCondensed-Bold.ttf > $CAMPORT
echo "Removing virtual (camera) devices ..."
sudo rmmod akvcam.ko
echo "virtcam stopped."