相关疑难解决方法(0)

MJPEG流媒体和解码

我想从IP摄像头(通过RTSP)接收JPEG图像.为此,我cvCreateFileCapture_FFMPEG在OpenCV中尝试过.但是ffmpeg似乎对流媒体的MJPEG格式有一些问题(因为它会自动尝试检测流媒体信息)并且我最终得到以下错误

mjpeg: unsupported coding type
Run Code Online (Sandbox Code Playgroud)

然后,我决定使用live555进行流媒体播放.到目前为止,我可以通过openRTSP成功建立流媒体和捕获(非解码)图像.

问题是如何在我的应用程序中执行此操作,例如,在OpenCV中.如何在OpenCV中使用openRTSP获取图像并以JPEG格式保存?

我听说openRTSP中的数据可以发送到缓冲区(或命名管道),然后在OpenCV中读取IplImage.但我不知道该怎么做.

我将非常感谢有关此问题的任何帮助/建议.我需要以下任一问题的答案:

  1. 如何禁用ffmpeg的自动流信息检测并指定我自己的格式(mjpeg),或
  2. 如何在OpenCV中使用openRTSP?

问候,

c++ opencv mjpeg rtsp live555

16
推荐指数
1
解决办法
3万
查看次数

python的gst.LinkError问题的Gstreamer

我正在使用Python连接gstreamer应用程序.我得到一个LinkError与以下代码:

import pygst
pygst.require('0.10')
import gst

import pygtk
pygtk.require('2.0')
import gtk

# this is very important, without this, callbacks from gstreamer thread
# will messed our program up
gtk.gdk.threads_init()

def main():
    pipeline = gst.Pipeline('pipleline')

    filesrc = gst.element_factory_make("filesrc", "filesrc")
    filesrc.set_property('location', 'C:/a.mp3')

    decode = gst.element_factory_make("decodebin", "decode")

    convert = gst.element_factory_make('audioconvert', 'convert')

    sink = gst.element_factory_make("autoaudiosink", "sink")

    pipeline.add(filesrc, decode, convert, sink)
    gst.element_link_many(filesrc, decode, convert, sink)

    pipeline.set_state(gst.STATE_PLAYING)

    gtk.main()

main()
Run Code Online (Sandbox Code Playgroud)

而错误:

ImportError: could not import gio
Traceback (most recent call last):
  File "H:\workspace\ggg\src\test2.py", line 37, in <module> …
Run Code Online (Sandbox Code Playgroud)

python gstreamer

10
推荐指数
1
解决办法
4457
查看次数

标签 统计

c++ ×1

gstreamer ×1

live555 ×1

mjpeg ×1

opencv ×1

python ×1

rtsp ×1