But last line doesn’t execute. It just freeze, after pressing ctrl+c I receive this message:
(python3:45): GStreamer-CRITICAL **: 14:40:05.666:
Trying to dispose element pipeline0, but it is in READY instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.
[ WARN:0] global ./modules/videoio/src/cap_gstreamer.cpp (1053) open OpenCV | GStreamer warning: unable to start pipeline
(python3:45): GStreamer-CRITICAL **: 14:40:05.666:
Trying to dispose element videoconvert0, but it is in PAUSED instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.
[ WARN:0] global ./modules/videoio/src/cap_gstreamer.cpp (616) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
(python3:45): GStreamer-CRITICAL **: 14:40:05.666:
Trying to dispose element appsink0, but it is in READY instead of the NULL state.
You need to explicitly set elements to the NULL state before
dropping the final reference, to allow them to clean up.
This problem may also be caused by a refcounting bug in the
application or some element.
All of this was executed on Duckiebot DB21M in docker container. Before starting the container I’ve checked, that no process was using /dev/video0 by executing lsof /dev/video0
Docker container was started with flags --privileged -v /data:/data -v /dev:/dev so it should have access to all devices including camera
I’m not quite familiar with gstreamer, so I’m not sure how to execute it properly, so I tried two variants: gst-launch-1.0 ! nvarguscamerasrc sensor-id=0 sensor-mode=3 exposuretimerange="100000 80000000" ! "video/x-raw(memmory:NVMM), width=(int)640, height=(int)480, format=(string)NV12, framerate=(fraction)30/1" ! nvvidconv ! video/x-raw, format=BGRx ! videoconvert ! appsink
This provide me with this result: WARNING: erroneous pipeline: syntax error
And this try: gst-launch-1.0 nvarguscamerasrc sensor-id=0 sensor-mode=3 exposuretimerange="100000 80000000" ! "video/x-raw(memmory:NVMM), width=(int)640, height=(int)480, format=(string)NV12, framerate=(fraction)30/1" ! nvvidconv ! video/x-raw, format=BGRx ! videoconvert ! appsink
Provided me with this result: WARNING: erroneous pipeline: no element "nvarguscamerasrc"
Ok, got it. No worries, we can try to fix this together.
Its weird that it is saying that you don’t have the nvarguscamerasrc element, since it should already be installed in your Jetson board.
Also, just for you know. The appsink element will only work to get data from GStreamer into an application, so if we are going to run a pipeline outside an app, we should use a different sink, such as a videosink to watch the camera stream.
Lets try simplifying the pipeline to see what do we get.
Important to mention, that all of this happens in docker container, however in my docker file I install gstreamer as it was written in this guide. So I have line in my docker file: RUN apt-get install -y gstreamer1.0-alsa gstreamer1.0-libav gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-tools libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-dev
And in Docker container I have Gstreamer version 1.20.3, but without nvarguscamerasrc
What happens if you run this inside and outside the host container:
gst-inspect-1.0 | grep nv
I was reading this other forum and it seems like the NVIDIA accelerated plugins should be installed on the host device and the Docker container should have access to them:
Unfortunately solution from topic you’ve mentioned doesn’t help me.
If I run export LD_PRELOAD=/lib/aarch64-linux-gnu/libGLdispatch.so.0:/lib/aarch64-linux-gnu/libgomp.so.1 in container and after that run gst-inspect-1.0 | grep nv I’ll receive the same output as I sent before
I’ve tried to pull image from your link: docker run -it --rm --net=host --runtime nvidia -v /tmp/.X11-unix/:/tmp/.X11-unix nvcr.io/nvidia/l4t-base:r35.1.0 (I’ve removed flag for display, because I don’t have one)
In container I’ve installed opencv and executed the same lines of code, as I wrote in the start of this topic.
Right now execution isn’t blocked, but I can’t connect to camera.
I’ve also executed export LD_PRELOAD=/lib/aarch64-linux-gnu/libGLdispatch.so.0:/lib/aarch64-linux-gnu/libgomp.so.1 as it was mentioned in other topic you’ve sent here.
Also I tried to execute these two lines: gst-launch-1.0 nvarguscamerasrc ! nvvidconv ! ximagesink I’ve received warning: WARNING: erroneous pipeline: no element "ximagesink"
And for this line: gst-launch-1.0 nvarguscamerasrc ! nvvidconvI have this output:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
(Argus) Error FileOperationFailed: Connecting to nvargus-daemon failed: No such file or directory (in src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 201)
(Argus) Error FileOperationFailed: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 102)
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:551 Failed to create CameraProvider
docker run -it --rm --net=host --runtime nvidia -v /tmp/.X11-unix/:/tmp/.X11-unix nvcr.io/nvidia/l4t-base:r35.1.0
root@duckie06:/# export LD_PRELOAD=/lib/aarch64-linux-gnu/libGLdispatch.so.0:/lib/aarch64-linux-gnu/libgomp.so.1
root@duckie06:/# gst-launch-1.0 nvarguscamerasrc ! fakesink
(gst-plugin-scanner:9): GStreamer-WARNING **: 14:51:57.497: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvcompositor.so': libgstbadvideo-1.0.so.0: cannot open shared object file: No such file or directory
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
(Argus) Error FileOperationFailed: Connecting to nvargus-daemon failed: No such file or directory (in src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 201)
(Argus) Error FileOperationFailed: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 102)
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:551 Failed to create CameraProvider
Got EOS from element "pipeline0".
Execution ended after 0:00:00.011416446
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...