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='libx264', bitrate=bitrate, macro_block_size=None,)
|
423 |
else:
|
424 |
+
writer = imageio.get_writer(output_path, fps=fps, codec='libx264', macro_block_size=None)
|
425 |
for frame in frames:
|
426 |
writer.append_data(frame.astype(np.uint8))
|
427 |
writer.close()
|