我想实现一个使用openCV检测对象的监视服务器。
为此,我为这个工作流设置了一个Ubuntu服务器:
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上,我只有一个绿色窗口,其中没有其他内容。
我将其用于流部分:
...
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)
...也许有人可以给我一些提示,或者需要哪部分代码来帮助我。
发布于 2021-05-19 02:27:23
解算后,源和目标分辨率应相同
https://stackoverflow.com/questions/67588110
复制相似问题