anim_encoder
anim_encoder copied to clipboard
Traceback (most recent call last):
Hi, script RuntimeError when 100 images need packing.
List error:
python anim_encoder.py ani2
ani2 packing, num rects: 2909 num frames: 50
Traceback (most recent call last):
File "anim_encoder.py", line 234, in
RuntimeError is being raised when it falls out with a lot of images.
def allocate(self, w, h):
bh, bw = shape(self.bitmap)
for row in xrange(bh - h + 1):
if self.available_space[row] < w:
continue
for col in xrange(bw - w + 1):
if self.bitmap[row, col] == 0:
if not self.bitmap[row:row+h,col:col+w].any():
self.bitmap[row:row+h,col:col+w] = 1
self.available_space[row:row+h] -= w
self.num_used_rows = max(self.num_used_rows, row + h)
return row, col
raise RuntimeError()
I'm seeing this same error with 45 images on RHEL 7.
There is a constant set in anim_encoder.py
that limits the resulting png to 10,000 lines. It seems your animation has so much content as to not be able to fit within 10,000 vertical lines.
You could try increasing the limit, however the resulting PNG will likely have a rather large filesize if you have that much image data.
@wbond That makes sense; perhaps a parameter or more info in the error message would make sense. The X11-Canvas-Screencast project (https://github.com/rprichard/x11-canvas-screencast/issues/2) makes use of this in order to essentially make videos, so those will probably end up with a large file size as you point out.
https://github.com/sublimehq/anim_encoder/blob/master/anim_encoder.py#L44