mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-21 01:02:48 +08:00
little tools fix ups (#24629)
old-commit-hash: b8a32bbc461fea1f15ef7db8021f1aa8f85f7df7
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f4bb4ced832362110425c44be57697aea70341d28bf0e31224055d8d5a77e020
|
||||
size 1528
|
||||
oid sha256:12f6907e668c156923e91d839b5d499c488f6c7d7187eb4ca111a3dd9309a06d
|
||||
size 1537
|
||||
|
||||
Generated
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f551f1bb33b10ff9a345e6c5a7899d7e2669dd073f85cceac53f193514b3eac6
|
||||
size 155990
|
||||
oid sha256:2068db760c810de51d26adc077dcff5b203e99d84a24e3d62edd747a35806c23
|
||||
size 163899
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import av
|
||||
import os
|
||||
os.environ["NV_LOW_LATENCY"] = "3" # both bLowLatency and CUVID_PKT_ENDOFPICTURE
|
||||
import sys
|
||||
import argparse
|
||||
import numpy as np
|
||||
@@ -16,6 +16,7 @@ V4L2_BUF_FLAG_KEYFRAME = 8
|
||||
def decoder(addr, sock_name, vipc_server, vst, nvidia):
|
||||
print("start decoder for %s" % sock_name)
|
||||
if nvidia:
|
||||
os.environ["NV_LOW_LATENCY"] = "3" # both bLowLatency and CUVID_PKT_ENDOFPICTURE
|
||||
sys.path += os.environ["LD_LIBRARY_PATH"].split(":")
|
||||
import PyNvCodec as nvc # pylint: disable=import-error
|
||||
|
||||
@@ -25,7 +26,6 @@ def decoder(addr, sock_name, vipc_server, vst, nvidia):
|
||||
nvDwn_yuv = nvc.PySurfaceDownloader(W, H, nvc.PixelFormat.YUV420, 0)
|
||||
img_yuv = np.ndarray((H*W//2*3), dtype=np.uint8)
|
||||
else:
|
||||
import av # pylint: disable=import-error
|
||||
codec = av.CodecContext.create("hevc", "r")
|
||||
|
||||
os.environ["ZMQ"] = "1"
|
||||
@@ -82,9 +82,9 @@ def decoder(addr, sock_name, vipc_server, vst, nvidia):
|
||||
print("%2d %4d %.3f %.3f roll %6.2f ms latency %6.2f ms + %6.2f ms + %6.2f ms = %6.2f ms" % (len(msgs), evta.idx.encodeId, evt.logMonoTime/1e9, evta.idx.timestampEof/1e6, frame_latency, process_latency, network_latency, pc_latency, process_latency+network_latency+pc_latency ), len(evta.data), sock_name)
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description='Decode video streams and broacast on VisionIPC')
|
||||
parser.add_argument("addr", help="Address of comma 3")
|
||||
parser.add_argument('--nvidia', action='store_true', help='Use nvidia instead of ffmpeg')
|
||||
parser = argparse.ArgumentParser(description="Decode video streams and broacast on VisionIPC")
|
||||
parser.add_argument("addr", help="Address of comma three")
|
||||
parser.add_argument("--nvidia", action="store_true", help="Use nvidia instead of ffmpeg")
|
||||
parser.add_argument("--cams", default="0,1,2", help="Cameras to decode")
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
Regular → Executable
+1
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import json
|
||||
import matplotlib.patches as mpatches
|
||||
|
||||
Reference in New Issue
Block a user