Gstreamer Bad plugins opencv: WARNING: erroneous pipeline: no element "opencvtextoverlay" - linux

I have installed GStreamer on my ubuntu 18.04 using
sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
from the guide here. https://gstreamer.freedesktop.org/documentation/installing/on-linux.html?gi-language=c
when I try to use the opencvtextoverlay plugin in the bad plugins I get the next error WARNING: erroneous pipeline: no element "opencvtextoverlay"
example pipeline:
gst-launch-1.0 filesrc location=1.mp4 ! qtdemux name=demux ! queue ! decodebin ! videoconvert ! opencvtextoverlay text="test" ! videoconvert ! videoscale ! autovideosink
How can I fix that?

The plugin you are trying to use(opencvtextoverlay) is from OpenCV, for this reason is that you need to install the following library:
sudo apt install gstreamer1.0-opencv
Then you can check if it exists with the following command:
gst-inspect-1.0 opencvtextoverlay
Your pipeline should work fine now.

Related

Run Flutter integration tests for Linux desktop in Docker

I'm trying to run integration tests for a Linux desktop application in a Docker container.
I have a working project, running successful integration tests on Linux device.
I created a Docker image from the following Dockerfile content:
FROM cirrusci/flutter:stable
RUN apt-get update && \
export DEBIAN_FRONTEND=noninteractive && \
apt-get -y install --no-install-recommends unzip pkg-config clang cmake ninja-build libgtk-3-dev libappindicator1 fonts-liberation gpg-agent libxi6 libgconf-2-4 && \
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - && \
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
apt-get update && apt-get -y install google-chrome-stable && \
CHROMEVER=$(google-chrome --product-version | grep -o "[^\.]*\.[^\.]*\.[^\.]*") && \
DRIVERVER=$(curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROMEVER") && \
wget -q --continue -P /chromedriver "http://chromedriver.storage.googleapis.com/$DRIVERVER/chromedriver_linux64.zip" && \
unzip /chromedriver/chromedriver* -d /chromedriver && \
rm -rf /var/lib/apt/lists/*
ENV PATH $CHROMEDRIVER_DIR:$PATH
I'm not sure I need Chrome and Chromedriver for my usecase, but at least it's here.
When running "flutter doctor" from this image, I get:
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel unknown, 3.3.8, on Ubuntu 22.04 LTS 5.15.0-53-generic, locale en_US.UTF-8)
! Flutter version 3.3.8 on channel unknown at /sdks/flutter
! Upstream repository unknown
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[!] Android Studio (not installed)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
! Doctor found issues in 2 categories.
which seems quite OK.
However when running my integration tests, attempting to give access to my local X server (I'm using Ubuntu 22.04 on Wayland):
docker run --rm -it -v ${PWD}:/workspace --privileged -w /workspace -e DISPLAY="unix:0" -v /tmp/.X11-unix:/tmp/.X11-unix flutter:local /bin/sh -c "flutter clean && flutter test integration_test"
The tests fail with:
Deleting build... 14ms
Deleting .dart_tool... 3ms
Deleting ephemeral... 3ms
Deleting ephemeral... 0ms
Deleting ephemeral... 0ms
Deleting .flutter-plugins-dependencies... 0ms
Deleting .flutter-plugins... 0ms
Downloading Web SDK... 1,658ms
Downloading CanvasKit... 1,084ms
Downloading linux-x64/linux-x64-flutter-gtk tools... 1,090ms
Downloading linux-x64-profile/linux-x64-flutter-gtk tools... 156ms
Downloading linux-x64-release/linux-x64-flutter-gtk tools... 124ms
Running "flutter pub get" in workspace... 1,498ms
00:00 +0: loading /workspace/integration_test/main_test.dart B00:07 +0: loading /workspace/integration_test/main_test.dart
Error waiting for a debug connection: The log reader stopped unexpectedly, or never started.
00:07 +0 -1: loading /workspace/integration_test/main_test.dart [E]
TestDeviceException(Unable to start the app on the device.)
package:flutter_tools/src/test/integration_test_device.dart 60:7 IntegrationTestTestDevice.start
To run this test again: /sdks/flutter/bin/cache/dart-sdk/bin/dart test /workspace/integration_test/main_test.dart -p vm --plain-name 'loading /workspace/integration_test/main_test.dart'
00:07 +0 -1: Some tests failed.
Adding verbose to the test does not give much better than TestDeviceException(Unable to start the app on the device.)
I tried many things but I can't get it to work, and I can't find a lot of documentation on integration tests for desktop applications on Flutter, only on web applications, which is easier with headless Chrome.
If anyone has any hint about what could be wrong, I'd love it. Otherwise, I'll make my CI/CD run in shell mode on a non-headless VM instead of Docker, which I'd prefer not to.

ERROR: SvtAv1Enc not found using pkg-config

I am trying to compile FFmpeg with SVT-AV1 codec, following instructions from here: https://github.com/OpenVisualCloud/SVT-AV1/tree/master/ffmpeg_plugin
Everything goes well, but when I try to run
./configure --enable-libsvtav1
I am getting
ERROR: SvtAv1Enc not found using pkg-config
If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user#ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
The content of the ffbuild/config.log: https://pastebin.com/euPriFAp
There is an exact issue on the github: https://github.com/OpenVisualCloud/SVT-AV1/issues/35, but is closed as solved.
I have tried both on my Mac and in the Docker container with Ubuntu 18.04, but getting the same result.
Could anyone please help, what am I doing wrong?
The problem was in the lack of requred libraries. Please find the complete installation instruction below.
Installing packages required for compiling:
sudo apt-get update
sudo apt-get install \
autoconf \
automake \
build-essential \
cmake \
git-core \
libass-dev \
libfreetype6-dev \
libsdl2-dev \
libtool \
libva-dev \
libvdpau-dev \
libvorbis-dev \
libxcb1-dev \
libxcb-shm0-dev \
libxcb-xfixes0-dev \
pkg-config \
texinfo \
wget \
zlib1g-dev
Installing assemblers used by some libraries:
sudo apt-get install nasm
sudo apt-get install yasm
Build and install SVT-AV1:
git clone --depth=1 https://github.com/OpenVisualCloud/SVT-AV1
cd SVT-AV1
cd Build
cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
make -j $(nproc)
sudo make install
Apply SVT-AV1 plugin and enable libsvtav1 to FFmpeg:
cd ~
git clone -b release/4.2 --depth=1 https://github.com/FFmpeg/FFmpeg ffmpeg
cd ffmpeg
export LD_LIBRARY_PATH+=":/usr/local/lib"
export PKG_CONFIG_PATH+=":/usr/local/lib/pkgconfig"
git apply ../SVT-AV1/ffmpeg_plugin/0001-Add-ability-for-ffmpeg-to-run-svt-av1.patch
./configure --enable-libsvtav1
(Note: if you want other codecs to be supported please add the required flags to the ./configure command)
Build FFmpeg:
make
make install
hash -r
source ~/.profile
Now you should have ffmpeg command working and have svt-av1 in encoders list:
ffmpeg -encoders
...
V..... libsvt_av1 SVT-AV1(Scalable Video Technology for AV1) encoder (codec av1)
...
I used next docs a reference:
https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
https://github.com/OpenVisualCloud/SVT-AV1/tree/master/ffmpeg_plugin

WARNING: erroneous pipeline: no element "rtspclientsink"

I have a gstreamer command that requires "rtspclientsink" and the error I get is:
WARNING: erroneous pipeline: no element "rtspclientsink"
I tried to reinstall gstreamer using the following command:
sudo apt-get install --reinstall gstreamer1.0-alsa gstreamer1.0-libav
gstreamer1.0-plugins-bad gstreamer1.0-plugins-base
gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly
gstreamer1.0-pulseaudio libgstreamer-plugins-bad1.0-0
libgstreamer-plugins-base1.0-0 libgstreamer-plugins-good1.0-0
libgstreamer1.0-0
but I still have this error.
Please help.
This particular plugin is not part of the basic three plugin packages.
sudo apt install gstreamer1.0-rtsp

got error while download gattlib via pip3

I use Ubuntu 16.04 64bit OS
when I run
$ sudo pip3 install gattlib
I got this error message
/usr/bin/ld: cannot find -lboost_python-py34
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-g++' failed with exit status 1
I tried googling how to solve this but nothing works for me
I want to use gatttool at python, so I need to install this
How can I solve this?
PS. I already downloaded libboost-dev
pip3 download gattlib
tar xvzf ./gattlib-0.20150805.tar.gz
cd gattlib-0.20150805/
sed -ie 's/boost_python-py34/boost_python-py35/' setup.py
pip3 install .
And for python 3.7 you should do:
pip3 download gattlib
tar xvzf ./gattlib-0.20150805.tar.gz
cd gattlib-0.20150805/
sed -ie 's/boost_python-py34/boost_python37/' setup.py
pip3 install .
If Benjamin's solution does not work, try changing 35 to 36. i.e. try the code below.
pip3 download gattlib
tar xvzf ./gattlib-0.20150805.tar.gz
cd gattlib-0.20150805/
sed -ie 's/boost_python-py34/boost_python-py36/' setup.py
pip3 install .
I was running in to the following error on RPI-3B:
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
src/gattservices.cpp:6:33: fatal error: bluetooth/bluetooth.h: No such file or directory
#include
^
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
[1] Running the following command helped me to resolve:
sudo apt-get install libbluetooth-dev
[2] Also deleting the folder 'gattlib-0.20150805' and recreating it using 'tar xvzf ...' again, helped cleaning the previous compilation left over files.
This works with Raspberry 2, Rasbian Buster and Python 3. Note that Python 3 libraries seems to have different naming “The bug can be solved easily by replacing boost_python_py34 with boost_python3 when specifying the boost libraries in setup.py.“
sed -ie 's/boost_python-py37/boost_python3/' setup.py
Libraries:
/usr/lib/arm-linux-gnueabihf/libboost_python3.a
/usr/lib/arm-linux-gnueabihf/libboost_python3-py37.a
/usr/lib/arm-linux-gnueabihf/libboost_python3-py37.so
/usr/lib/arm-linux-gnueabihf/libboost_python3.so
Following PyGattlib DEPENDS all dependencies include pkg-config to "manage compile and link flags for libraries". This solved
/usr/bin/ld: cannot find -lboost_python-py36
I updated my package install dependencies and it works !
RUN install_packages \
python3-dev \
libbluetooth-dev \
libboost-python-dev \
libboost-thread-dev \
libglib2.0-dev \
pkg-config
RUN python3 -m pip install pygattlib
Docker Balena.io
Ubuntu "bionic beaver"

/usr/bin/ld: cannot find -lGL Xubuntu 12.10 AMD open source

I am trying to compile the example from the following website: http://www.opengl-tutorial.org/beginners-tutorials/tutorial-1-opening-a-window/
At first CMake was unable to find libGL.so, so I pointed it to where the lib is (/usr/lib/x86_64-linux-gnu/mesa/libGL.so) in the txt file. After that I tried make all and this gave me the following error: /usr/bin/ld: cannot find -lGL. According to what I found this means that ld is unable to find libGL.so, but if I type locate libGL I get the following response:
/home/jacko/.local/share/Steam/SteamApps/common/Cave Story+/lib/libGLU.so.1
/home/jacko/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libGLEW.so.1.6
/home/jacko/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libGLEW.so.1.6.0
/home/jacko/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libGLU.so.1
/home/jacko/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libGLU.so.1.3.08004
/home/jacko/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/share/doc/nvidia-cg-toolkit/examples/Tools/trace/libGL.so.1.gz
/home/jacko/.local/share/Steam/ubuntu12_32/steam-runtime.old/i386/usr/lib/i386-linux-gnu/libGLEW.so.1.6
/home/jacko/.local/share/Steam/ubuntu12_32/steam-runtime.old/i386/usr/lib/i386-linux-gnu/libGLEW.so.1.6.0
/home/jacko/.local/share/Steam/ubuntu12_32/steam-runtime.old/i386/usr/lib/i386-linux-gnu/libGLU.so.1
/home/jacko/.local/share/Steam/ubuntu12_32/steam-runtime.old/i386/usr/lib/i386-linux-gnu/libGLU.so.1.3.08004
/home/jacko/.local/share/Steam/ubuntu12_32/steam-runtime.old/i386/usr/share/doc/nvidia-cg-toolkit/examples/Tools/trace/libGL.so.1.gz
/opt/cave-story-plus/lib64/libGLU.so.1
/usr/lib/i386-linux-gnu/libGLU.so.1
/usr/lib/i386-linux-gnu/libGLU.so.1.3.1
/usr/lib/i386-linux-gnu/mesa/libGL.so.1
/usr/lib/i386-linux-gnu/mesa/libGL.so.1.2.0
/usr/lib/x86_64-linux-gnu/libGLU.a
/usr/lib/x86_64-linux-gnu/libGLU.so
/usr/lib/x86_64-linux-gnu/libGLU.so.1
/usr/lib/x86_64-linux-gnu/libGLU.so.1.3.1
/usr/lib/x86_64-linux-gnu/mesa/libGL.so
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
/usr/lib/x86_64-linux-gnu/qtcreator/libGLSL.so
/usr/lib/x86_64-linux-gnu/qtcreator/libGLSL.so.1
/usr/lib/x86_64-linux-gnu/qtcreator/libGLSL.so.1.0
/usr/lib/x86_64-linux-gnu/qtcreator/libGLSL.so.1.0.0
/usr/lib/x86_64-linux-gnu/qtcreator/plugins/Nokia/libGLSLEditor.so
/usr/lib32/libGL.so
Which looks to me like libGL is fully available.
also:
~$ sudo apt-get install libgl1-mesa-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libgl1-mesa-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
I am running Xubuntu 12.10 with opensource AMD drivers.
If anyone else encounters this too: the symlinks between /usr/lib/x86_64-linux-gnu/libGL.so and /usr/lib/x86_64-linux-gnu/mesa/libGL.so was gone. I did sudo apt-get remove --purge libgl1-mesa-dev and sudo apt-get install ibgl1-mesa-dev* libglu1-mesa-dev* libqt4-opengl-dev* qt-sdk* to fix this.
Maybe this simple script will help someone. The 1 answer helps me too but this script finish what was missing.
#!/bin/bash
DEPENDS='libx11-dev'
DEPENDS+=' libxmu-dev'
DEPENDS+=' libglu1-mesa-dev'
DEPENDS+=' libgl2ps-dev'
DEPENDS+=' libxi-dev'
DEPENDS+=' libglfw-dev'
DEPENDS+=' g++'
DEPENDS+=' libzip-dev'
DEPENDS+=' libglew*-dev'
MISSING=
echo "Checking for missing packages ..."
for i in $DEPENDS; do
if ! dpkg-query -W --showformat='${Status}\n' $i | grep "install ok installed" > /dev/null; then
MISSING+="$i "
fi
done
if [ -n "$MISSING" ]; then
TXTCOLOR_DEFAULT="\033[0;m"
TXTCOLOR_GREEN="\033[0;32m"
echo -e $TXTCOLOR_GREEN"Missing packages: $MISSING.\nYou may be asked for your password for package installation."$TXTCOLOR_DEFAULT
sudo apt-get --force-yes --yes install $MISSING
fi

Resources