OpenCV / FFMpeg图像捕获问题 [英] OpenCV/FFMpeg image capture problems

查看:330
本文介绍了OpenCV / FFMpeg图像捕获问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从网络摄像机实时捕获图像。该流在VLC中工作得很好,但是OpenCV的 cvQueryFrame()似乎混乱并损坏传入的图像到无法识别的点。

I'm trying to capture images from an IP camera in real time. The stream works perfectly well in VLC, but OpenCV's cvQueryFrame() seems to jumble and corrupt the incoming images to the point of no recognition.

同样,从文件捕获工作正常,但不是实时流。如果它有区别,我使用rtsp连接URL;

Again, capturing from file works fine, but not a live stream. In case it makes a difference, I'm using an rtsp connection URL; I've also tried this with two different camera models (different brands), and the problem remains.

此外,(我假设)编解码器输出多个错误
在MB:1746 错误隐藏6000 DC,6000 AC,6000 MV错误

Besides, the (I'm assuming) codec is outputting several errors of the following kind: Error at MB: 1746 and concealing 6000 DC, 6000 AC, 6000 MV errors.

我可以做什么?

更新:序列总是不能并行化解块类型1,按顺序解码这样的帧

Update 2: 好吧,似乎OpenCV / FFMPEG有一个问题rtsp / h264流。我已尝试使用 Qt Phonon 库,但也无法使用,我已向 Live555 库提供快速概述。这最后似乎工作,在每个人都这样说的意义上,应用示例(OpenRTSP)事实上播放我的流好。然而,说实话,掌握Live555代码似乎是一个漫长的事情,我现在几乎不能承受。除了别的选择,我想我必须去那条路线。

Update 2: Alright, it seems that OpenCV/FFMPEG has an issue with rtsp/h264 streams. I've tried the Qt Phonon library, which also doesn't work, and I've given the Live555 library a quick overview. This last appears to work, in the sense that everyone says it does, and the application example (OpenRTSP) in fact plays my stream well. However, to be quite honest, getting to grips with the Live555 code seems like a lengthy affair which I can hardly afford right now. Barring any other alternative, I guess I'll have to go that route.

有没有其他解决方案?

Is there any other solution that comes to mind?

更新3:我从Live555代码获得测试RTSP客户端工作,所以我知道如何从流中提取h264帧信息,但现在我需要将框架信息重组到实际可显示的框架,这似乎不是什么简单的!任何熟悉Live555的人都知道如何做到这一点?感谢。

Update 3: I got the test RTSP client from the Live555 code to work, so I know how to extract h264 frame information from a stream, but now I need to recombine that frame information into actual displayable frames, which doesn't seem like something straightforward! Anyone familiar with Live555 know how to do this? Thanks.

推荐答案

看来你需要一个额外的软件层来捕获流包并在本地重建帧,到openCV。你可以很容易地实现这一点与libVLC。这也将避免编解码器问题,因为您可以解析几乎所有编解码器与libVLC,然后将原始帧提供给openCV。

It seems you need an extra software layer to capture the stream packets and reconstruct the frames locally, and then feed them to openCV. You can easily achieve this with libVLC. This would also avoid codec problems since you can parse almost all codecs with libVLC and then feed raw frames to openCV.

这篇关于OpenCV / FFMpeg图像捕获问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆