【问题标题】:How to play a .mov from a rtsp如何从 rtsp 播放 .mov
【发布时间】:2015-04-23 00:48:54
【问题描述】:

我正在尝试从使用 rtsp 流式传输 .mov 文件的 wifi 摄像头播放,我得到了图像,但它到达时失真,有时像素化,有时绿色,有时没有错误,当我播放它时,我收到以下消息狂欢:

    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 上做错了什么 非常感谢

【问题讨论】:

  • 问题部分解决了,如果您使用 libvlc,您可以延迟获取图像,但不会失真,如果您遇到问题可以问我

标签: opencv video stream rtp


【解决方案1】:

如果您收到如下错误:

解码 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)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-06-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多