Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gstreamer - opencvExample is not working on Ubuntu #7516

Closed
dimitre opened this issue Apr 21, 2023 · 9 comments · Fixed by #7528
Closed

gstreamer - opencvExample is not working on Ubuntu #7516

dimitre opened this issue Apr 21, 2023 · 9 comments · Fixed by #7528

Comments

@dimitre
Copy link
Member

dimitre commented Apr 21, 2023

tested on 22.10 and 23.04
video image is black or some tiny glitches
and terminal prints
[warning] ofGstVideoUtils: update(): ofGstVideoUtils not loaded

@dimitre
Copy link
Member Author

dimitre commented Apr 21, 2023

opencvPeopleDetection is only black screen. it is probably related to GStreamer

@ofTheo
Copy link
Member

ofTheo commented Apr 21, 2023

did you run install_codecs.sh from the same folder as install_dependcies?

@dimitre
Copy link
Member Author

dimitre commented Apr 21, 2023

ow yes I forgot that!
but now I've installed at least in 23.04 it has some glitches, and terminal outputs

[warning] ofGstUtils: getDurationNanos(): couldn't query time duration
[ error ] ofGstVideoPlayer: allocate(): cannot get pipeline caps
[ error ] ofGstUtils: gstHandleMessage(): embedded video playback halted for plugin, module qtdemux0  reported: Internal data stream error.

@dimitre
Copy link
Member Author

dimitre commented Apr 22, 2023

now confirming in 22.04 too, black screen on opencvExample
and output

[warning] ofGstVideoUtils: update(): ofGstVideoUtils not loaded

@ofTheo ofTheo mentioned this issue Apr 24, 2023
77 tasks
@ofTheo
Copy link
Member

ofTheo commented Apr 24, 2023

Hmm it works for me with the nightly.
Both openCvExample and videoPlayerExample

can you do
dpkg -l gstreamer*

this is what I get:

+++-=====================================-========================-============-=======================================================
un  gstreamer0.10-gnomevfs                <none>                   <none>       (no description available)
un  gstreamer0.10-packagekit              <none>                   <none>       (no description available)
ii  gstreamer1.0-alsa:amd64               1.20.1-1                 amd64        GStreamer plugin for ALSA
un  gstreamer1.0-audiosink                <none>                   <none>       (no description available)
un  gstreamer1.0-audiosource              <none>                   <none>       (no description available)
ii  gstreamer1.0-clutter-3.0:amd64        3.0.27-2ubuntu1          amd64        Clutter PLugin for GStreamer 1.0
un  gstreamer1.0-doc                      <none>                   <none>       (no description available)
ii  gstreamer1.0-gl:amd64                 1.20.1-1                 amd64        GStreamer plugins for GL
ii  gstreamer1.0-gtk3:amd64               1.20.3-0ubuntu1          amd64        GStreamer plugin for GTK+3
ii  gstreamer1.0-libav:amd64              1.20.3-0ubuntu1          amd64        ffmpeg plugin for GStreamer
ii  gstreamer1.0-packagekit               1.2.5-2ubuntu2mint1+vera amd64        GStreamer plugin to install codecs using PackageKit
ii  gstreamer1.0-pipewire:amd64           0.3.48-1ubuntu2          amd64        GStreamer 1.0 plugin for the PipeWire multimedia server
ii  gstreamer1.0-plugins-bad:amd64        1.20.3-0ubuntu1          amd64        GStreamer plugins from the "bad" set
un  gstreamer1.0-plugins-bad-faad         <none>                   <none>       (no description available)
un  gstreamer1.0-plugins-bad-videoparsers <none>                   <none>       (no description available)
ii  gstreamer1.0-plugins-base:amd64       1.20.1-1                 amd64        GStreamer plugins from the "base" set
ii  gstreamer1.0-plugins-base:i386        1.20.1-1                 i386         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-good:i386        1.20.3-0ubuntu1          i386         GStreamer plugins from the "good" set
ii  gstreamer1.0-plugins-ugly:amd64       1.20.1-1                 amd64        GStreamer plugins from the "ugly" set
un  gstreamer1.0-plugins-ugly-amr         <none>                   <none>       (no description available)
ii  gstreamer1.0-pulseaudio:amd64         1.20.3-0ubuntu1          amd64        GStreamer plugin for PulseAudio (transitional package)
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
un  gstreamer1.0-vaapi-doc                <none>                   <none>       (no description available)
un  gstreamer1.0-videosink                <none>                   <none>       (no description available)
un  gstreamer1.0-videosource              <none>                   <none>       (no description available)
un  gstreamer1.0-visualization            <none>                   <none>       (no description available)
ii  gstreamer1.0-x:amd64                  1.20.1-1                 amd64        GStreamer plugins for X11 and Pango
ii  gstreamer1.0-x:i386                   1.20.1-1                 i386         GStreamer plugins for X11 and Pango

@dimitre
Copy link
Member Author

dimitre commented Apr 25, 2023

dpkg -l gstreamer*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                            Version         Architecture Description
+++-===============================-===============-============-=======================================================
un  gstreamer0.10-packagekit        <none>          <none>       (no description available)
ii  gstreamer1.0-alsa:amd64         1.22.1-1ubuntu1 amd64        GStreamer plugin for ALSA
un  gstreamer1.0-audiosink          <none>          <none>       (no description available)
un  gstreamer1.0-audiosource        <none>          <none>       (no description available)
ii  gstreamer1.0-clutter-3.0:amd64  3.0.27-3        amd64        Clutter PLugin for GStreamer 1.0
un  gstreamer1.0-doc                <none>          <none>       (no description available)
ii  gstreamer1.0-gl:amd64           1.22.1-1ubuntu1 amd64        GStreamer plugins for GL
ii  gstreamer1.0-gtk3:amd64         1.22.1-1ubuntu1 amd64        GStreamer plugin for GTK+3
un  gstreamer1.0-libav              <none>          <none>       (no description available)
ii  gstreamer1.0-packagekit         1.2.6-3         amd64        GStreamer plugin to install codecs using PackageKit
ii  gstreamer1.0-pipewire:amd64     0.3.65-3        amd64        GStreamer 1.0 plugin for the PipeWire multimedia server
un  gstreamer1.0-plugins-bad        <none>          <none>       (no description available)
ii  gstreamer1.0-plugins-base:amd64 1.22.1-1ubuntu1 amd64        GStreamer plugins from the "base" set
ii  gstreamer1.0-plugins-base-apps  1.22.1-1ubuntu1 amd64        GStreamer helper programs from the "base" set
ii  gstreamer1.0-plugins-good:amd64 1.22.1-1ubuntu1 amd64        GStreamer plugins from the "good" set
ii  gstreamer1.0-plugins-ugly:amd64 1.22.1-1        amd64        GStreamer plugins from the "ugly" set
un  gstreamer1.0-plugins-ugly-amr   <none>          <none>       (no description available)
un  gstreamer1.0-pulseaudio         <none>          <none>       (no description available)
ii  gstreamer1.0-tools              1.22.2-1        amd64        Tools for use with GStreamer
un  gstreamer1.0-videosink          <none>          <none>       (no description available)
un  gstreamer1.0-videosource        <none>          <none>       (no description available)
un  gstreamer1.0-visualization      <none>          <none>       (no description available)
ii  gstreamer1.0-x:amd64            1.22.1-1ubuntu1 amd64        GStreamer plugins for X11 and Pango

@ofTheo
Copy link
Member

ofTheo commented Apr 25, 2023

Hmm - I think you might be missing a couple of key packages.

Can you do:
sudo apt-get -y install gstreamer1.0-libav
sudo apt-get -y install gstreamer1.0-vaapi

@dimitre
Copy link
Member Author

dimitre commented Apr 26, 2023

Yes it works after this. We have to update some scripts.
install_codecs.sh ?

#!/bin/sh

if [ $(id -u) != 0 ]; then
	echo "this script must be run using sudo"
	echo ""
	echo "usage:"
	echo "sudo "$0
	exit $exit_code
   exit 1
fi

GSTREAMER_VERSION=0.10
apt-cache show libgstreamer1.0-dev && GSTREAMER_VERSION=1.0

apt-get install libmpg123-dev gstreamer${GSTREAMER_VERSION}-plugins-ugly gstreamer1.0-vaapi gstreamer1.0-libav

@dimitre dimitre changed the title opencvExample is not working on Ubuntu gstreamer - opencvExample is not working on Ubuntu Apr 26, 2023
@ofTheo
Copy link
Member

ofTheo commented Apr 26, 2023

awesome @dimitre
I did a PR for it with install_dependencies as its more of a core requirement than additional codecs.
see #7528

danoli3 added a commit to danoli3/openFrameworks that referenced this issue Apr 30, 2023
…studo_all_architectures_ndk24

* commit '515b768b1d9cc133d651d045c64a14c09dd254ba': (298 commits)
  switch package gen to use PG from github (openframeworks#7540)
  fix macOS issue where fullscreen activation is broken after maximizing with green button (openframeworks#7538)
  make MF foundation default for visual studio (openframeworks#7534)
  move serialTest (openframeworks#7536)
  map (openframeworks#7535)
  Fixing GLFW issue in Ubuntu 16.04 - GLFW_TRANSPARENT_FRAMEBUFFER (openframeworks#7532)
  update linux64 (openframeworks#7531)
  add linuxaarch64 to ofxKinect to support kinect on raspberrypi 64 bit (openframeworks#7530)
  add missing gstreamer packages for Ubuntu 22.04 and newer closes openframeworks#7516 (openframeworks#7528)
  RPI - Linux aarch64 minor fixes (openframeworks#7527)
  bump version (openframeworks#7526)
  Windows Media Foundation and XAudio Sound Player (openframeworks#7523)
  Bugfix vs pg (openframeworks#7525)
  use AV_Engine if OF_NO_FMOD is defined (openframeworks#7512)
  manual run nightly
  Proposal: a way of not bundling FMOD in XCode (openframeworks#7507)
  add linuxaarch64 to nightly builds and create_package (openframeworks#7511)
  Rename assimpExample remove 3DModelLoaderExample (openframeworks#7510)
  faster sort and option for natural, fast and by date (openframeworks#7509)
  Media Foundation Video Player fix pixels (openframeworks#7506)
  ...

# Conflicts:
#	addons/ofxAndroid/src/ofAppAndroidWindow.cpp
#	libs/openFrameworks/3d/ofMesh.h
#	libs/openFrameworks/3d/ofMesh.inl
#	libs/openFrameworks/app/ofAppBaseWindow.h
#	libs/openFrameworks/gl/ofMaterial.cpp
#	libs/openFrameworks/gl/ofTexture.h
#	libs/openFrameworks/graphics/ofTrueTypeFont.cpp
#	libs/openFrameworks/graphics/ofTrueTypeFont.h
#	libs/openFrameworks/sound/ofAVEngineSoundPlayer.h
#	libs/openFrameworks/sound/ofAVEngineSoundPlayer.mm
#	libs/openFrameworks/sound/ofSoundBaseTypes.cpp
#	libs/openFrameworks/sound/ofSoundBaseTypes.h
#	libs/openFrameworks/sound/ofSoundStream.cpp
#	libs/openFrameworks/utils/ofConstants.h
#	libs/openFrameworks/utils/ofFileUtils.cpp
#	libs/openFrameworksCompiled/project/android/build.gradle
#	libs/openFrameworksCompiled/project/android/config.android.default.mk
#	libs/openFrameworksCompiled/project/ios/iOS+OFLib.xcodeproj/project.pbxproj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants