My goal is to restart the Argus Camera API or Gstreamer pipeline restarting the system. This is because sometimes the C++ app crash and will not restart. The only known solution now is to restart the system.
My expected result is that I can restart the C++ app without the need to restart the system.
My actual result is that I need to restart the system.
(Argus) Error EndOfFile: Unexpected error in reading socket (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 266)
(Argus) Error EndOfFile: Receive worker failure, notifying 1 waiting threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 340)
(Argus) Error InvalidState: Argus client is exiting with 1 outstanding client threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 357)
(Argus) Error EndOfFile: Receiving thread terminated with error (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadWrapper(), line 368)
(Argus) Error EndOfFile: Client thread received an error from socket (in src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 145)
(Argus) Error EndOfFile: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 91)
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:791 Failed to create OutputStream
(Argus) Error InvalidState: Receive thread is not running cannot send. (in src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 96)
(Argus) Error InvalidState: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 91)
(Argus) Error InvalidState: Receive thread is not running cannot send. (in src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 96)
(Argus) Error InvalidState: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 91)
(Argus) Error InvalidState: Receive thread is not running cannot send. (in src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 96)
(Argus) Error InvalidState: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 91)
nvbuf_utils: Could not get EGL display connection
GST_ARGUS: Creating output stream
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (933) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
(Argus) Error InvalidState: Receive thread is not running cannot send. (in src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 96)
(Argus) Error InvalidState: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 91)
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:751 Failed to create CaptureSession
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (933) open OpenCV | GStreamer warning: Cannot query video position: status=0, value=-1, duration=-1
Start grabbing
Press q to terminate
Press v for verbose
Press p to predict
ERROR! blank frame grabbed
(Argus) Error InvalidState: Receive thread is not running cannot send. (in src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 96)
(Argus) Error InvalidState: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 91)
How to open camera.
JetsonCamera::JetsonCamera(const std::string sensorID,
const std::string captureWidth,
const std::string captureHeight,
const std::string frameRate,
const std::string displayWidth,
const std::string displayHeight)
: cap_(buildGStreamerPipeline(sensorID,
captureWidth,
captureHeight,
frameRate,
displayWidth,
displayHeight),
cv::CAP_GSTREAMER)
{
}
std::string JetsonCamera::buildGStreamerPipeline(
const std::string sensorID,
const std::string captureWidth,
const std::string captureHeight,
const std::string frameRate,
const std::string displayWidth,
const std::string displayHeight)
{
std::stringstream pipeline;
pipeline << "nvarguscamerasrc sensor-id=" << sensorID << " ! "
<< "video/x-raw(memory:NVMM),width=(int)" << captureWidth << ",height=(int)" << captureHeight << ",format=(string)NV12,framerate=(fraction)" << frameRate << "/1 ! "
<< "nvvidconv flip-method=0 ! "
<< "video/x-raw,width=(int)" << displayWidth << ",height=(int)" << displayHeight << ",format=(string)BGRx ! "
<< "videoconvert ! "
<< "video/x-raw,format=(string)BGR ! "
<< "appsink";
return pipeline.str();
}