mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-05 21:42:05 +08:00
tools: add support for nv12 in compressed_vipc (#24962)
reshape for nv12 old-commit-hash: 2027d5311d419addfb67ad94d45a198592b2e459
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user