Spaces:
Paused
Paused
Update web-demos/hugging_face/app.py
Browse files
web-demos/hugging_face/app.py
CHANGED
@@ -419,9 +419,9 @@ def generate_video_from_frames(frames, output_path, fps=30, bitrate=None):
|
|
419 |
#torchvision.io.write_video(output_path, frames, fps=fps, video_codec="libx264")
|
420 |
#return output_path
|
421 |
if bitrate is not None:
|
422 |
-
writer = imageio.get_writer(output_path, fps=fps, codec='
|
423 |
else:
|
424 |
-
writer = imageio.get_writer(output_path, fps=fps, codec='
|
425 |
for frame in frames:
|
426 |
writer.append_data(frame.astype(np.uint8))
|
427 |
writer.close()
|
|
|
419 |
#torchvision.io.write_video(output_path, frames, fps=fps, video_codec="libx264")
|
420 |
#return output_path
|
421 |
if bitrate is not None:
|
422 |
+
writer = imageio.get_writer(output_path, fps=fps, codec='libx264rgb', quality=None, output_params=['-crf', '0', '-preset', 'veryslow', '-pix_fmt', 'rgb24']
|
423 |
else:
|
424 |
+
writer = imageio.get_writer(output_path, fps=fps, codec='libx264rgb', quality=None, output_params=['-crf', '0', '-preset', 'veryslow', '-pix_fmt', 'rgb24']
|
425 |
for frame in frames:
|
426 |
writer.append_data(frame.astype(np.uint8))
|
427 |
writer.close()
|