Skip to content

Commit a400d92

Browse files
author
arch
committed
fixes for ffmpeg v5
1 parent 03f9234 commit a400d92

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

funscript_editor/data/ffmpegstream.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def get_projection(
187187
'-'
188188
]
189189

190-
# print('cmd', command)
190+
# print('cmd:', ' '.join(command))
191191
pipe = sp.Popen(
192192
command,
193193
stdin = sp.PIPE,
@@ -196,6 +196,8 @@ def get_projection(
196196
)
197197

198198
pipe.stdin.write(frame.tobytes())
199+
try: pipe.stdin.close()
200+
except: pass
199201
projection = np.frombuffer(
200202
pipe.stdout.read(config['parameter']['width'] * width_factor * config['parameter']['height'] * height_factor * 3),
201203
dtype='uint8'
@@ -336,6 +338,7 @@ def get_frame(
336338
'-ss', str(seek),
337339
'-hwaccel', 'auto',
338340
'-i', video_path,
341+
'-vframes', '1',
339342
'-f', 'image2pipe',
340343
'-pix_fmt', 'bgr24',
341344
'-vsync', 'passthrough',
@@ -345,6 +348,7 @@ def get_frame(
345348
'-'
346349
]
347350

351+
# print('cmd:', ' '.join(command))
348352
pipe = sp.Popen(
349353
command,
350354
stdout = sp.PIPE,

0 commit comments

Comments
 (0)