sr99622 / libonvif

Onvif library with GUI implementation and built in YOLOX
GNU Lesser General Public License v2.1
142 stars 38 forks source link

AttributeError: module 'avio' has no attribute 'Player' #83

Open hinxx opened 3 months ago

hinxx commented 3 months ago

Tried using onvif-gui and got this error:

onvif-gui 
Traceback (most recent call last):
  File "/home/hinxx/Projects/dlinkcam/venv/bin/onvif-gui", line 5, in <module>
    from gui.main import run
  File "/home/hinxx/Projects/dlinkcam/venv/lib/python3.10/site-packages/gui/__init__.py", line 1, in <module>
    from .main import MainWindow
  File "/home/hinxx/Projects/dlinkcam/venv/lib/python3.10/site-packages/gui/main.py", line 61, in <module>
    class Player(avio.Player):
AttributeError: module 'avio' has no attribute 'Player'

This happens if using pip install or building from source.

hinxx commented 3 months ago

Seems I did not have some system libs installed. After doing sudo apt install git cmake g++ python3-pip virtualenv libxml2-dev libavdevice-dev libsdl2-dev '^libxcb.*-dev' libxkbcommon-x11-dev the GUI seems to work.

sr99622 commented 3 months ago

Thank you for reaching out, the install is a little different than most pip installs with the extra step for the dependencies. Glad to hear you were able to get it running.

rohanramaswamy commented 2 months ago

I'm facing the same issue when installing via pip on mac. Installed all dependencies via brew as per documentation.

sr99622 commented 2 months ago

Thank you so much for reaching out. The error you are seeing is due to the failure of the libavio module. Usually these types of errors are due to a missing or incorrect dependency. It may be useful to try building the app from source to get some more feedback on the issue. If there is a failure in the compile process, detailed information can be found in the compiler output. There is a script in the project that can do this for you. If you start from a fresh directory is best.

git clone --recursive https://github.com/sr99622/libonvif
cd libonvif
assets/scripts/compile

if things went well, the onvif-gui command should work.

rohanramaswamy commented 2 months ago

Thanks for your promt response. It builds and installs sucessfully however still doesn't work it gives the exact same error as earlier. There are a few errors present during the build process mentioned below

Shell

(onvif) rohan@Rohans-MacBook-Air libonvif % assets/scripts/compile rm: build: No such file or directory rm: libonvif.egg-info: No such file or directory Using pip 23.3.1 from /opt/miniconda3/envs/onvif/lib/python3.12/site-packages/pip (python 3.12) Processing /Users/rohan/dev/libonvif/libonvif Running command pip subprocess to install build dependencies Collecting setuptools>=61.0 Using cached setuptools-69.5.1-py3-none-any.whl.metadata (6.2 kB) Using cached setuptools-69.5.1-py3-none-any.whl (894 kB) Installing collected packages: setuptools Successfully installed setuptools-69.5.1 Installing build dependencies ... done Running command Getting requirements to build wheel running egg_info creating libonvif.egg-info writing libonvif.egg-info/PKG-INFO writing dependency_links to libonvif.egg-info/dependency_links.txt writing top-level names to libonvif.egg-info/top_level.txt writing manifest file 'libonvif.egg-info/SOURCES.txt' reading manifest file 'libonvif.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' adding license file 'LICENSE' writing manifest file 'libonvif.egg-info/SOURCES.txt' Getting requirements to build wheel ... done Running command pip subprocess to install backend dependencies Collecting wheel Using cached wheel-0.43.0-py3-none-any.whl.metadata (2.2 kB) Using cached wheel-0.43.0-py3-none-any.whl (65 kB) Installing collected packages: wheel Successfully installed wheel-0.43.0 Installing backend dependencies ... done Running command Preparing metadata (pyproject.toml) running dist_info creating /private/var/folders/80/mv1zn1sd1pjd31w96q8jhj0h0000gn/T/pip-modern-metadata-la_bspjk/libonvif.egg-info writing /private/var/folders/80/mv1zn1sd1pjd31w96q8jhj0h0000gn/T/pip-modern-metadata-la_bspjk/libonvif.egg-info/PKG-INFO writing dependency_links to /private/var/folders/80/mv1zn1sd1pjd31w96q8jhj0h0000gn/T/pip-modern-metadata-la_bspjk/libonvif.egg-info/dependency_links.txt writing top-level names to /private/var/folders/80/mv1zn1sd1pjd31w96q8jhj0h0000gn/T/pip-modern-metadata-la_bspjk/libonvif.egg-info/top_level.txt writing manifest file '/private/var/folders/80/mv1zn1sd1pjd31w96q8jhj0h0000gn/T/pip-modern-metadata-la_bspjk/libonvif.egg-info/SOURCES.txt' reading manifest file '/private/var/folders/80/mv1zn1sd1pjd31w96q8jhj0h0000gn/T/pip-modern-metadata-la_bspjk/libonvif.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' adding license file 'LICENSE' writing manifest file '/private/var/folders/80/mv1zn1sd1pjd31w96q8jhj0h0000gn/T/pip-modern-metadata-la_bspjk/libonvif.egg-info/SOURCES.txt' creating '/private/var/folders/80/mv1zn1sd1pjd31w96q8jhj0h0000gn/T/pip-modern-metadata-la_bspjk/libonvif-3.1.1.dist-info' Preparing metadata (pyproject.toml) ... done Building wheels for collected packages: libonvif Running command Building wheel for libonvif (pyproject.toml) running bdist_wheel running build running build_py creating build creating build/lib.macosx-11.1-arm64-cpython-312 creating build/lib.macosx-11.1-arm64-cpython-312/libonvif copying libonvif/__init__.py -> build/lib.macosx-11.1-arm64-cpython-312/libonvif running egg_info writing libonvif.egg-info/PKG-INFO writing dependency_links to libonvif.egg-info/dependency_links.txt writing top-level names to libonvif.egg-info/top_level.txt reading manifest file 'libonvif.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' adding license file 'LICENSE' writing manifest file 'libonvif.egg-info/SOURCES.txt' running build_ext -- The C compiler identification is AppleClang 15.0.0.15000040 -- The CXX compiler identification is AppleClang 15.0.0.15000040 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found LibXml2: /Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk/usr/lib/libxml2.tbd (found version "2.9.13") -- pybind11 v2.11.0 dev1 -- Found PythonInterp: /opt/miniconda3/envs/onvif/bin/python (found suitable version "3.12.3", minimum required is "3.6") -- Found PythonLibs: /opt/miniconda3/envs/onvif/lib/libpython3.12.dylib -- Performing Test HAS_FLTO -- Performing Test HAS_FLTO - Success -- Performing Test HAS_FLTO_THIN -- Performing Test HAS_FLTO_THIN - Success -- LIBXML2_INCLUDE_DIRS: /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/libxml2 -- LIBXML2_LIBRARIES: /Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk/usr/lib/libxml2.tbd -- Configuring done (1.7s) -- Generating done (0.0s) -- Build files have been written to: /Users/rohan/dev/libonvif/libonvif/build/temp.macosx-11.1-arm64-cpython-312/libonvif [ 20%] Building CXX object CMakeFiles/pyonvif.dir/src/onvif.cpp.o [ 40%] Building C object CMakeFiles/pyonvif.dir/src/onvif.c.o [ 60%] Building C object CMakeFiles/pyonvif.dir/src/cencode.c.o [ 80%] Building C object CMakeFiles/pyonvif.dir/src/sha1.c.o [100%] Linking CXX shared module /Users/rohan/dev/libonvif/libonvif/build/lib.macosx-11.1-arm64-cpython-312/libonvif/libonvif.cpython-312-darwin.so [100%] Built target pyonvif installing to build/bdist.macosx-11.1-arm64/wheel running install running install_lib creating build/bdist.macosx-11.1-arm64 creating build/bdist.macosx-11.1-arm64/wheel creating build/bdist.macosx-11.1-arm64/wheel/libonvif copying build/lib.macosx-11.1-arm64-cpython-312/libonvif/__init__.py -> build/bdist.macosx-11.1-arm64/wheel/libonvif copying build/lib.macosx-11.1-arm64-cpython-312/libonvif/libonvif.cpython-312-darwin.so -> build/bdist.macosx-11.1-arm64/wheel/libonvif running install_egg_info Copying libonvif.egg-info to build/bdist.macosx-11.1-arm64/wheel/libonvif-3.1.1-py3.12.egg-info running install_scripts [WARNING] This wheel needs a higher macOS version than the version your Python interpreter is compiled against. To silence this warning, set MACOSX_DEPLOYMENT_TARGET to at least 14_0 or recreate these files with lower MACOSX_DEPLOYMENT_TARGET: build/bdist.macosx-11.1-arm64/wheel/libonvif/libonvif.cpython-312-darwin.so[WARNING] This wheel needs a higher macOS version than the version your Python interpreter is compiled against. To silence this warning, set MACOSX_DEPLOYMENT_TARGET to at least 14_0 or recreate these files with lower MACOSX_DEPLOYMENT_TARGET: build/bdist.macosx-11.1-arm64/wheel/libonvif/libonvif.cpython-312-darwin.socreating build/bdist.macosx-11.1-arm64/wheel/libonvif-3.1.1.dist-info/WHEEL creating '/private/var/folders/80/mv1zn1sd1pjd31w96q8jhj0h0000gn/T/pip-wheel-0mywe6j8/.tmp-l2s4vgtn/libonvif-3.1.1-cp312-cp312-macosx_14_0_arm64.whl' and adding 'build/bdist.macosx-11.1-arm64/wheel' to it adding 'libonvif/__init__.py' adding 'libonvif/libonvif.cpython-312-darwin.so' adding 'libonvif-3.1.1.dist-info/LICENSE' adding 'libonvif-3.1.1.dist-info/METADATA' adding 'libonvif-3.1.1.dist-info/WHEEL' adding 'libonvif-3.1.1.dist-info/top_level.txt' adding 'libonvif-3.1.1.dist-info/RECORD' removing build/bdist.macosx-11.1-arm64/wheel Building wheel for libonvif (pyproject.toml) ... done Created wheel for libonvif: filename=libonvif-3.1.1-cp312-cp312-macosx_14_0_arm64.whl size=221146 sha256=5c46791f4aac779589e042afa3c5aadd14f73260d68bfb56c4c399e8ce65bb38 Stored in directory: /private/var/folders/80/mv1zn1sd1pjd31w96q8jhj0h0000gn/T/pip-ephem-wheel-cache-cyy9ph45/wheels/b0/8e/1b/830f2b213bc4379fdf8617ec2f13b0203501e655f47e65bb00 Successfully built libonvif Installing collected packages: libonvif Attempting uninstall: libonvif Found existing installation: libonvif 3.1.1 Uninstalling libonvif-3.1.1: Removing file or directory /opt/miniconda3/envs/onvif/lib/python3.12/site-packages/libonvif-3.1.1.dist-info/ Removing file or directory /opt/miniconda3/envs/onvif/lib/python3.12/site-packages/libonvif/ Successfully uninstalled libonvif-3.1.1 Successfully installed libonvif-3.1.1 rm: build: No such file or directory rm: avio.egg-info: No such file or directory Using pip 23.3.1 from /opt/miniconda3/envs/onvif/lib/python3.12/site-packages/pip (python 3.12) Processing /Users/rohan/dev/libonvif/libavio Running command pip subprocess to install build dependencies Collecting setuptools>=61.0 Using cached setuptools-69.5.1-py3-none-any.whl.metadata (6.2 kB) Using cached setuptools-69.5.1-py3-none-any.whl (894 kB) Installing collected packages: setuptools Successfully installed setuptools-69.5.1 Installing build dependencies ... done Running command Getting requirements to build wheel running egg_info creating avio.egg-info writing avio.egg-info/PKG-INFO writing dependency_links to avio.egg-info/dependency_links.txt writing top-level names to avio.egg-info/top_level.txt writing manifest file 'avio.egg-info/SOURCES.txt' reading manifest file 'avio.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' adding license file 'LICENSE' writing manifest file 'avio.egg-info/SOURCES.txt' Getting requirements to build wheel ... done Running command pip subprocess to install backend dependencies Collecting wheel Using cached wheel-0.43.0-py3-none-any.whl.metadata (2.2 kB) Using cached wheel-0.43.0-py3-none-any.whl (65 kB) Installing collected packages: wheel Successfully installed wheel-0.43.0 Installing backend dependencies ... done Running command Preparing metadata (pyproject.toml) running dist_info creating /private/var/folders/80/mv1zn1sd1pjd31w96q8jhj0h0000gn/T/pip-modern-metadata-6ixtas0h/avio.egg-info writing /private/var/folders/80/mv1zn1sd1pjd31w96q8jhj0h0000gn/T/pip-modern-metadata-6ixtas0h/avio.egg-info/PKG-INFO writing dependency_links to /private/var/folders/80/mv1zn1sd1pjd31w96q8jhj0h0000gn/T/pip-modern-metadata-6ixtas0h/avio.egg-info/dependency_links.txt writing top-level names to /private/var/folders/80/mv1zn1sd1pjd31w96q8jhj0h0000gn/T/pip-modern-metadata-6ixtas0h/avio.egg-info/top_level.txt writing manifest file '/private/var/folders/80/mv1zn1sd1pjd31w96q8jhj0h0000gn/T/pip-modern-metadata-6ixtas0h/avio.egg-info/SOURCES.txt' reading manifest file '/private/var/folders/80/mv1zn1sd1pjd31w96q8jhj0h0000gn/T/pip-modern-metadata-6ixtas0h/avio.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' adding license file 'LICENSE' writing manifest file '/private/var/folders/80/mv1zn1sd1pjd31w96q8jhj0h0000gn/T/pip-modern-metadata-6ixtas0h/avio.egg-info/SOURCES.txt' creating '/private/var/folders/80/mv1zn1sd1pjd31w96q8jhj0h0000gn/T/pip-modern-metadata-6ixtas0h/avio-3.1.2.dist-info' Preparing metadata (pyproject.toml) ... done Building wheels for collected packages: avio Running command Building wheel for avio (pyproject.toml) running bdist_wheel running build running build_py creating build creating build/lib.macosx-11.1-arm64-cpython-312 creating build/lib.macosx-11.1-arm64-cpython-312/avio copying avio/__init__.py -> build/lib.macosx-11.1-arm64-cpython-312/avio running egg_info writing avio.egg-info/PKG-INFO writing dependency_links to avio.egg-info/dependency_links.txt writing top-level names to avio.egg-info/top_level.txt reading manifest file 'avio.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' adding license file 'LICENSE' writing manifest file 'avio.egg-info/SOURCES.txt' running build_ext -- The C compiler identification is AppleClang 15.0.0.15000040 -- The CXX compiler identification is AppleClang 15.0.0.15000040 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Checking for modules 'libavcodec;libavfilter;libavformat;libavutil;libswscale;libswresample' -- Found libavcodec, version 61.3.100 -- Found libavfilter, version 10.1.100 -- Found libavformat, version 61.1.100 -- Found libavutil, version 59.8.100 -- Found libswscale, version 8.1.100 -- Found libswresample, version 5.1.100 -- Found FFmpeg: /opt/homebrew/Cellar/ffmpeg/7.0/include -- pybind11 v2.11.0 dev1 -- Found PythonInterp: /opt/miniconda3/envs/onvif/bin/python (found suitable version "3.12.3", minimum required is "3.6") -- Found PythonLibs: /opt/miniconda3/envs/onvif/lib/libpython3.12.dylib -- Performing Test HAS_FLTO -- Performing Test HAS_FLTO - Success -- Performing Test HAS_FLTO_THIN -- Performing Test HAS_FLTO_THIN - Success -- Configuring done (0.8s) -- Generating done (0.0s) -- Build files have been written to: /Users/rohan/dev/libonvif/libavio/build/temp.macosx-11.1-arm64-cpython-312/avio [ 7%] Building CXX object CMakeFiles/avio.dir/src/avio.cpp.o In file included from /Users/rohan/dev/libonvif/libavio/src/avio.cpp:23: In file included from /Users/rohan/dev/libonvif/libavio/include/avio.h:28: /Users/rohan/dev/libonvif/libavio/include/Decoder.h:42:35: error: no member named 'channels' in 'AVCodecContext' int channels() { return dec_ctx->channels; } ~~~~~~~ ^ /Users/rohan/dev/libonvif/libavio/include/Decoder.h:44:46: error: no member named 'channel_layout' in 'AVCodecContext' uint64_t channel_layout() { return dec_ctx->channel_layout; } ~~~~~~~ ^ In file included from /Users/rohan/dev/libonvif/libavio/src/avio.cpp:23: In file included from /Users/rohan/dev/libonvif/libavio/include/avio.h:30: /Users/rohan/dev/libonvif/libavio/include/Filter.h:71:36: error: use of undeclared identifier 'av_buffersink_get_channel_layout'; did you mean 'av_buffersink_get_channels'? int64_t channel_layout() { return av_buffersink_get_channel_layout(sink_ctx); } ^ /opt/homebrew/Cellar/ffmpeg/7.0/include/libavfilter/buffersink.h:125:18: note: 'av_buffersink_get_channels' declared here int av_buffersink_get_channels (const AVFilterContext *ctx); ^ 3 errors generated. make[2]: *** [CMakeFiles/avio.dir/src/avio.cpp.o] Error 1 make[1]: *** [CMakeFiles/avio.dir/all] Error 2 make: *** [all] Error 2 installing to build/bdist.macosx-11.1-arm64/wheel running install running install_lib creating build/bdist.macosx-11.1-arm64 creating build/bdist.macosx-11.1-arm64/wheel creating build/bdist.macosx-11.1-arm64/wheel/avio copying build/lib.macosx-11.1-arm64-cpython-312/avio/__init__.py -> build/bdist.macosx-11.1-arm64/wheel/avio running install_egg_info Copying avio.egg-info to build/bdist.macosx-11.1-arm64/wheel/avio-3.1.2-py3.12.egg-info running install_scripts creating build/bdist.macosx-11.1-arm64/wheel/avio-3.1.2.dist-info/WHEEL creating '/private/var/folders/80/mv1zn1sd1pjd31w96q8jhj0h0000gn/T/pip-wheel-k_5lchoq/.tmp-f1kl71cr/avio-3.1.2-cp312-cp312-macosx_11_0_arm64.whl' and adding 'build/bdist.macosx-11.1-arm64/wheel' to it adding 'avio/__init__.py' adding 'avio-3.1.2.dist-info/LICENSE' adding 'avio-3.1.2.dist-info/METADATA' adding 'avio-3.1.2.dist-info/WHEEL' adding 'avio-3.1.2.dist-info/top_level.txt' adding 'avio-3.1.2.dist-info/RECORD' removing build/bdist.macosx-11.1-arm64/wheel Building wheel for avio (pyproject.toml) ... done Created wheel for avio: filename=avio-3.1.2-cp312-cp312-macosx_11_0_arm64.whl size=6126 sha256=1e05c2dfbe2e7a6ea3507e95e6fae5bccf254f0c1d95a751563ce32ad2fc594f Stored in directory: /private/var/folders/80/mv1zn1sd1pjd31w96q8jhj0h0000gn/T/pip-ephem-wheel-cache-yxz9cg33/wheels/89/b7/22/7a097997cfe001f274a97db61d2e958f2ee1f35fea64c6d42c Successfully built avio Installing collected packages: avio Attempting uninstall: avio Found existing installation: avio 3.1.2 Uninstalling avio-3.1.2: Removing file or directory /opt/miniconda3/envs/onvif/lib/python3.12/site-packages/avio-3.1.2.dist-info/ Removing file or directory /opt/miniconda3/envs/onvif/lib/python3.12/site-packages/avio/ Successfully uninstalled avio-3.1.2 Successfully installed avio-3.1.2 rm: build: No such file or directory rm: onvif_gui.egg-info: No such file or directory Processing /Users/rohan/dev/libonvif/onvif-gui Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: libonvif==3.1.1 in /opt/miniconda3/envs/onvif/lib/python3.12/site-packages (from onvif-gui==2.0.9) (3.1.1) Requirement already satisfied: avio==3.1.2 in /opt/miniconda3/envs/onvif/lib/python3.12/site-packages (from onvif-gui==2.0.9) (3.1.2) Requirement already satisfied: PyQt6-Qt6==6.6.1 in /opt/miniconda3/envs/onvif/lib/python3.12/site-packages (from onvif-gui==2.0.9) (6.6.1) Requirement already satisfied: pyqt6==6.6.1 in /opt/miniconda3/envs/onvif/lib/python3.12/site-packages (from onvif-gui==2.0.9) (6.6.1) Requirement already satisfied: numpy in /opt/miniconda3/envs/onvif/lib/python3.12/site-packages (from onvif-gui==2.0.9) (1.26.4) Requirement already satisfied: loguru in /opt/miniconda3/envs/onvif/lib/python3.12/site-packages (from onvif-gui==2.0.9) (0.7.2) Requirement already satisfied: opencv-python in /opt/miniconda3/envs/onvif/lib/python3.12/site-packages (from onvif-gui==2.0.9) (4.9.0.80) Requirement already satisfied: PyQt6-sip<14,>=13.6 in /opt/miniconda3/envs/onvif/lib/python3.12/site-packages (from pyqt6==6.6.1->onvif-gui==2.0.9) (13.6.0) Building wheels for collected packages: onvif-gui Building wheel for onvif-gui (pyproject.toml) ... done Created wheel for onvif-gui: filename=onvif_gui-2.0.9-py3-none-any.whl size=508284 sha256=627064faff1febb7750373b6f1b193b6c93a094c6b4e44c6907d7212e7cff4af Stored in directory: /Users/rohan/Library/Caches/pip/wheels/16/21/6d/af95b675ebf234d817327013d40e316d4de189bdf6b3a3bfab Successfully built onvif-gui Installing collected packages: onvif-gui Attempting uninstall: onvif-gui Found existing installation: onvif-gui 2.0.9 Uninstalling onvif-gui-2.0.9: Successfully uninstalled onvif-gui-2.0.9 Successfully installed onvif-gui-2.0.9

rohanramaswamy commented 2 months ago

Solved the issue. Issue was caused due to ffmpeg version installed by default by homebrew is now version 7. Fixed it by uninstalling it and installing ffmpeg@6. Either documentation has to be updated or code has to updated to support ffmpeg 7.

sr99622 commented 2 months ago

Thank you so much for your perseverance in discovering the cause of the problem, I was unaware of the ffmpeg 7 issue. I tried it myself and actually got a slightly different error which would have much more difficult to debug, so I guess it's lucky in that way. I think for now set the docs to specify the ffmpeg version at 6, but this will have to be fixed eventually. The error is shown below in case it comes up again.

Best Regards,

Stephen

(test) stephen@mac libonvif % onvif-gui
Traceback (most recent call last):
  File "/Users/stephen/anaconda3/envs/test/bin/onvif-gui", line 5, in <module>
    from gui.main import run
  File "/Users/stephen/anaconda3/envs/test/lib/python3.12/site-packages/gui/__init__.py", line 1, in <module>
    from .main import MainWindow
  File "/Users/stephen/anaconda3/envs/test/lib/python3.12/site-packages/gui/main.py", line 42, in <module>
    from gui.panels import CameraPanel, FilePanel, SettingsPanel, VideoPanel, AudioPanel
  File "/Users/stephen/anaconda3/envs/test/lib/python3.12/site-packages/gui/panels/__init__.py", line 2, in <module>
    from .filepanel import FilePanel
  File "/Users/stephen/anaconda3/envs/test/lib/python3.12/site-packages/gui/panels/filepanel.py", line 30, in <module>
    import avio
  File "/Users/stephen/anaconda3/envs/test/lib/python3.12/site-packages/avio/__init__.py", line 19, in <module>
    sys.modules[name] = importlib.util.module_from_spec(spec)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: dlopen(/Users/stephen/anaconda3/envs/test/lib/python3.12/site-packages/avio/avio.cpython-312-darwin.so, 0x0002): symbol not found in flat namespace '_av_buffersink_get_channel_layout'
rohanramaswamy commented 2 months ago

Thank you so much for your perseverance in discovering the cause of the problem, I was unaware of the ffmpeg 7 issue. I tried it myself and actually got a slightly different error which would have much more difficult to debug, so I guess it's lucky in that way. I think for now set the docs to specify the ffmpeg version at 6, but this will have to be fixed eventually. The error is shown below in case it comes up again.

Best Regards,

Stephen

(test) stephen@mac libonvif % onvif-gui
Traceback (most recent call last):
  File "/Users/stephen/anaconda3/envs/test/bin/onvif-gui", line 5, in <module>
    from gui.main import run
  File "/Users/stephen/anaconda3/envs/test/lib/python3.12/site-packages/gui/__init__.py", line 1, in <module>
    from .main import MainWindow
  File "/Users/stephen/anaconda3/envs/test/lib/python3.12/site-packages/gui/main.py", line 42, in <module>
    from gui.panels import CameraPanel, FilePanel, SettingsPanel, VideoPanel, AudioPanel
  File "/Users/stephen/anaconda3/envs/test/lib/python3.12/site-packages/gui/panels/__init__.py", line 2, in <module>
    from .filepanel import FilePanel
  File "/Users/stephen/anaconda3/envs/test/lib/python3.12/site-packages/gui/panels/filepanel.py", line 30, in <module>
    import avio
  File "/Users/stephen/anaconda3/envs/test/lib/python3.12/site-packages/avio/__init__.py", line 19, in <module>
    sys.modules[name] = importlib.util.module_from_spec(spec)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: dlopen(/Users/stephen/anaconda3/envs/test/lib/python3.12/site-packages/avio/avio.cpython-312-darwin.so, 0x0002): symbol not found in flat namespace '_av_buffersink_get_channel_layout'

I think the error might be different due to architecture difference. Are you on intel or m1 mac?

sr99622 commented 2 months ago

I'm actually on m2. The difference in the messages has me a little worried that there may be different compile procedures based on architecture. Installing with brew for ffmpeg@6 did not create a symbolic link to the install location and cmake was having a problem finding the ffmpeg binaries, so I had to add the FFMPEG_INSTALL_DIR environment variable. It may be that the intel architecture does not do that same thing. I only have the one machine so I'm only able to test for m2.

genevera commented 1 month ago

Oh looks like I duped this in #91. I'm also on an m2 and did have my FFMPEG_INSTALL_DIR and SDL2_INSTALL_DIR env vars set when I built it.