when i complie gstreamer+nvidia to decode video,which generating some error.please assist me to analyze this problem
my computer env:
RTX3060
ubuntu 20.04
cuda 12.2
cudnn 11.3
NVIDIA-SMI 535.146.02
tensorRT 8.6
gst-inspect-1.0 version 1.16.3
GStreamer 1.16.3
Video_Codec_SDK_12.1.14
the complie step:
ubuntu@ubuntu:~$ sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
ubuntu@ubuntu:~$ git clone -b 1.16 GStreamer / gst-plugins-bad · GitLab
Cloning into ‘gst-plugins-bad’…
remote: Enumerating objects: 227254, done.
remote: Counting objects: 100% (55/55), done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 227254 (delta 21), reused 55 (delta 21), pack-reused 227199
Receiving objects: 100% (227254/227254), 51.58
ubuntu@ubuntu:~$ cd gst-plugins-bad
ubuntu@ubuntu:~/gst-plugins-bad$ ./autogen.sh
ubuntu@ubuntu:~/gst-plugins-bad$ NVENCODE_LIBS=“-L/usr/local/cuda/lib64/stubs” NVENCODE_CFLAGS=“-I/usr/local/cuda/include” ./configure --enable-nvdec --enable-nvenc --enable-openh264 --with-cuda-prefix=“/usr/local/cuda-11.1”
//decoder
ubuntu@ubuntu:~/gst-plugins-bad$ cd sys/nvdec
ubuntu@ubuntu:~/gst-plugins-bad$ sudo make install
//encoder
ubuntu@ubuntu:~/gst-plugins-bad$ cd sys/nvenc
ubuntu@ubuntu:~/gst-plugins-bad$ sudo make install
ubuntu@ubuntu:~/gst-plugins-bad$ echo export GST_PLUGIN_PATH=“/usr/local/lib/gstreamer-1.0” >> ~/.bashrc
ubuntu@ubuntu:~/gst-plugins-bad$ source ~/.bashrc
when i test gstreamer nvdec or nvenc successfully
ubuntu@ubuntu:~/gst-plugins-bad/sys$ gst-inspect-1.0 nvdec
ubuntu@ubuntu:~/gst-plugins-bad/sys$ gst-inspect-1.0 nvh264enc
when i run the command, i encounter some error
ubuntu@ubuntu:~$ GST_DEBUG=3 gst-launch-1.0 filesrc location=/home/ubuntu/cup.mp4 ! qtdemux ! queue ! h264parse ! nvdec ! glimagesink sync=false
0:00:00.564334327 34835 0x55a93ac05f00 WARN nvdec gstnvdec.c:58:cuda_OK: CUDA call failed: CUDA_ERROR_INVALID_HANDLE, invalid resource handle
0:00:00.564346097 34835 0x55a93ac05f00 WARN nvdec gstnvdec.c:600:copy_video_frame_to_gl_textures: failed to map CUDA resources
0:00:00.568327158 34835 0x55a93ac05f00 WARN nvdec gstnvdec.c:58:cuda_OK: CUDA call failed: CUDA_ERROR_INVALID_HANDLE, invalid resource handle
0:00:00.568333197 34835 0x55a93ac05f00 WARN nvdec gstnvdec.c:600:copy_video_frame_to_gl_textures: failed to map CUDA resources
0:00:00.569587288 34835 0x55a93ac05f00 WARN nvdec gstnvdec.c:58:cuda_OK: CUDA call failed: CUDA_ERROR_INVALID_HANDLE, invalid resource handle
i have find some question in this party : Nvidia Gstreamer plugins (nvenc, nvdec) decode H265 video error