forked from floratest1/SpireCV
fix video reading skipping
This commit is contained in:
@@ -72,18 +72,20 @@ void Camera::openImpl()
|
||||
this->_fps = 30;
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_JETSON
|
||||
sprintf(pipe, "rtspsrc location=rtsp://%s:%d/H264?W=%d&H=%d&FPS=%d&BR=4000000 latency=100 ! \
|
||||
application/x-rtp,media=video ! rtph264depay ! parsebin ! nvv4l2decoder enable-max-performancegst=1 ! \
|
||||
nvvidconv ! video/x-raw,format=(string)BGRx ! videoconvert ! appsink sync=false",
|
||||
this->_ip.c_str(), this->_port, this->_width, this->_height, this->_fps);
|
||||
#else
|
||||
#if defined(PLATFORM_X86_CUDA) || defined(PLATFORM_X86_INTEL)
|
||||
sprintf(pipe, "rtspsrc location=rtsp://%s:%d/H264?W=%d&H=%d&FPS=%d&BR=4000000 latency=100 ! \
|
||||
application/x-rtp,media=video ! rtph264depay ! parsebin ! avdec_h264 ! \
|
||||
videoconvert ! appsink sync=false",
|
||||
this->_ip.c_str(), this->_port, this->_width, this->_height, this->_fps);
|
||||
#endif
|
||||
printf("%s\r\n",pipe);
|
||||
#ifdef PLATFORM_JETSON
|
||||
sprintf(pipe, "rtspsrc location=rtsp://%s:%d/H264?W=%d&H=%d&FPS=%d&BR=4000000 latency=100 ! \
|
||||
application/x-rtp,media=video ! rtph264depay ! parsebin ! nvv4l2decoder enable-max-performancegst=1 ! \
|
||||
nvvidconv ! video/x-raw,format=(string)BGRx ! videoconvert ! appsink sync=false",
|
||||
this->_ip.c_str(), this->_port, this->_width, this->_height, this->_fps);
|
||||
#endif
|
||||
|
||||
// printf("%s\r\n",pipe);
|
||||
this->_cap.open(pipe, cv::CAP_GSTREAMER);
|
||||
}
|
||||
else if (this->_type == CameraType::GX40)
|
||||
@@ -98,7 +100,7 @@ void Camera::openImpl()
|
||||
{
|
||||
this->_port = 554;
|
||||
}
|
||||
#ifdef PLATFORM_X86_CUDA
|
||||
#if defined(PLATFORM_X86_CUDA) || defined(PLATFORM_X86_INTEL)
|
||||
camera_url << "rtspsrc location = rtsp://user:0000@" << this->_ip << ":" << this->_port
|
||||
<< "/cam/realmonitor?channel=1&subtype=0 latency=100 ! application/x-rtp,media=video ! \
|
||||
rtph265depay ! parsebin ! avdec_h265 ! videoscale ! video/x-raw,width=(int)" << this->_width
|
||||
@@ -150,9 +152,12 @@ void Camera::openImpl()
|
||||
this->_fps = 30;
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_X86_CUDA
|
||||
sprintf(pipe, "%s?W=%d&H=%d&FPS=%d", this->_rtsp_url.c_str(), this->_width, this->_height, this->_fps);
|
||||
this->_cap.open(pipe);
|
||||
#if defined(PLATFORM_X86_CUDA) || defined(PLATFORM_X86_INTEL)
|
||||
sprintf(pipe, "rtspsrc location=%s?W=%d&H=%d&FPS=%d latency=100 ! \
|
||||
application/x-rtp,media=video ! rtph264depay ! parsebin ! avdec_h264 ! \
|
||||
videoconvert ! appsink sync=false",
|
||||
this->_rtsp_url.c_str(), this->_width, this->_height, this->_fps);
|
||||
this->_cap.open(pipe, cv::CAP_GSTREAMER);
|
||||
#endif
|
||||
#ifdef PLATFORM_JETSON
|
||||
sprintf(pipe, "rtspsrc location=%s?W=%d&H=%d&FPS=%d latency=100 ! application/x-rtp,media=video ! rtph264depay ! parsebin ! nvv4l2decoder enable-max-performancegst=1 ! nvvidconv ! video/x-raw,format=(string)BGRx ! videoconvert ! appsink sync=false", this->_rtsp_url.c_str(), this->_width, this->_height, this->_fps);
|
||||
|
||||
Reference in New Issue
Block a user