Fixing grid images causing ffmpeg to crash

exit_image_GL
jmsether 2023-04-23 03:46:11 -06:00 committed by Charles Fettinger
parent 02f5625e6e
commit 2808d1f00b
2 changed files with 8 additions and 4 deletions

View File

@ -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

View File

@ -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)