tools: add support for nv12 in compressed_vipc (#24962)

reshape for nv12
old-commit-hash: 2027d5311d
This commit is contained in:
Maxime Desroches
2022-06-30 15:03:15 -07:00
committed by GitHub
parent 659b3e345d
commit 4a09ab86ac

View File

@@ -73,6 +73,10 @@ def decoder(addr, sock_name, vipc_server, vst, nvidia):
continue
assert len(frames) == 1
img_yuv = frames[0].to_ndarray(format=av.video.format.VideoFormat('yuv420p')).flatten()
uv_offset = H*W
y = img_yuv[:uv_offset]
uv = img_yuv[uv_offset:].reshape(2, -1).ravel('F')
img_yuv = np.hstack((y, uv))
vipc_server.send(vst, img_yuv.data, cnt, int(time_q[0]*1e9), int(time.monotonic()*1e9))
cnt += 1