我试图使用rtsp在.mov文件上使用wifi摄像头播放,我得到了图像,但它到达失真,有时像素有时是绿色的,有时没有错误,当我播放它时,我在bash中得到以下消息:
left block unavailable for requested intra mode at 0 29
[h264 @ 0x1e5af00] error while decoding MB 0 29, bytestream (-1)
[h264 @ 0x1e5b4c0] left block unavailable for requested intra mode at 0 29
[h264 @ 0x1e5b4c0] error while decoding MB 0 29, bytestream (-1)
[h264 @ 0x1e56900] left block unavailable for requested intra mode at 0 28
[h264 @ 0x1e56900] error while decoding MB 0 28, bytestream (-1)
[h264 @ 0x1e56900] left block unavailable for requested intra mode at 0 28
[h264 @ 0x1e56900] error while decoding MB 0 28, bytestream (-1)
[h264 @ 0x1ef56e0] left block unavailable for requested intra mode at 0 29
[h264 @ 0x1ef56e0] error while decoding MB 0 29, bytestream (-1)
[h264 @ 0x1e5af00] left block unavailable for requested intra mode at 0 19为了看到相机捕捉到的图像,我用这个
cv::VideoCapture capture("rtsp://192.168.1.254/sjcam.mov");
if (!capture.isOpened()) {
//Error
}
cv::namedWindow("TEST", CV_WINDOW_AUTOSIZE);
cv::Mat frame;
for(int i =0; i<50000;i++) {
if (!capture.read(frame)) {
//Error
}
cv::imshow("TEST", frame);
cv::waitKey(30);
}我不知道我还能做什么,也不知道问题出在哪里,我试着用opencv播放.mov视频,而且没有问题,所以我想我对rtsp做了点错事,非常感谢。
发布于 2019-03-30 11:10:10
如果您收到一个错误,如::
解码MB时出错
qscale diff的cabac解码失败于
左块不可用于请求的帧内模式
再次将您的VideoCapture:
#python
import cv2
address = "rtsp://login:pass@10.0.4.102:554/live/main"
cap = cv2.VideoCapture(address)
while (True):
ret, image_np = cap.read()
if ret:
cv2.imwrite("image.jpg", image_np)
else:
cap = cv2.VideoCapture(address)https://stackoverflow.com/questions/28644260
复制相似问题