goryhon commited on
Commit
d3bbd0d
·
verified ·
1 Parent(s): ecf9c16

Update web-demos/hugging_face/app.py

Browse files
Files changed (1) hide show
  1. web-demos/hugging_face/app.py +2 -2
web-demos/hugging_face/app.py CHANGED
@@ -416,9 +416,9 @@ def generate_video_from_frames(frames, output_path, fps=30, bitrate=None):
416
  #torchvision.io.write_video(output_path, frames, fps=fps, video_codec="libx264")
417
  #return output_path
418
  if bitrate is not None:
419
- writer = imageio.get_writer(output_path, fps=fps, codec='libx264', bitrate=bitrate)
420
  else:
421
- writer = imageio.get_writer(output_path, fps=fps, codec='libx264')
422
  for frame in frames:
423
  writer.append_data(frame.astype(np.uint8))
424
  writer.close()
 
416
  #torchvision.io.write_video(output_path, frames, fps=fps, video_codec="libx264")
417
  #return output_path
418
  if bitrate is not None:
419
+ writer = imageio.get_writer(output_path, fps=fps, codec='libx264', bitrate=bitrate, macro_block_size=None,)
420
  else:
421
+ writer = imageio.get_writer(output_path, fps=fps, codec='libx264', macro_block_size=None)
422
  for frame in frames:
423
  writer.append_data(frame.astype(np.uint8))
424
  writer.close()