Fixing grid images causing ffmpeg to crash
parent
f48719000f
commit
f933aeb284
|
|
@ -70,7 +70,12 @@ def renderImg2Img(
|
|||
mask=mask_image,
|
||||
)
|
||||
# p.latent_mask = Image.new("RGB", (p.width, p.height), "white")
|
||||
|
||||
|
||||
processed = process_images(p)
|
||||
# For those that use Image grids this will make sure that ffmpeg does not crash out
|
||||
if (processed.images[0].size[0] != processed.images[1].size[0]):
|
||||
processed.images.pop(0)
|
||||
print("\nGrid image detected applying patch")
|
||||
|
||||
newseed = p.seed
|
||||
return processed, newseed
|
||||
|
|
|
|||
|
|
@ -13,9 +13,8 @@ def write_video(file_path, frames, fps, reversed=True, start_frame_dupe_amount=1
|
|||
if reversed == True:
|
||||
frames = frames[::-1]
|
||||
|
||||
# Get dimensions of the first frames, all subsequent has to be same sized
|
||||
for k in frames:
|
||||
assert (k.size == frames[0].size,"Different frame sizes found!")
|
||||
# Drop missformed frames
|
||||
frames = [frame for frame in frames if frame.size == frames[0].size]
|
||||
|
||||
# Create an imageio video writer, avoid block size of 512.
|
||||
writer = imageio.get_writer(file_path, fps=fps, macro_block_size=None)
|
||||
|
|
|
|||
Loading…
Reference in New Issue