Skip to content

Instantly share code, notes, and snippets.

@corenel

corenel/README.md

Last active Sep 23, 2020
Embed
What would you like to do?
Install NVDEC and NVENC as GStreamer plugins

Install NVDEC and NVENC as GStreamer plugins

Environment

  • Ubuntu 18.04
  • NVIDIA driver 430.40
  • NVIDIA Video Codec SDK 9.0.20

Steps

  1. Clone the gst-plugins-bad and check out to the same version as GStreamer
git clone git://anongit.freedesktop.org/gstreamer/gst-plugins-bad
cd gst-plugins-bad/
git checkout 1.14.0
  1. Download NVIDIA Video Codec SDK and copy header files
cd /path/to/video/codec/sdk
cp /usr/local/cuda/include/cuda.h /path/to/gst-plugins-bad/sys/nvenc
cp include/nvEncodeAPI.h /path/to/gst-plugins-bad/sys/nvenc
cp include/cuviddec.h /path/to/gst-plugins-bad/sys/nvdec
cp include/nvcuvid.h /path/to/gst-plugins-bad/sys/nvdec
  1. Build plugins
cd /path/to/gst-plugins-bad
NVENCODE_CFLAGS="-I/path/to/gst-plugins-bad/sys/nvenc" ./autogen.sh --with-cuda-prefix="/usr/local/cuda"
cd sys/nvenc
make
sudo cp .libs/libgstnvenc.so /usr/lib/x86_64-linux-gnu/gstreamer-1.0/
cd ../nvdec
make
sudo cp .libs/libgstnvdec.so /usr/lib/x86_64-linux-gnu/gstreamer-1.0/
  1. Check installation
gst-inspect-1.0 | grep nvenc
gst-inspect-1.0 | grep nvdec

References

@sujit25

This comment has been minimized.

Copy link

@sujit25 sujit25 commented Mar 31, 2020

Typo error:

  1. cp include/nvcuvid.h /path/to/gst-plugins-bad/sys/nvdec
  2. gst-inspect-1.0 | grep nvenc
  3. gst-inspect-1.0 | grep nvdec

However after installing, unable to see nvenc and nvdec.
image

@corenel

This comment has been minimized.

Copy link
Owner Author

@corenel corenel commented Mar 31, 2020

Typo error:

  1. cp include/nvcuvid.h /path/to/gst-plugins-bad/sys/nvdec
  2. gst-inspect-1.0 | grep nvenc
  3. gst-inspect-1.0 | grep nvdec

However after installing, unable to see nvenc and nvdec.

image

Thanks for your correction.
These plugins in my PC is fine as follows:

$ gst-inspect-1.0 | grep nvenc
nvenc:  nvh264enc: NVENC H.264 Video Encoder
$ gst-inspect-1.0 | grep nvdec
nvdec:  nvdec: NVDEC video decoder

Could you check the installation location prefix of your GStreamer by where gst-inspect-1.0? Mine is /usr instead of /usr/local, so the plugin directory is /usr/lib/x86_64-linux-gnu/gstreamer-1.0/. Maybe your installation has another location.

Or you can check if these two plugins are blacklisted by gst-inspect-1.0 -b.

@muimota

This comment has been minimized.

Copy link

@muimota muimota commented Aug 23, 2020

It seems you are using anaconda which has it's own gstreamer included. check which one are you using with which gst-inspect-1.0

@sujit-dn

This comment has been minimized.

Copy link

@sujit-dn sujit-dn commented Aug 24, 2020

Yeah, I agree. I deactivated conda base environment and it worked. Thanks a lot for assistance

@zshivers

This comment has been minimized.

Copy link

@zshivers zshivers commented Sep 23, 2020

These instructions break with SDK 10, since they renamed include/ to Interface/.
I also found it helpful to add --disable-gtk-doc after ./autogen.sh to disable that dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.