【问题标题】:Cannot capture stream when written from another thread [OpenCV GStreamer C++]从另一个线程写入时无法捕获流 [OpenCV GStreamer C++]
【发布时间】:2021-03-30 21:47:52
【问题描述】:

我有一个程序,可以从 USB 摄像头捕获视频,处理并流式传输到 rtsp udp。我正在将 OpenCV 与 Gstreamer 一起使用。

当我使用主线程写出帧时,我可以使用 gst-launch 毫无问题地捕获它。 但是,当我创建另一个线程来写出框架时,gst-launch 没有任何反应。我知道另一个线程正在运行,因为我能够“显示”该线程中的帧。另外,我确信作者是开放的,因为我在写之前检查了它。

编写器管道:appsrc ! videoconvert ! x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=5015 收件人:gst-launch-1.0 udpsrc port=5015 ! queue ! "application/x-rtp, media=(string)video, encoding-name=(string)H264, framerate=30/1" ! rtph264depay ! decodebin ! videoconvert ! autovideosink

【问题讨论】:

    标签: c++ multithreading opencv gstreamer


    【解决方案1】:

    这已经解决了,和多线程完全无关。它在管道的组成中。 ostream 中没有添加“port”关键字。

    【讨论】:

      猜你喜欢
      • 2020-03-05
      • 2022-01-09
      • 1970-01-01
      • 2010-09-16
      • 1970-01-01
      • 1970-01-01
      • 2020-07-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多