首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何从rtsp中播放.mov

如何从rtsp中播放.mov
EN

Stack Overflow用户
提问于 2015-02-21 09:36:28
回答 1查看 1.1K关注 0票数 1

我试图使用rtsp在.mov文件上使用wifi摄像头播放,我得到了图像,但它到达失真,有时像素有时是绿色的,有时没有错误,当我播放它时,我在bash中得到以下消息:

代码语言:javascript
复制
    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

为了看到相机捕捉到的图像,我用这个

代码语言:javascript
复制
 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做了点错事,非常感谢。

EN

回答 1

Stack Overflow用户

发布于 2019-03-30 11:10:10

如果您收到一个错误,如:

解码MB时出错

qscale diff的cabac解码失败于

左块不可用于请求的帧内模式

再次将您的VideoCapture:

代码语言:javascript
复制
#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)
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28644260

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档