The following command correctly captures video within a Docker container.
gst-launch-1.0 nvarguscamerasrc ! fakesink
Afterwards, I restart the nvargus-daemon on the host side with command below.
sudo systemctl restart nvargus-daemon.service
Then, when executing the same pipeline within the Docker container, an error occurs. The error details are as follows:
$ gst-launch-1.0 nvarguscamerasrc ! fakesink
(Argus) Error FileOperationFailed: Connecting to nvargus-daemon failed: Connection refused (in src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 204)
(Argus) Error FileOperationFailed: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 106)
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Error generated. gstnvarguscamerasrc.cpp, execute:754 Failed to create CameraProvider
Got EOS from element "pipeline0".
Execution ended after 0:00:00.001811255
Setting pipeline to NULL ...
Freeing pipeline ...
When executing the same pipeline on the host side, no error occurs.
If I recreate the Docker container, I can execute it again without any error from within Docker. However, since I want to carry out this process while an application is running inside Docker, I am looking for a way to capture video again while remaining inside the container.
Is there a way to avoid the error within Docker?
The reason I want to do this is because, as per the question at the following URL, there is a phenomenon where the camera video occasionally stops, and in such cases, by restarting the nvargus-daemon, it is necessary to continue the application with minimal interruption.