encoderd: make work on PC (#24483)

* don't use the codec in video_writer

* this produces broken videos for some reason

* bugfix

* refactor on the class

* works on device

* fix codec

* no codec enum

* fix pc

* move into dirs

* these includes also

* rename it ffmpegencoder

* add avcodec_close

Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
George Hotz
2022-05-10 15:20:51 -07:00
committed by GitHub
parent 01ab99d416
commit 2008db47c2
19 changed files with 279 additions and 218 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ def decoder(addr, sock_name, vipc_server, vst, nvidia):
assert len(frames) == 1
img_yuv = frames[0].to_ndarray(format=av.video.format.VideoFormat('yuv420p'))
vipc_server.send(vst, img_yuv.flatten().data, cnt, 0, 0)
vipc_server.send(vst, img_yuv.flatten().data, cnt, cnt*1e9/20, cnt*1e9/20)
cnt += 1
pc_latency = (time.monotonic()-time_q[0])*1000