QuantumEntangledAndy / neolink

An RTSP bridge to Reolink IP cameras
GNU Affero General Public License v3.0
250 stars 41 forks source link

Headless / no-GUI operation (on Debian) ? #177

Closed iam-TJ closed 8 months ago

iam-TJ commented 8 months ago

Following the README instructions for installation on Debian (or derivatives) the suggested installation of the various gstreamer packages tries to install GUI libraries for Wayland and X.

Is there a list of the absolutely required libraries that might avoid the Debian package dependencies trying to force installation of this lot (note this is with --no-install-recommends) ?

tj@noc:~/neolink_linux_armhf$ sudo apt install --no-install-recommends   libgstrtspserver-1.0-0   libgstreamer1.0-0   libgstreamer-plugins-bad1.0-0    gstreamer1.0-plugins-base   gstreamer1.0-pl
ugins-good   gstreamer1.0-plugins-bad                                                                                                                                                             
Reading package lists... Done                                                                                                                                                                     
Building dependency tree... Done                                                                                                                                                                  
Reading state information... Done                                                                                                                                                                 
The following additional packages will be installed:                                                                                                                                              
  adwaita-icon-theme at-spi2-common dconf-gsettings-backend dconf-service fontconfig fontconfig-config fonts-dejavu-core glib-networking glib-networking-common glib-networking-services          
  gsettings-desktop-schemas gtk-update-icon-cache hicolor-icon-theme libaa1 libaom3 libass9 libasyncns0 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libavc1394-0 libavcodec59 libavutil57        
  libbs2b0 libcaca0 libcairo-gobject2 libcairo2 libcdparanoia0 libchromaprint1 libcodec2-1.0 libcolord2 libcups2 libcurl3-gnutls libdatrie1 libdav1d6 libdc1394-25 libdca0 libdconf1 libde265-0   
  libdecor-0-0 libdirectfb-1.7-7 libdrm-amdgpu1 libdrm-nouveau2 libdrm-radeon1 libdv4 libdvdnav4 libdvdread8 libegl-mesa0 libegl1 libepoxy0 libfaad2 libflac12 libflite1 libfluidsynth3           
  libfontconfig1 libfreeaptx0 libfreetype6 libgbm1 libgdk-pixbuf-2.0-0 libgdk-pixbuf2.0-common libgl1 libgl1-mesa-dri libglapi-mesa libgles2 libglvnd0 libglx-mesa0 libglx0 libgme0               
  libgraphite2-3 libgsm1 libgssdp-1.6-0 libgstreamer-gl1.0-0 libgstreamer-plugins-base1.0-0 libgtk-3-0 libgtk-3-common libgudev-1.0-0 libgupnp-1.6-0 libgupnp-igd-1.0-4 libharfbuzz0b libhwy1     
  libiec61883-0 libimath-3-1-29 libinstpatch-1.0-2 libjack-jackd2-0 libjson-glib-1.0-0 libjson-glib-1.0-common libjxl0.7 libkate1 liblcms2-2 libldacbt-enc2 liblilv-0-0 libllvm15 liblrdf0        
  libltc11 libmjpegutils-2.1-0 libmodplug1 libmp3lame0 libmpcdec6 libmpeg2encpp-2.1-0 libmpg123-0 libmplex2-2.1-0 libneon27 libnice10 libnspr4 libnss3 libogg0 libopenal-data libopenal1          
  libopenexr-3-1-30 libopenh264-7 libopenjp2-7 libopenmpt0 libopenni2-0 libopus0 liborc-0.4-0 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpixman-1-0 libpng16-16 libproxy1v5          
  libpulse0 libqrencode4 libraptor2-0 librav1e0 libraw1394-11 librsvg2-2 libsdl2-2.0-0 libsensors-config libsensors5 libserd-0-0 libshine3 libshout3 libsndfile1 libsndio7.0 libsord-0-0          
  libsoundtouch1 libsoup-3.0-0 libsoup-3.0-common libsoxr0 libspeex1 libsratom-0-0 libsrt1.5-gnutls libsrtp2-1 libsvtav1enc1 libswresample4 libtag1v5 libtag1v5-vanilla libthai-data libthai0     
  libtheora0 libtwolame0 libunwind8 libv4l-0 libv4lconvert0 libva-drm2 libva-x11-2 libva2 libvdpau1 libvisual-0.4-0 libvo-aacenc0 libvo-amrwbenc0 libvorbis0a libvorbisenc2 libvorbisfile3        
  libvpx7 libvulkan1 libwavpack1 libwayland-client0 libwayland-cursor0 libwayland-egl1 libwayland-server0 libwebpmux3 libwebrtc-audio-processing1 libwildmidi2 libx11-6 libx11-data libx11-xcb1   
  libx264-164 libx265-199 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-randr0 libxcb-render0 libxcb-shm0 libxcb-sync1 libxcb-xfixes0 libxcb-xkb1 libxcomposite1 libxcursor1     
  libxdamage1 libxfixes3 libxi6 libxinerama1 libxkbcommon-x11-0 libxkbcommon0 libxrandr2 libxrender1 libxshmfence1 libxslt1.1 libxss1 libxvidcore4 libxxf86vm1 libyajl2 libz3-4 libzbar0          
  libzvbi-common libzvbi0 libzxing2 ocl-icd-libopencl1 timgm6mb-soundfont x11-common xkb-data                                                                                                     
Suggested packages:                                                                                                                                                                               
  frei0r-plugins gvfs colord cups-common libdirectfb-extra libdv-bin oss-compat libdvdcss2 libvisual-0.4-plugins gstreamer1.0-tools jackd2 liblcms2-utils liblrdf0-dev libportaudio2 opus-tools   
  pulseaudio raptor2-utils libraw1394-doc librsvg2-bin xdg-utils lm-sensors serdi sndiod sordi speex libwildmidi-config opencl-icd fluid-soundfont-gm                                             
Recommended packages:                                                                                                                                                                             
  librsvg2-common gstreamer1.0-x at-spi2-core libdecor-0-plugin-1-cairo | libdecor-0-plugin-1 libgdk-pixbuf2.0-bin gstreamer1.0-gl libgtk-3-bin va-driver-all | va-driver vdpau-driver-all        
  | vdpau-driver mesa-vulkan-drivers | vulkan-icd libmagickcore-6.q16-6-extra
...
The following packages will be upgraded:                                                                                                                                                            libx11-6 libx11-data
2 upgraded, 219 newly installed, 0 to remove and 35 not upgraded.
Need to get 124 MB of archives.
After this operation, 427 MB of additional disk space will be used.

Notice I leave off libsll since in Debian Bookworm on later it is either libsll1.1 or libsll3

iam-TJ commented 8 months ago

Answering my own question. I used ldd to progressive identify each missing library then downloaded (but not installed) the package containing each library, extracted the .deb file manually and then copied only the identified libraries into the system location. In summary (on Debian/Raspbian 12 Bookworm):

 apt download libgstrtspserver-1.0-0
 dpkg-deb -X libgstrtspserver-1.0-0_1.22.0-2_armhf.deb .
 sudo cp {.,}/usr/lib/arm-linux-gnueabihf/libgstrtspserver-1.0.so.0
 apt download libgstreamer1.0-0
 dpkg-deb -X libgstreamer1.0-0_1.22.0-2_armhf.deb .
 sudo cp {.,}/usr/lib/arm-linux-gnueabihf/libgstreamer-1.0.so.0
 apt download libgstreamer-plugins-base1.0-0
 dpkg-deb -X libgstreamer-plugins-base1.0-0_1.22.0-3+deb12u1_armhf.deb .
 sudo cp {.,}/usr/lib/arm-linux-gnueabihf/libgstapp-1.0.so.0
 sudo cp {.,}/usr/lib/arm-linux-gnueabihf/libgstbase-1.0.so.0
 sudo cp {.,}/usr/lib/arm-linux-gnueabihf/libgstrtsp-1.0.so.0
 sudo cp {.,}/usr/lib/arm-linux-gnueabihf/libgstsdp-1.0.so.0
 sudo cp {.,}/usr/lib/arm-linux-gnueabihf/libgstrtp-1.0.so.0
 sudo cp {.,}/usr/lib/arm-linux-gnueabihf/libgstnet-1.0.so.0
 sudo cp {.,}/usr/lib/arm-linux-gnueabihf/libgstpbutils-1.0.so.0
 sudo cp {.,}/usr/lib/arm-linux-gnueabihf/libgstvideo-1.0.so.0
 sudo cp {.,}/usr/lib/arm-linux-gnueabihf/libgstaudio-1.0.so.0
 sudo cp {.,}/usr/lib/arm-linux-gnueabihf/libgsttag-1.0.so.0
 sudo cp {.,}/usr/lib/arm-linux-gnueabihf/liborc-0.4.so.0
 apt install liborc-0.4-0 libunwind8

Note that the package versions may change so the dpkg-deb -X ... commands will need to be amended if so - usually tab-completion will pick the file. Also don't miss the second option to the command is a dot (meaning 'current directory').

tj@noc:~/neolink_linux_armhf$ ldd neolink
        linux-vdso.so.1 (0x7efd8000)
        /usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0x75fe0000)
        libgstrtspserver-1.0.so.0 => /lib/arm-linux-gnueabihf/libgstrtspserver-1.0.so.0 (0x75f60000)
        libgstreamer-1.0.so.0 => /lib/arm-linux-gnueabihf/libgstreamer-1.0.so.0 (0x75e10000)
        libgobject-2.0.so.0 => /lib/arm-linux-gnueabihf/libgobject-2.0.so.0 (0x75dbe000)
        libglib-2.0.so.0 => /lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0x75ca2000)
        libgio-2.0.so.0 => /lib/arm-linux-gnueabihf/libgio-2.0.so.0 (0x75b0e000)
        libgstapp-1.0.so.0 => /lib/arm-linux-gnueabihf/libgstapp-1.0.so.0 (0x75afb000)
        libgstbase-1.0.so.0 => /lib/arm-linux-gnueabihf/libgstbase-1.0.so.0 (0x75a60000)
        libssl.so.3 => /lib/arm-linux-gnueabihf/libssl.so.3 (0x759d5000)
        libcrypto.so.3 => /lib/arm-linux-gnueabihf/libcrypto.so.3 (0x756a6000)
        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x75670000)
        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x75629000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x754b0000)
        /lib/ld-linux-armhf.so.3 (0x76f5c000)
        libgstrtsp-1.0.so.0 => /lib/arm-linux-gnueabihf/libgstrtsp-1.0.so.0 (0x75490000)
        libgstsdp-1.0.so.0 => /lib/arm-linux-gnueabihf/libgstsdp-1.0.so.0 (0x75479000)
        libgstrtp-1.0.so.0 => /lib/arm-linux-gnueabihf/libgstrtp-1.0.so.0 (0x75452000)
        libgstnet-1.0.so.0 => /lib/arm-linux-gnueabihf/libgstnet-1.0.so.0 (0x75420000)
        libgmodule-2.0.so.0 => /lib/arm-linux-gnueabihf/libgmodule-2.0.so.0 (0x75ff9000)
        libunwind.so.8 => /lib/arm-linux-gnueabihf/libunwind.so.8 (0x753e0000)
        libdw.so.1 => /lib/arm-linux-gnueabihf/libdw.so.1 (0x75350000)
        libffi.so.8 => /lib/arm-linux-gnueabihf/libffi.so.8 (0x75320000)
        libpcre2-8.so.0 => /lib/arm-linux-gnueabihf/libpcre2-8.so.0 (0x75270000)
        libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0x75230000)
        libmount.so.1 => /lib/arm-linux-gnueabihf/libmount.so.1 (0x751d7000)
        libselinux.so.1 => /lib/arm-linux-gnueabihf/libselinux.so.1 (0x75190000)
        libatomic.so.1 => /lib/arm-linux-gnueabihf/libatomic.so.1 (0x75160000)
        libgstpbutils-1.0.so.0 => /lib/arm-linux-gnueabihf/libgstpbutils-1.0.so.0 (0x75127000)
        liblzma.so.5 => /lib/arm-linux-gnueabihf/liblzma.so.5 (0x750ff000)
        libelf.so.1 => /lib/arm-linux-gnueabihf/libelf.so.1 (0x750e5000)
        libbz2.so.1.0 => /lib/arm-linux-gnueabihf/libbz2.so.1.0 (0x750c0000)
        libblkid.so.1 => /lib/arm-linux-gnueabihf/libblkid.so.1 (0x75073000)
        libgstvideo-1.0.so.0 => /lib/arm-linux-gnueabihf/libgstvideo-1.0.so.0 (0x74fc5000)
        libgstaudio-1.0.so.0 => /lib/arm-linux-gnueabihf/libgstaudio-1.0.so.0 (0x74f52000)
        libgsttag-1.0.so.0 => /lib/arm-linux-gnueabihf/libgsttag-1.0.so.0 (0x74f18000)
        liborc-0.4.so.0 => /lib/arm-linux-gnueabihf/liborc-0.4.so.0 (0x74e80000)
QuantumEntangledAndy commented 8 months ago

This is not really an issue with the project persay. It's all to do with how the gstreamer plugins are packaged together in Debian. We mostly just need the rtsp related plugins, h264/5 parsers and time stampers, aac deoders, and the app sinks. But that involves pulling in lots of other things because of how they are packaged.