emphasize / doorpi Goto Github PK
View Code? Open in Web Editor NEWThis project forked from wuestengecko/doorpi
OpenSource VoIP Door-Intercomstation
Home Page: https://www.doorpi.org/forum/
License: Other
This project forked from wuestengecko/doorpi
OpenSource VoIP Door-Intercomstation
Home Page: https://www.doorpi.org/forum/
License: Other
Mit der Implementierung von 5707719 ist die Möglichkeit hinzugekommen, einen Videoserver als feed für das sipphone (pjsua) zu nutzen.
Da die benötigten Sytemressourcen noch nicht im Installationsscript verankert sind, hier die Dependenzen
#--- v4l2loopback
sudo apt install v4l2loopback-dkms v4l2loopback-utils
#Falls Probleme auftreten, video0 und video1 vertauscht werden (und damit der rtsp server nicht funktioniert)
#kann man statt devices=1 video_nr=X festlegen
#ACHTUNG: der wert von video_nr MUSS 3 oder kleiner sein, da sonst PJSUA das Gerät nicht initialisiert
#Es als /dev/video0 zu laden hat den vorteil, das es damit zum default device in PJSUA wird
echo "v4l2loopback" | sudo tee -a /etc/modules
echo 'options v4l2loopback devices=1
options v4l2loopback max_buffers=2
options v4l2loopback exclusive_caps=1
options v4l2loopback card_label="VirtualDoorpiCam #0"' | sudo tee /etc/modprobe.d/v4l2loopback.conf
Wer einen server aufsetzen will:
#--- v4l2rtspserver
sudo apt -y install cmake liblog4cpp5-dev libv4l-dev git
## Edit as needed.
VID_WIDTH=720
VID_HEIGHT=480
VID_FRAMES=15
VID_SER_PORT=7447
VID_DEV=/dev/video1
cd ~
git clone https://github.com/mpromonet/v4l2rtspserver.git
cd v4l2rtspserver/
cmake . && make && sudo make install
sudo sed -i "s#^ExecStart=.*#ExecStart=\/usr\/local\/bin\/v4l2rtspserver -W $VID_WIDTH -H $VID_HEIGHT -F $VID_FRAMES -P $VID_SER_PORT $VID_DEV#g" /lib/systemd/system/v4l2rtspserver.service
sudo systemctl enable v4l2rtspserver
cd ~ && rm -rf v4l2rtspserver
Reboot + Test (z.B. VLC Client): rtsp://<localip>:7447/unicast
Zur Erklärung: Der RTSP Server streamt direkt von dem Kamera Modul. Doorpi (resp. FFmpeg) transcoded den feed und legt ihn auf das loopback device (das wiederum von pjsua gelesen wird). Ähnlich funktioniert es, wenn man einen nicht stationären stream einbinden will (stream->tanscoding->loopback->pjsua)
HW: Raspi 3
Distri: Raspberry0S: Release date: January 28th 2022 32bit
Python: 3.9
Neuinstallation
Installtionsschritte
sudo apt-get -y install git mc
sudo apt-get -y update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade
git clone https://github.com/emphasize/DoorPi
cd /tmp
cd DoorPi
git checkout bugfix/setuptools
sudo python3 setup.py install --prefix=/usr/local
Logs habe ich mit angehängt
Was soll das script können?
:file entrypoints.in
eingebunden wird.Für system requirements empfehle ich das Python paket pako, um nicht für verschiedene Distros packages finden zu müssen
"nicht core relevant" ist dabei noch zu definieren.
Erweiternd ist zu erörtern was programmatisch nötig wäre Keyboards optional einzubinden.
Base: RaspiOS Bulleseye 32-Bit (2022-04-07) + Doorpi (branch bugfix/setuptools)
Da noch nicht im Setupscript verankert hier ein Rezept für eine laufende PJSUA/Asterisk konfiguration
Das ganze stützt sich auf 4 Komponenten:
System Dependenzen:
libtool pkg-config libasound2-dev libpulse-dev libaudio-dev libjack-dev \
libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev \
libxinerama-dev libxxf86vm-dev libxss-dev libgl1-mesa-dev libdbus-1-dev \
libudev-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev \
fcitx-libs-dev libsamplerate0-dev libsndio-dev libwayland-dev \
libxkbcommon-dev libdrm-dev libgbm-dev libraspberrypi0 libraspberrypi-bin libraspberrypi-dev \
libzrtpcpp-dev libxext-dev libpcre3-dev libtool libccrtp-dev libdbus-c++-dev libcommoncpp2-dev \
libdbus-1-dev libyaml-dev swig libsamplerate0-dev libspeexdsp-dev libspeex-dev libv4l-dev libx264-dev libcelt-dev \
libgmp3-dev libmpfr-dev libmpfr-doc libmpc-dev libffi-dev libmp3lame-dev libvorbis-dev libtheora-dev yasm nasm \
libopencore-amrwb-dev libopencore-amrnb-dev libvo-amrwbenc-dev libgsm1-dev opus-tools libopus-dev \
libass-dev libfreetype6-dev libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev \
libxcb-xfixes0-dev meson ninja-build texinfo wget zlib1g-dev libsdl2-dev vpx-tools libvpx-dev libvpx6 x264
Swap Anpassung (Kompilierung von pjsua hat eine gewisse ohne die der Prozess abbricht)
#notwendig sind 1.5Gb für (pjsua2) Kompilierung
MINMEM=1572864
SWAP=$(cat /proc/meminfo | grep SwapTotal | awk '{print $2}')
MEM=$(cat /proc/meminfo | grep MemTotal | awk '{print $2}')
TOTALMEM=$(expr $SWAP + $MEM)
if [ $TOTALMEM -lt $MINMEM ] ; then
sudo dphys-swapfile swapoff
SWAPNEEDED=$(expr $(expr $MINMEM - $MEM) / 1000)
sudo sed -i "s/CONF_SWAPSIZE=.*/CONF_SWAPSIZE=${SWAPNEEDED}/g" /etc/dphys-swapfile
sudo dphys-swapfile setup
sudo dphys-swapfile swapon
sudo reboot
fi
O264_PACKAGE="v2.2.0.tar.gz"
PJSIP_PACKAGE="2.12.tar.gz"
O264_VER=$(echo ${O264_PACKAGE%".tar.gz"} | cut -c 2-)
PJSIP_VER=${PJSIP_PACKAGE%".tar.gz"}
Openh264
cd ~ && wget https://github.com/cisco/openh264/archive/refs/tags/${O264_PACKAGE} && tar xvfz ${O264_PACKAGE} && cd openh264-${O264_VER}
make -j`nproc` && sudo make install
cd ~ && rm -rf openh264-${O264_VER} && rm ${O264_PACKAGE}
sudo ldconfig
Pjproject
cd ~
wget https://github.com/pjsip/pjproject/archive/refs/tags/${PJSIP_PACKAGE}
tar xvfz ${PJSIP_PACKAGE} && cd pjproject-${PJSIP_VER}
echo '#define PJMEDIA_AUDIO_DEV_HAS_ALSA 1
#define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO 0
#define PJMEDIA_HAS_VIDEO 1' > pjlib/include/pj/config_site.h
Raspberry Pi | -mtune | -mfpu | -march |
---|---|---|---|
Zero /1 A+/1 B+ | arm1176jzf-s | vfp | armv6 |
2 B | cortex-a7 | neon-vfpv4 | armv7 |
3 B | cortex-a53 | neon-vfpv4 | armv7 |
3 B+ /4 B | cortex-a72 | neon-fp-armv8 | armv8 |
vielleicht noch einmal genauer nachschauen, da es in jeder Generation zwischenmodelle gibt
echo "export CFLAGS += -march=armv7 -mtune=cortex-a53 -mfpu=neon-vfpv4 -mfloat-abi=hard -mlittle-endian -munaligned-access
-ffast-math
export LDFLGS +=" > user.mak
nano third_party/build/os-auto.mak.in
Die webrtc sektion mit folgender überschreiben:
ifneq (@ac_no_webrtc@,1)
ifeq (@ac_external_webrtc@,1)
# External webrtc
else
DIRS += webrtc
WEBRTC_OTHER_CFLAGS = -fexceptions -DWEBRTC_POSIX=1 @ac_webrtc_cflags@
#ifneq ($(findstring sse2,@ac_webrtc_instset@),)
# WEBRTC_SRC = \
# modules/audio_processing/aec/aec_core_sse2.o \
# modules/audio_processing/aec/aec_rdft_sse2.o \
# modules/audio_processing/aecm/aecm_core_c.o \
# modules/audio_processing/ns/nsx_core_c.o \
# system_wrappers/source/cpu_features.o
#else ifneq ($(findstring neon,@ac_webrtc_instset@),)
WEBRTC_SRC = \
modules/audio_processing/aec/aec_core_neon.o \
modules/audio_processing/aec/aec_rdft_neon.o \
modules/audio_processing/aecm/aecm_core_c.o \
modules/audio_processing/aecm/aecm_core_neon.o \
modules/audio_processing/ns/nsx_core_c.o \
modules/audio_processing/ns/nsx_core_neon.o \
common_audio/signal_processing/cross_correlation_neon.o \
common_audio/signal_processing/downsample_fast_neon.o \
common_audio/signal_processing/min_max_operations_neon.o
WEBRTC_OTHER_CFLAGS += -DWEBRTC_HAS_NEON
#else ifneq ($(findstring mips,@ac_webrtc_instset@),)
# WEBRTC_SRC = \
# modules/audio_processing/aec/aec_core_mips.o \
# modules/audio_processing/aec/aec_rdft_mips.o \
# modules/audio_processing/aecm/aecm_core_mips.o \
# modules/audio_processing/ns/nsx_core_mips.o \
# common_audio/signal_processing/cross_correlation_mips.o \
# common_audio/signal_processing/downsample_fast_mips.o \
# common_audio/signal_processing/min_max_operations_mips.o
#
# WEBRTC_OTHER_CFLAGS += -DMIPS_FPU_LE
#else # Generic fixed point
# WEBRTC_SRC = \
# modules/audio_processing/aecm/aecm_core_c.o \
# modules/audio_processing/ns/nsx_core_c.o \
# common_audio/signal_processing/complex_fft.o
#endif
endif
endif
./configure --enable-shared
make dep && make -j`nproc`
sudo make install
cd pjsip-apps/src/swig/python
make
sudo pip install .
cd ~ && sudo rm -rf pjproject-${PJSIP_VER} && rm ${PJSIP_PACKAGE}
sudo ldconfig
Pjsua hab ich zwischenzeitlich am laufen. Grundsätzlich sieht es auch eine Videoübertragung vor. Ob und wie jezt der PiKamera stream in die Sip übertragung eingebunden werden kann hab/kann ich derzeitig nicht testen können , mangels Hardware. Da die FB sowieso keine Bildübertragung unterstütz muss zusätzlich noch ein Sip Server eingerichtet werden mit dem man dann einen möglichen Stream testen kann. Piface geht auch lässt sich aber noch nicht ordnugsgemäß beenden, da stehe ich gerade auf dem schlauch
Anrufen von Pjsua führt derzeitig noch zum Absturz.
@emphasize @leoguiders @Pampersjoe wenn ich es richtig verstanden habe wollen wir die Diskussion hier weiter führen
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.