Closed azsde closed 1 year ago
To use the latest Camera v3 from Raspberry Pi, we need to use libcamerify which is a V4L2 compatibility layer preload.
libcamerify -d v4l2rtspserver
I don't know if it is due to libcamerify, but sometimes the camera seems to be temporary unavailable:
[NOTICE] /home/azsde/v4l2rtspserver/src/V4L2DeviceSource.cpp:203 V4L2DeviceSource::getNextFrame errno:11 Resource temporarily unavailable [ERROR] /home/azsde/v4l2rtspserver/src/V4L2DeviceSource.cpp:111 error:Resource temporarily unavailable [NOTICE] /home/azsde/v4l2rtspserver/src/V4L2DeviceSource.cpp:122
This causes v4l2rtspserver to hang indefinitely.
Looking into the code, it seems that if V4L2DeviceSource cannot get the next frame, it will stop the thread in charge of fetching the the frames:
// V4L2DeviceSource.cpp:L109 // ... if (this->getNextFrame() <= 0) { LOG(ERROR) << "error:" << strerror(errno); stop=1; }
Maybe checking for the errno value before setting stop to 1 would allow to keep on trying ?
To use the latest Camera v3 from Raspberry Pi, we need to use libcamerify which is a V4L2 compatibility layer preload.
libcamerify -d v4l2rtspserver
I don't know if it is due to libcamerify, but sometimes the camera seems to be temporary unavailable:
This causes v4l2rtspserver to hang indefinitely.
Looking into the code, it seems that if V4L2DeviceSource cannot get the next frame, it will stop the thread in charge of fetching the the frames:
Maybe checking for the errno value before setting stop to 1 would allow to keep on trying ?