Hardware acceleration of video is now working on my Raspberry Pi 3 with Raspbian Stretch!
gkreidl, thank you very much!
I compiled the Gstreamer Bad plugin (gst-plugins-bad1.0-1.10.4 from repository) with the flags you wrote above and installed the Gstreamer OMX plugin that you compiled (gstreamer-1.0-omx-rpi_1.10.5-2+rp+patches_armhf.deb).
Some notes for Gstreamer Bad plugin compilation.
1. I used "clean" Raspbian Stretch (version with Desktop) and installed the necessary libraries:
Code: Select all
sudo apt-get install build-essential autotools-dev automake autoconf \
libtool autopoint libxml2-dev zlib1g-dev libglib2.0-dev \
pkg-config bison flex python3 git gtk-doc-tools libasound2-dev \
libgudev-1.0-dev libxt-dev libvorbis-dev libcdparanoia-dev \
libpango1.0-dev libtheora-dev libvisual-0.4-dev iso-codes \
libgtk-3-dev libraw1394-dev libiec61883-dev libavc1394-dev \
libv4l-dev libcairo2-dev libcaca-dev libspeex-dev libpng-dev \
libshout3-dev libjpeg-dev libaa1-dev libflac-dev libdv4-dev \
libtag1-dev libwavpack-dev libpulse-dev libsoup2.4-dev libbz2-dev \
libcdaudio-dev libdc1394-22-dev ladspa-sdk libass-dev \
libcurl4-gnutls-dev libdca-dev libdirac-dev libdvdnav-dev \
libexempi-dev libexif-dev libfaad-dev libgme-dev libgsm1-dev \
libiptcdata0-dev libkate-dev libmimic-dev libmms-dev \
libmodplug-dev libmpcdec-dev libofa0-dev libopus-dev \
librsvg2-dev librtmp-dev libschroedinger-dev libslv2-dev \
libsndfile1-dev libsoundtouch-dev libspandsp-dev libx11-dev \
libxvidcore-dev libzbar-dev libzvbi-dev liba52-0.7.4-dev \
libcdio-dev libdvdread-dev libmad0-dev libmp3lame-dev \
libmpeg2-4-dev libopencore-amrnb-dev libopencore-amrwb-dev \
libsidplay1-dev libtwolame-dev libx264-dev libusb-1.0 \
python-gi-dev yasm python3-dev libgirepository1.0-dev
and Gstreamer modules:
Code: Select all
gstreamer1.0-plugins-ugly
gstreamer1.0-tools
libgstreamer1.0-dev
2. I added some flags to ./autogen.sh:
--disable-wayland --enable-gles2 --enable-egl with-gles2-module-name=/opt/vc/lib/libbrcmGLESv2.so --with-egl-module-name=/opt/vc/lib/libbrcmEGL.so. Without these changes, glimagesink did not work.
Code: Select all
./autogen.sh --disable-gtk-doc --disable-examples --disable-x11 --disable-glx --disable-opengl --disable-wayland --enable-gles2 --enable-egl --enable-dispmanx --enable-introspection=yes -with-gles2-module-name=/opt/vc/lib/libbrcmGLESv2.so --with-egl-module-name=/opt/vc/lib/libbrcmEGL.so --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib/arm-linux-gnueabihf
3. After compiling, I created the package using the checkinstall. The resulting package (gst-plugins-bad1.0-1.10.4-2) could not be installed using apt-get install or Gdebi, because it overwrites some installed libraries. I installed it using dpkg with the option
--force-overwrite.
Code: Select all
sudo dpkg -i --force-overwrite gstreamer1.0-plugins-bad_1.10.4-2_armhf.deb
My tests with video:
1. videotestsrc
Code: Select all
gst-launch-1.0 --gst-debug-level=3 videotestsrc ! glimagesink
gst-launch-1.0 --gst-debug-level=3 videotestsrc ! omxh264enc ! h264parse ! omxh264dec ! glimagesink
2-5% CPU
2. H264 video (from local files)
Code: Select all
gst-launch-1.0 --gst-debug-level=3 filesrc location=/path/h264_test.mp4 ! qtdemux ! h264parse ! omxh264dec ! glimagesink
HD 1280x720 30fps CBR 1..5 Mb/s 2-6% CPU
FHD 1920x1080 30fps CBR 6 Mb/s 5-10% CPU
FHD 1920x1080 30fps CBR 12 Mb/s 7-12% CPU plays with some lags
3. H264 RTSP stream (from IP camera in local net)
Code: Select all
gst-launch-1.0 rtspsrc location='rtsp://ip_adress' latency=300 rtph264depay ! h264parse ! omxh264dec ! glimagesink
HD 1280x720 25fps CBR 1..3 Mb/s 2-7% CPU
Delay is less than when using the VLC player on a PC! It is very cool!
CPU temperature in all cases did not exceed 45 degrees, but I use a fan. Also all tests work in Python 3.
Next, I'll try to compile the OpenCV 4х library to work with Gstreamer. If I succeed, I'll create a new thread in this forum.