1

I am trying to install the official NVIDIA Codecs for GStreamer. I have the following setup:

  • Ubuntu 18.04
  • Gstreamer 1.14.5
  • NVIDIA QUADRO P2000
  • NVIDIA-SMI 440.100 Driver Version: 440.100
  • CUDA Version 10.2.89
  • NVIDIA Video_Codec_SDK_9.0.20

I followed this installation guide http://lifestyletransfer.com/how-to-install-nvidia-gstreamer-plugins-nvenc-nvdec-on-ubuntu/

After the installation I can use nvdec in the following command without a problem:

gst-launch-1.0 filesrc location=jumanji.mp4 ! qtdemux ! h264parse ! nvdec ! glimagesink sync=false

Howerver, when trying to use the encoder nvh264enc with the following command:

gst-launch-1.0 videotestsrc num-buffers=10000 ! nvh264enc ! h264parse ! mp4mux ! filesink location=video.mp4

I get the following error:

Error: from Element /GstPipeline:pipeline0/GstNvH264Enc:nvh264enc0: The Supported library could not be initialized. gstvideoencoder.c(1627): gst_video_encoder_change_state (): /GstPipeline:pipeline0/GstNvH264Enc:nvh264enc0: Failed to open encoder

I have tried to look for similar error reports without luck. Any lead on how to solve it would be deeply appreciated.

EDIT:

By executing the previous pipeline with the Debug level --gst-debug-level=5 I can read the following error message in the log:

nvenc gstnvenc.c:267:gst_nvenc_create_cuda_context: Initialising CUDA.. 0:00:00.523634157 7971 0x56375974c600 INFO nvenc gstnvenc.c:276:gst_nvenc_create_cuda_context: Initialised CUDA 0:00:00.523654036 7971 0x56375974c600 INFO nvenc gstnvenc.c:284:gst_nvenc_create_cuda_context: 1 CUDA device(s) detected 0:00:00.523702909 7971 0x56375974c600 INFO nvenc gstnvenc.c:290:gst_nvenc_create_cuda_context: GPU #0 supports NVENC: yes (Quadro P2000) (Compute SM 6.1) 0:00:00.646223264 7971 0x56375974c600 INFO nvenc gstnvenc.c:312:gst_nvenc_create_cuda_context: Created CUDA context 0x5637599d78f0 0:00:00.646239492 7971 0x56375974c600 ERROR nvenc gstnvbaseenc.c:437:gst_nv_base_enc_open: Failed to create NVENC encoder session, ret=15 0:00:00.646262028 7971 0x56375974c600 INFO nvenc gstnvenc.c:320:gst_nvenc_destroy_cuda_context: Destroying CUDA context 0x5637599d78f0 0:00:00.755491991 7971 0x56375974c600 WARN videoencoder gstvideoencoder.c:1627:gst_video_encoder_change_state: error: Failed to open encoder

makolele12
  • 111
  • 1
  • 10

1 Answers1

0

You need to build and install the gst plugins bad with nvidia encoders/decoders enabled. They don't exist until you do. This involves downloading and installing cuda, cloning the repo, building the plugins, installing in the relevant directories.

reed
  • 61
  • 1
  • 6