看到
不知道怎么将上文的
import numpy
#读取420 * 360 * 3字节(= 1帧)
raw_image = pipe.stdout.read(420*360*3)
#将读取的字节转换为numpy数组
image = numpy.fromstring(raw_image, dtype='uint8')
image = image.reshape((360,420,3))
#丢弃管道缓冲区中的数据。
pipe.stdout.flush()
转成 node 代码
自己尝试 spawn
的 subprocess.stdout.read(size)
总是返回 null
node 怎么向上面读取固定大小的数据,而且最好是流式的
https://github.com/fluent-ffm... 有现成的类库已经帮你封装好了