Spaces:
Sleeping
Sleeping
fix
Browse files
app.py
CHANGED
@@ -41,9 +41,10 @@ def fn(video: gr.Video):
|
|
41 |
processed_frames.append(frame)
|
42 |
if i % config.yield_frame_steps == 0:
|
43 |
with tempfile.NamedTemporaryFile(suffix='.jpeg') as f:
|
44 |
-
quality =
|
45 |
-
|
46 |
-
|
|
|
47 |
yield f.name, None
|
48 |
processed_clip = ImageSequenceClip(processed_frames, clip.fps)
|
49 |
processed_clip.audio = clip.audio
|
|
|
41 |
processed_frames.append(frame)
|
42 |
if i % config.yield_frame_steps == 0:
|
43 |
with tempfile.NamedTemporaryFile(suffix='.jpeg') as f:
|
44 |
+
quality = 9
|
45 |
+
image_array = cv2.cvtColor(frame, cv2.COLOR_RGB2BGR)
|
46 |
+
_, image_encoded = cv2.imencode('.jpg', image_array, [int(cv2.IMWRITE_JPEG_QUALITY), quality])
|
47 |
+
f.write(image_encoded)
|
48 |
yield f.name, None
|
49 |
processed_clip = ImageSequenceClip(processed_frames, clip.fps)
|
50 |
processed_clip.audio = clip.audio
|