CroatianMeteorNetwork / RMS

RPi Meteor Station
https://globalmeteornetwork.org/
GNU General Public License v3.0
169 stars 47 forks source link

Default to cv2 #293

Closed g7gpr closed 1 week ago

g7gpr commented 1 month ago

Default to cv2 whilst investigating gstreamer performance.

adalava commented 1 month ago

It's good! I maintain a RMS container (ubuntu 22 based, mostly x86_64) and I had to force it to use cv2 while I find some time to investigate why it's not working even after installing all packages. There's still something preventing it to work well in some cases.

dvida commented 1 month ago

Hi guys, Is it not working for you at all, just hanging at the start of capture? I had the same issue and I fixed it my installing the latest version of gstreamer through conda in a conda environment. See the README file in the dev branch for full details.

g7gpr commented 1 month ago

Sometimes stops partway through capturing. Operators report short timelapse videos.


From: Denis Vida @.> Sent: Tuesday, June 4, 2024 10:42:49 PM To: CroatianMeteorNetwork/RMS @.> Cc: David Rollinson @.>; Author @.> Subject: Re: [CroatianMeteorNetwork/RMS] Default to cv2 (PR #293)

Hi guys, Is it not working for you at all, just hanging at the start of capture? I had the same issue and I fixed it my installing the latest version of gstreamer through conda in a conda environment. See the README file in the dev branch for full details.

— Reply to this email directly, view it on GitHubhttps://github.com/CroatianMeteorNetwork/RMS/pull/293#issuecomment-2147716578, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASMOVH5AEKDWFII2EOMRYKLZFXG6TAVCNFSM6AAAAABIYHHOZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBXG4YTMNJXHA. You are receiving this because you authored the thread.Message ID: @.***>

dvida commented 1 month ago

Is this on the Pi or a linux PC?

g7gpr commented 1 month ago

Pi4, 32 bit, from published image.

g7gpr commented 1 month ago

Refer to https://globalmeteornetwork.org/weblog/AU/AU003C/AU003C_20240529_093759_502381_detected/ as an example

adalava commented 4 weeks ago

Hi guys, Is it not working for you at all, just hanging at the start of capture? I had the same issue and I fixed it my installing the latest version of gstreamer through conda in a conda environment. See the README file in the dev branch for full details.

Denis, in my case it hangs right at the start of capture, no frames are received. Reproduced it on 2 different x86_64 machines (total of 6 cameras/RMS instances). The RMS container is Ubuntu 22.04 LTS image based with stock packages. I'll check whatever is better: update gstreamer packages from non standard repository or go though upgrading it to Ubuntu 24. It will take some time since I need to validate on both x86_64 and aarch64.

In case it helps someone, here's the list of gstreamer installed packages and versions:

(vRMS) root@d03bff5c60aa:~/source/RMS/RMS# python 
Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gi
>>> gi.require_version('Gst', '1.0')
>>> gi.__version__
'3.42.1'
>>> 
(vRMS) root@d03bff5c60aa:~/source/RMS# dpkg -l | grep gstreamer
ii  gir1.2-gstreamer-1.0:amd64               1.20.3-0ubuntu1                         amd64        GObject introspection data for the GStreamer library
ii  gstreamer1.0-gl:amd64                    1.20.1-1                                amd64        GStreamer plugins for GL
ii  gstreamer1.0-libav:amd64                 1.20.3-0ubuntu1                         amd64        ffmpeg plugin for GStreamer
ii  gstreamer1.0-nice:amd64                  0.1.18-2                                amd64        ICE library (GStreamer plugin)
ii  gstreamer1.0-omx-generic                 1.18.3-1                                amd64        OpenMax plugins for GStreamer
ii  gstreamer1.0-omx-generic-config          1.18.3-1                                amd64        OpenMax plugins for GStreamer
ii  gstreamer1.0-opencv:amd64                1.20.3-0ubuntu1.1                       amd64        GStreamer OpenCV plugins
ii  gstreamer1.0-packagekit                  1.2.5-2ubuntu2                          amd64        GStreamer plugin to install codecs using PackageKit
ii  gstreamer1.0-pipewire:amd64              0.3.48-1ubuntu3                         amd64        GStreamer 1.0 plugin for the PipeWire multimedia server
ii  gstreamer1.0-plugins-bad:amd64           1.20.3-0ubuntu1.1                       amd64        GStreamer plugins from the "bad" set
ii  gstreamer1.0-plugins-bad-apps            1.20.3-0ubuntu1.1                       amd64        GStreamer helper programs from the "bad" set
ii  gstreamer1.0-plugins-base:amd64          1.20.1-1                                amd64        GStreamer plugins from the "base" set
ii  gstreamer1.0-plugins-base-apps           1.20.1-1                                amd64        GStreamer helper programs from the "base" set
ii  gstreamer1.0-plugins-good:amd64          1.20.3-0ubuntu1                         amd64        GStreamer plugins from the "good" set
ii  gstreamer1.0-plugins-rtp                 1.14.4.1                                amd64        GStreamer elements from the "rtp" set
ii  gstreamer1.0-plugins-ugly:amd64          1.20.1-1                                amd64        GStreamer plugins from the "ugly" set
ii  gstreamer1.0-python3-plugin-loader:amd64 1.20.1-1                                amd64        GStreamer Loader for Python Plugin (Python 3)
ii  gstreamer1.0-rtsp:amd64                  1.20.1-1                                amd64        RTSP plugin for GStreamer
ii  gstreamer1.0-tools                       1.20.3-0ubuntu1                         amd64        Tools for use with GStreamer
ii  gstreamer1.0-vaapi:amd64                 1.20.1-1ubuntu1                         amd64        VA-API plugins for GStreamer
ii  gstreamer1.0-x:amd64                     1.20.1-1                                amd64        GStreamer plugins for X11 and Pango
ii  libgstreamer-gl1.0-0:amd64               1.20.1-1                                amd64        GStreamer GL libraries
ii  libgstreamer-opencv1.0-0:amd64           1.20.3-0ubuntu1.1                       amd64        GStreamer OpenCV libraries
ii  libgstreamer-plugins-bad1.0-0:amd64      1.20.3-0ubuntu1.1                       amd64        GStreamer libraries from the "bad" set
ii  libgstreamer-plugins-base1.0-0:amd64     1.20.1-1                                amd64        GStreamer libraries from the "base" set
ii  libgstreamer-plugins-good1.0-0:amd64     1.20.3-0ubuntu1                         amd64        GStreamer development files for libraries from the "good" set
ii  libgstreamer1.0-0:amd64                  1.20.3-0ubuntu1                         amd64        Core GStreamer libraries and elements
dvida commented 3 weeks ago

I'm running a Linux PC on ubuntu 22.04 with gstreamer without any issues after installing the new version of gstreamer. I had the exact same issue with 1.20. After purging the install, I used 1.22.3 and all issues went away.

I created these new installation instructions: https://github.com/CroatianMeteorNetwork/RMS/tree/dev?tab=readme-ov-file#software No need to compile opencv anymore using that script, the conda version works just fine as long as gstreamer is used for capture.

g7gpr commented 3 weeks ago
(vRMS) au0028@pemberton:~/source/RMS$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 12 (bookworm)
Release:    12
Codename:   bookworm
(vRMS) au0028@pemberton:~/source/RMS$ gst-inspect-1.0 --version
gst-inspect-1.0 version 1.22.0
GStreamer 1.22.0
https://tracker.debian.org/pkg/gstreamer1.0
(vRMS) au0028@pemberton:~/source/RMS$ free -h
               total        used        free      shared  buff/cache   available
Mem:            11Gi       8.0Gi       162Mi       3.5Gi       7.3Gi       3.6Gi
Swap:           32Gi       1.6Gi        31Gi
(vRMS) au0028@pemberton:~/source/RMS$ lscpu

  Model name:             Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz

Is running 8 cameras (AU0028-2F) with gstreamer.

for video in /home/*/RMS_data/ArchivedFiles/*/*.mp4 ; do echo $video; ffprobe -v error -sexagesimal -select_streams v:0 -show_entries stream=duration -of default=noprint_wrappers=1:nokey=1 $video ; done

Shows that all the videos are the expected length.

g7gpr commented 3 weeks ago

For the Pi4 platform, which is the main focus for me, is it recommended to upgrade gstreamer to 1.22.x, and retest on a known troublesome system?

dvida commented 3 weeks ago

I haven't tested on the Pi, but give it a go. As the Pis don't have things installed though conda, you may have to install gstreamer system-wide.

g7gpr commented 3 weeks ago

OK. On it.

g7gpr commented 1 week ago

This PR appears to be redundant thanks to work by others.