Previous response had warnings:
WARNINGS: - Extra text detected before JSON object
- Extra text detected after JSON object

New Terminal Output:

root@d7299c7f5982:/app# python3 -c "
> import struct
> with open('/app/frames.tza', 'rb') as f:
>     magic = f.read(4)
>     width, height = struct.unpack('<HH', f.read(4))
>     n_frames, max_bytes = struct.unpack('<II', f.read(8))
>     frames = [f.read(width * height) for _ in range(n_frames)]
>
> prev = b' ' * (width * height)
> row_change_counts = [0] * height
> for frame in frames:
>     for r in range(height):
>         row_start = r * width
>         if any(prev[row_start + c] != frame[row_start + c] for c in range(width)):
>             row_change_counts[r] += 1
>     prev = frame
>
> print('Rows with changes:')
> for r, count in enumerate(row_change_counts):
>     if count > 0:
>         print(f'  Row {r}: {count} frames')
> print(f'\nTotal budget: {max_bytes}')
> print(f'Frame delimiters: {n_frames} bytes')
> print(f'Remaining for content: {max_bytes - n_frames} bytes')
> "
Rows with changes:
  Row 0: 1 frames
  Row 1: 1200 frames
  Row 2: 300 frames
  Row 3: 300 frames
  Row 4: 300 frames
  Row 5: 300 frames
  Row 6: 300 frames
  Row 7: 300 frames
  Row 8: 300 frames
  Row 9: 300 frames
  Row 10: 300 frames
  Row 11: 300 frames
  Row 12: 1 frames
  Row 13: 172 frames
  Row 14: 172 frames
  Row 15: 172 frames
  Row 16: 172 frames
  Row 17: 172 frames
  Row 18: 172 frames
  Row 19: 172 frames
  Row 20: 172 frames
  Row 21: 172 frames
  Row 22: 197 frames
  Row 23: 1 frames

Total budget: 69000
Frame delimiters: 1200 bytes
Remaining for content: 67800 bytes
root@d7299c7f5982:/app#
