求助:无需重启系统即可重启GStreamer管道或Argus Camera API的方法
求助:无需重启系统即可重启GStreamer管道或Argus Camera API的方法
各位大佬好,我现在碰到一个特别棘手的问题:我的C相机应用偶尔会崩溃,崩溃之后根本没法直接重启,目前唯一能解决的办法就是重启整个系统。我迫切希望能找到不用重启系统,就能重启Argus Camera API或者GStreamer管道的方法,让我的C应用可以正常重启运行。
问题详情
- 期望结果:无需重启系统,就能重启崩溃后的C++相机应用
- 实际情况:应用崩溃后必须重启系统才能再次运行
崩溃后报错日志
(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)
相机初始化相关代码
// 相机类构造函数 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) { } // 构建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(); }
有没有大佬知道怎么在不重启系统的情况下,清理Argus的残留资源或者重启GStreamer管道,让我的应用能正常重启?万分感谢!
备注:内容来源于stack exchange,提问作者Jason Rich Darmawan
相关产品推荐
相关产品推荐

