Cattura: rimuovi videorate e limita la coda all'ultimo frame
La pipeline GStreamer non forza più la frequenza con videorate e usa un appsink con max-buffers=1, drop e enable-last-sample=false: si elabora solo il frame più recente invece di duplicare frame o accumulare ritardo. Il demone rinnova inoltre l'ultimo frame inviato ogni 10 s quando la sorgente a frequenza variabile non produce nuovi campioni (schermata statica), evitando il timeout del firmware Adalight, e usa time.monotonic per il pacing di invio al posto di time.time.
This commit is contained in:
@@ -79,10 +79,9 @@ class Capture:
|
||||
self.gw = leds * sub
|
||||
self.gh = rows
|
||||
desc = (f"pipewiresrc path={node} do-timestamp=true ! "
|
||||
f"videoconvert ! videoscale ! videorate ! "
|
||||
f"video/x-raw,format=RGB,width={self.gw},height={self.gh},"
|
||||
f"framerate={int(fps)}/1 ! "
|
||||
f"appsink name=sink emit-signals=false max-buffers=2 drop=true sync=false")
|
||||
f"videoconvert ! videoscale ! "
|
||||
f"video/x-raw,format=RGB,width={self.gw},height={self.gh} ! "
|
||||
f"appsink name=sink emit-signals=false max-buffers=1 drop=true sync=false enable-last-sample=false")
|
||||
self.pipe = Gst.parse_launch(desc)
|
||||
self.sink = self.pipe.get_by_name("sink")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user