首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从OpenCV/cv2到nginx服务器的RTMP流,但客户端仅获得绿色窗口

从OpenCV/cv2到nginx服务器的RTMP流,但客户端仅获得绿色窗口
EN

Stack Overflow用户
提问于 2021-05-18 22:16:49
回答 1查看 81关注 0票数 0

我想实现一个使用openCV检测对象的监视服务器。

为此,我为这个工作流设置了一个Ubuntu服务器:

代码语言:javascript
复制
Mobile CAM (from an Android) stream
|
| put the stream with RTMP to server rtmp://nginx/live/in [1]
|
v
nginx with the rtmp plugin
^
|
| the python script gets the mobile CAM stream from nginx rtmp://nginx/live/in [2]
|
v
surveillance script
|
| Stream to output back to rtmp://nginx/live/out with the results [3]
|
v
nginx with the rtmp plugin
^
|
| get the output stream from nginx rtmp://nginx/live/in [4]
|
RTMP stream client

我真的不了解流和RTMP参数。到目前为止,我得到了1和2的工作,所以我有来自移动CAM的视频在来自phython OpenCV脚本的帧中。

在目标客户端4上,我只有一个绿色窗口,其中没有其他内容。

我将其用于流部分:

代码语言:javascript
复制
...
                send_gst = "appsrc ! videoconvert ! video/x-raw,format=I420,clock-rate=90000 ! x264enc ! video/x-h264,stream-format=(string)byte-stream,alignment=(string)au ! h264parse ! queue ! flvmux ! rtmpsink location=rtmp://nginx/live/out"
                writer = cv2.VideoWriter(send_gst, 0, 20, (520, 380), True)
...
        if writer is not None:
                writer.write(frame)
...

也许有人可以给我一些提示,或者需要哪部分代码来帮助我。

EN

回答 1

Stack Overflow用户

发布于 2021-05-19 02:27:23

解算后,源和目标分辨率应相同

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67588110

复制
相关文章

相似问题

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