Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
xuwx1
LightX2V
Commits
4a9f0df5
Unverified
Commit
4a9f0df5
authored
Oct 17, 2025
by
LiangLiu
Committed by
GitHub
Oct 17, 2025
Browse files
Fix send too many frames to socket once (#378)
parent
0b6676a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
lightx2v/deploy/common/va_recorder.py
lightx2v/deploy/common/va_recorder.py
+5
-8
No files found.
lightx2v/deploy/common/va_recorder.py
View file @
4a9f0df5
...
@@ -112,14 +112,11 @@ class VARecorder:
...
@@ -112,14 +112,11 @@ class VARecorder:
break
break
# Convert to numpy and scale to [0, 255], convert RGB to BGR for OpenCV/FFmpeg
# Convert to numpy and scale to [0, 255], convert RGB to BGR for OpenCV/FFmpeg
if
not
self
.
realtime
:
for
i
in
range
(
data
.
shape
[
0
]):
frames
=
(
data
*
255
).
clamp
(
0
,
255
).
to
(
torch
.
uint8
).
cpu
().
numpy
()
t0
=
time
.
time
()
self
.
video_conn
.
send
(
frames
.
tobytes
())
frame
=
(
data
[
i
]
*
255
).
clamp
(
0
,
255
).
to
(
torch
.
uint8
).
cpu
().
numpy
()
else
:
self
.
video_conn
.
send
(
frame
.
tobytes
())
for
i
in
range
(
data
.
shape
[
0
]):
if
self
.
realtime
:
t0
=
time
.
time
()
frame
=
(
data
[
i
]
*
255
).
clamp
(
0
,
255
).
to
(
torch
.
uint8
).
cpu
().
numpy
()
self
.
video_conn
.
send
(
frame
.
tobytes
())
time
.
sleep
(
max
(
0
,
packet_secs
-
(
time
.
time
()
-
t0
)))
time
.
sleep
(
max
(
0
,
packet_secs
-
(
time
.
time
()
-
t0
)))
fail_time
=
0
fail_time
=
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment