-
Notifications
You must be signed in to change notification settings - Fork 460
Build GStreamer MSDK
This build documentation was tested under clear Ubuntu 18.04 (with gcc-7.4.0) and Ubuntu 19.04 (gcc-8.3.0) but it should work on another OS distributions with various versions of gcc and clang.
You can get it in two ways:
-
Build from sources:
- Intel Media Driver for VAAPI (aka iHD) (gmmlib and LibVA required)
- Intel Media SDK
do not forget to export environment variables:
export LIBVA_DRIVERS_PATH=/path/to/iHD_driver export LIBVA_DRIVER_NAME=iHD export LD_LIBRARY_PATH=/path/to/msdk/lib export PKG_CONFIG_PATH=/path/to/msdk/lib/pkgconfig
-
Starting from Ubuntu 19.04 Intel media stack components are available for installation via apt-get (see: Intel media stack on Ubuntu).
sudo apt-get install libva-dev libmfx-dev intel-media-va-driver-non-free export LIBVA_DRIVER_NAME=iHD
Currently (on 23 Aug 2019) GStreamer package which installs via apt-get does not contain msdk plugin, so we need to build & install this from sources.
For build gstreamer uses meson
and ninja
packages.
You can get meson
through your package manager or using
pip3 install --user meson
This will install meson
into ~/.local/bin
which may or may not be included automatically in your PATH
by default.
You should get ninja
using your package manager or download the official release and put the ninja binary in your PATH
.
git clone https://gitlab.freedesktop.org/gstreamer/gstreamer
cd gstreamer
meson build
ninja -C build
ninja -C build install
git clone https://gitlab.freedesktop.org/gstreamer/gst-plugins-base
cd gst-plugins-base
meson build
ninja -C build
ninja -C build install
git clone https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad
cd gst-plugins-bad
meson build
After configure log must contains:
Run-time dependency libmfx found: YES 1.28
Has header "mfx/mfxdefs.h" : YES
Has header "mfxvp9.h" : YES
Or can check why msdk will not be built. Example of error log:
sys/msdk/meson.build:91:2: ERROR: Dependency "gudev-1.0" not found, tried pkgconfig
For build & install plugins to you machine:
ninja -C build
ninja -C build install
for check that plugins install:
gst-inspect-1.0 | grep msdk
output:
msdk: msdkvpp: MSDK Video Postprocessor
msdk: msdkvp9enc: Intel MSDK VP9 encoder
msdk: msdkvp9dec: Intel MSDK VP9 decoder
msdk: msdkvc1dec: Intel MSDK VC1 decoder
msdk: msdkvp8enc: Intel MSDK VP8 encoder
msdk: msdkvp8dec: Intel MSDK VP8 decoder
msdk: msdkmpeg2enc: Intel MSDK MPEG2 encoder
msdk: msdkmpeg2dec: Intel MSDK MPEG2 decoder
msdk: msdkmjpegenc: Intel MSDK MJPEG encoder
msdk: msdkmjpegdec: Intel MSDK MJPEG decoder
msdk: msdkh265enc: Intel MSDK H265 encoder
msdk: msdkh265dec: Intel MSDK H265 decoder
msdk: msdkh264enc: Intel MSDK H264 encoder
msdk: msdkh264dec: Intel MSDK H264 decoder
GStreamer has built-in debug facilities contolled by --gst-debug-level=* option.
Debug levels:
- 0 - no logging
- 7 - maximum level
gst-launch-1.0 --gst-debug-no-color --gst-debug-level=7 filesrc location=in.file ! filesink location=out.file
wget https://fate-suite.libav.org/h264-conformance/AUD_MW_E.264
H264 video decode and save as a raw file
gst-launch-1.0 filesrc location=AUD_MW_E.264 \
! h264parse ! msdkh264dec \
! filesink location=aud_mw_e176x144.yuv
Encode raw video as H265
gst-launch-1.0 filesrc location=aud_mw_e176x144.yuv \
! videoparse width=176 height=144 \
! msdkh265enc ! filesink location=aud_mw_e176x144.hevc
Transcode h264 to h265
gst-launch-1.0 \
filesrc location=AUD_MW_E.264 \
! h264parse ! msdkh264dec \
! videoparse width=176 height=144 \
! msdkh265enc ! filesink location=AUD_h264_to_h265.hevc
Decode -> VPP -> Encode
gst-launch-1.0 \
filesrc location=AUD_MW_E.264 ! h264parse ! msdkh264dec \
! msdkvpp ! video/x-raw, width=352, height=288 \
! videoparse width=352 height=288 ! msdkh265enc \
! filesink location=h264d_VPPresize_h265e.hevc
Since GStreamer 1.17.x development series
removed autotools
support and switched to meson
.
This section contains information how-to build Gstreamer with autotools
.
git clone https://gitlab.freedesktop.org/gstreamer/gstreamer
cd gstreamer
./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu
make
sudo make install
git clone https://gitlab.freedesktop.org/gstreamer/gst-plugins-base
cd gst-plugins-base
./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu
make
sudo make install
git clone https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad
cd gst-plugins-bad
./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu
make
sudo make install
- Media SDK for Linux
- Media SDK for Windows
- FFmpeg QSV
- GStreamer MSDK
- Docker
- Usage guides
- Building Media SDK
- Running Media SDK CI tests
- Additional information
- Multi-Frame Encode