发送protobuf数据给Stream的输入元件(appsrc),使用接口需要安装4.25.2版本的protobuf,安装命令为pip3 install protobuf-4.25.2。
1 2 | def SendProtobuf(streamName: bytes, inPluginId: int, protobufVec: list) -> int: pass |
1 2 | def SendProtobuf(streamName: bytes, elementName: bytes, protobufVec: list) -> int: pass |
参数名 |
类型 |
说明 |
---|---|---|
streamName |
bytes |
流的名称。 |
inPluginId |
int |
输入插件ID,即appsrc元件的编号。 |
protobufVec |
MxProtobufIn list |
发送的MxProtobufIn列表,将protobuf的key、type、value发给mxStream,其中value是将protobuf序列化后的bytes。 |
elementName |
bytes |
输入插件的名称,只支持appsrc当做输入插件。 |
数据结构 |
说明 |
---|---|
int |
程序执行返回的错误码,请参考APP_ERROR说明。 |