Merge branch 'master' of [fd63:bb49:f2eb:1337::a1]:~/LiveCam

This commit is contained in:
livecam 2020-08-14 20:11:11 +02:00
commit 44e62a937e
3 changed files with 56 additions and 69 deletions

View File

@ -1,9 +1,58 @@
# LiveCam
live cam stuff
Kamera-Steaming-Setup auf Basis von ZOTAC ZBOX PRO PI335 pico.
# scan for AP
iwlist ath0 scanning
## Vorbereitung (debian 10)
# get Wifi status every Second
ssh ubnt@192.168.1.19 -C 'while true; do iwconfig ath0; sleep 1; done;'
`apt install htop git vim lshw sudo screen tmux`
* /etc/vim/vimrc.local erstellen:
`autocmd BufEnter * set mouse=`
* /etc/apt/sources.list alle Zeilen erweitern auf:
`… main contrib non-free`
* /etc/default/grub in Zeile `GRUB_CMDLINE_LINUX_DEFAULT=` einfügen:
`rootflags=data=journal`
* grub updaten:
`update-grub2`
* Pakete nachinstallieren:
```
apt update
apt install firmware-linux firmware-iwlwifi firmware-realtek wpasupplicant wireless-tools iw gstreamer1.0-tools gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-alsa alsa-utils v4l-utils
```
* in /etc/network/interfaces
```
# Chaosnetz
allow-hotplug wlo2
iface wlo2 inet dhcp
wpa-ssid LiveCam
wpa-psk xxxxxxx
up iw dev wlo2 set power_save off
iface wlo2 inet6 static
address fd63:bb49:f2eb:1337::c1/64
```
* /etc/hosts ergänzen:
```
fd63:bb49:f2eb:1337::c1 cam1
fd63:bb49:f2eb:1337::c2 cam2
fd63:bb49:f2eb:1337::a1 terminal1
fd63:bb49:f2eb:1337::a2 terminal2
```
```
useradd -m livecam -s /bin/bash -G video,audio,sudo
passwd livecam # set the usual password
su -l livecam
reboot && exit
```

View File

@ -1,62 +0,0 @@
neues Setup auf Basis von ZOTAC ZBOX PRO PI335 pico
debian 10 vorbereiten
---------------------
apt install htop git vim lshw sudo screen tmux
# /etc/vim/vimrc.local erstellen
autocmd BufEnter * set mouse=
# /etc/apt/sources.list alle Zeilen erweitern auf
... main contrib non-free
# /etc/default/grub
# in Zeile GRUB_CMDLINE_LINUX_DEFAULT= einfügen:
rootflags=data=journal
# grub updaten
update-grub2
# Pakete nachinstallieren
apt update
apt install firmware-linux firmware-iwlwifi firmware-realtek wpasupplicant wireless-tools iw gstreamer1.0-tools gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-alsa alsa-utils v4l-utils
# vi /etc/network/interfaces
# Chaosnetz
allow-hotplug wlo2
iface wlo2 inet dhcp
wpa-ssid LiveCam
wpa-psk xxxxxxx
up iw dev wlo2 set power_save off
iface wlo2 inet6 static
address fd63:bb49:f2eb:1337::c1/64
# /etc/hosts ergänzen
fd63:bb49:f2eb:1337::c1 cam1
fd63:bb49:f2eb:1337::c2 cam2
fd63:bb49:f2eb:1337::a1 terminal1
fd63:bb49:f2eb:1337::a2 terminal2
useradd -m livecam -s /bin/bash -G video,audio,sudo
passwd livecam # set the usual password
su -l livecam
reboot && exit
Videostream bereitstellen
-------------------------
v4l2-ctl -d /dev/video0 --set-ctrl=power_line_frequency=1 --set-ctrl=backlight_compensation=1 --stream-lossless --set-fmt-video=width=1920,height=1080,pixelformat=YUYV
gst-launch-1.0 -e rtpbin name=b rtp-profile=avpf uvch264src device=/dev/video0 name=src auto-start=true \
src.vidsrc ! video/x-raw,framerate=30/1,profile=high ! videoscale ! video/x-raw,width=1920,height=1080 ! videoconvert ! x264enc tune=zerolatency bitrate=5000 speed-preset=superfast key-int-max=15 ! rtph264pay ! rtpulpfecenc percentage=50 percentage-important=75 ! rtprtxqueue max-size-packets=1000 ! b.send_rtp_sink_0 \
b.send_rtp_src_0 ! udpsink host=terminal1 port=5001 \
udpsrc address=:: port=5002 ! b.recv_rtcp_sink_0 \
b.send_rtcp_src_0 ! udpsink host=terminal1 port=5003 sync=false async=false
Videostream empfangen
---------------------
gst-launch-1.0 -e rtpbin name=b rtp-profile=avpf do-retransmission=true \
udpsrc address=:: port=5001 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! b.recv_rtp_sink_0 b. ! rtpulpfecdec ! rtph264depay ! decodebin ! videoconvert ! fbdevsink device=/dev/fb0 \
udpsrc address=:: port=5003 ! b.recv_rtcp_sink_0 \
b.send_rtcp_src_0 ! udpsink host=cam1 port=5002 sync=false async=false

View File

@ -23,7 +23,7 @@ export DISPLAY=:0
GSTPID=$!
while true; do
# rename window (FIXME: possible race condition with window for cam 2)
# rename window (FIXME: using different players is a nasty hack)
GSTXID="$(wmctrl -l | grep "OpenGL renderer" | cut -d" " -f1)" >/dev/null 2>&1
wmctrl -i -r "$GSTXID" -e 0,2000,0,1000,1000 >/dev/null 2>&1
wmctrl -i -r "$GSTXID" -b add,fullscreen >/dev/null 2>&1
@ -68,7 +68,7 @@ PIDS="$PIDS $!"
GSTPID=$!
while true; do
# rename window (FIXME: possible race condition with window for cam 2)
# rename window (FIXME: using different players is a nasty hack)
GSTXID="$(wmctrl -l | grep "gst-launch-1.0" | cut -d" " -f1)" >/dev/null 2>&1
wmctrl -i -r "$GSTXID" -e 0,0,0,1000,1000 >/dev/null 2>&1
wmctrl -i -r "$GSTXID" -b add,fullscreen >/dev/null 2>&1