Skip to content

Instantly share code, notes, and snippets.

@robosina
Forked from corenel/README.md
Created February 15, 2021 12:58
Show Gist options
  • Save robosina/94ff18dc85c8b862658a0c3a57a37c32 to your computer and use it in GitHub Desktop.
Save robosina/94ff18dc85c8b862658a0c3a57a37c32 to your computer and use it in GitHub Desktop.
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment