OpenVisualCloud / SVT-HEVC

SVT HEVC encoder. Scalable Video Technology (SVT) is a software-based video coding technology that is highly optimized for Intel® Xeon® processors. Using the open source SVT-HEVC encoder, it is possible to spread video encoding processing across multiple Intel® Xeon® processors to achieve a real advantage of processing efficiency.
Other
517 stars 170 forks source link

Plugin not found after Gstreamer build #421

Closed serhan-gul closed 4 years ago

serhan-gul commented 4 years ago

I followed the instructions to build the Gstreamer plugin for SVT-HEVC and received the following output:

$ ~/.local/bin/meson -Dprefix=/usr build && ninja -C build && sudo ninja -C build install**
The Meson build system
Version: 0.52.0
Source dir: /home/guel/repos/SVT-HEVC/gstreamer-plugin
Build dir: /home/guel/repos/SVT-HEVC/gstreamer-plugin/build
Build type: native build
Project name: gst-svt-hevc
Project version: 0.9.5
C compiler for the host machine: ccache cc (gcc 7.4.0 "cc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0")
C linker for the host machine: GNU ld.bfd 2.30
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (0.29.1)
Run-time dependency gstreamer-1.0 found: YES 1.16.1
Run-time dependency gstreamer-base-1.0 found: YES 1.16.1
Run-time dependency gstreamer-video-1.0 found: YES 1.16.1
Run-time dependency gstreamer-pbutils-1.0 found: YES 1.16.1
Run-time dependency svthevcenc found: YES 1.4.1
Compiler for C supports arguments -O2: YES
WARNING: Consider using the builtin optimization level rather than adding flags by hand.
Compiler for C supports arguments -D_FORTIFY_SOURCE=2: YES
Compiler for C supports arguments -Wformat: YES
Compiler for C supports arguments -Wformat-security: YES
Compiler for C supports arguments -fPIE: YES
Compiler for C supports arguments -fPIC: YES
Compiler for C supports arguments -fstack-protector-strong: YES
Build targets in project: 1
Found ninja-1.8.2 at /usr/bin/ninja
ninja: Entering directory `build'
[2/2] Linking target libgstsvthevcenc.so.
ninja: Entering directory `build'
[0/1] Installing files.
Installing libgstsvthevcenc.so to /usr/lib/x86_64-linux-gnu/gstreamer-1.0

According to the log, everything seems to be fine. However, when I run: gst-inspect-1.0 svthevcenc, I get the error:

No such element or plugin 'svthevcenc'

I double-checked to make sure that the file libgstsvthevcenc.so is actually in /usr/lib/x86_64-linux-gnu/gstreamer-1.0. For all other plugins, gst-inspect-1.0 works fine. I also tried building a pipeline using the element svthevcenc to see whether it works but is not recognized by gst-inspect-1.0; that didn't work too.

It seems like something went wrong with the installation. Any ideas?

1480c1 commented 4 years ago

You may need to build gst-plugins-bad with the git patch applied from this repo for it to work

tianjunwork commented 4 years ago

Hi @serhannn, I hope you build and installed svt hevc library already. Could you check that?

Make sure first that SVT-HEVC library is installed and can be found using pkg-config. You can do that using CMake:
cmake -P SVT-HEVC/Build/linux/release/Source/Lib/cmake_install.cmake
tianjunwork commented 4 years ago

You may need to build gst-plugins-bad with the git patch applied from this repo for it to work

Hi Chris, what you mentioned is another way to build gst plugin. Both methods should work. https://github.com/OpenVisualCloud/SVT-HEVC/tree/master/gstreamer-plugin/git-patch

serhan-gul commented 4 years ago

Hi @tianjunwork, yes I can confirm that SvtHevcEncApp is installed under /usr/local/bin and works. It is strange that the plugin is installed in the right place but not recognized by gstreamer.

tianjunwork commented 4 years ago

Hi @serhannn I noticed your gst is 1.16.1, on which we did have same issue. #391 is the fix. Please try it out.

serhan-gul commented 4 years ago

@tianjunwork My clone already includes that fix and Gstreamer already finds pbutils as I posted above: Run-time dependency gstreamer-pbutils-1.0 found: YES 1.16.1

Is there a linking problem to Gstreamer v1.16.1?

gokul989 commented 4 years ago

Hi @serhannn , Seems like the build process has a missing link to svthevc lib. could you verify if you've updated the library path to include /usr/local/lib by,

export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

If not, please try cleaning and rebuilding gst plugin after updating the lib path.

gokul989 commented 4 years ago

Hi @serhannn , Please let us know if you still see the issue.

serhan-gul commented 4 years ago

Hi @gokul989, I updated the library path as you suggested but svthevcenc still can't be found by Gstreamer. Below you can see the locations where the svthevcenc library and the gst-plugin are installed.

$ ll /usr/local/lib/libSvt*
lrwxrwxrwx 1 root   18 Nov 13 13:14 /usr/local/lib/libSvtHevcEnc.so -> libSvtHevcEnc.so.1
-rw-r--r-- 1 root 3.7M Nov 13 11:17 /usr/local/lib/libSvtHevcEnc.so.1
 $ ll /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstsvt*
-rwxr-xr-x 1 root 138K Nov 21 11:15 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstsvthevcenc.so*
gokul989 commented 4 years ago

Hi @serhannn , I've compiled this dockerfile that you can try,

FROM ubuntu:18.04 AS build
WORKDIR /root
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y -q --no-install-recommends build-essential autoconf make git wget pciutils cpio libtool lsb-release ca-certificates pkg-config bison flex libcurl4-gnutls-dev zlib1g-dev ubuntu-restricted-extras gtk-doc-tools yasm cmake libssl-dev python3-pip libperl-dev libgtk2.0-dev
RUN  apt-get install -y python3-setuptools
RUN pip3 install meson
RUN pip3 install ninja
RUN wget http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-1.16.1.tar.xz && \
    tar -xvf gstreamer-1.16* && \
    cd gstreamer-1.16.1 && \
    ./configure --libdir=/usr/lib/x86_64-linux-gnu && \
    make && make install
RUN wget http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-1.16.1.tar.xz  && \
    tar -xvf gst-plugins-base-1.16* && \
    cd gst-plugins-bas* && \
    ./configure --libdir=/usr/lib/x86_64-linux-gnu && \
    make && make install
RUN wget http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-1.16.1.tar.xz  && \
    tar -xvf gst-plugins-good-1.16* && \
    cd gst-plugins-go* && \
    ./configure --libdir=/usr/lib/x86_64-linux-gnu && \
    make && make install

RUN wget http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-1.16.1.tar.xz && \
    tar -xvf gst-plugins-bad-1.16* && \
    cd gst-plugins-bad* && \
    ./configure --libdir=/usr/lib/x86_64-linux-gnu && \
    make && make install
RUN wget http://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-1.16.1.tar.xz  && \
    tar -xvf gst-plugins-ugly-1.16* && \
    cd gst-plugins-ug* && \
    ./configure --libdir=/usr/lib/x86_64-linux-gnu && \
    make && make install
RUN git clone https://github.com/intel/SVT-HEVC && \
    cd SVT-HEVC/Build/linux && \
    git checkout v1.4.1 && \
     ./build.sh release shared install

After this, you can build gst-plugin in the container by,

cd /root/SVT-HEVC/gstr*/ && \
    meson -Dprefix=/usr build && ninja -C build && ninja -C build install

I've tried this and it works. Please let me know if you face any issues running this.