screenrecorder
screenrecorder copied to clipboard
error while exporting gif
Is there an existing issue for this?
- [X] I have searched the existing issues
Package/Plugin version
0.3.0
Platforms
- [ ] Android
- [X] iOS
- [ ] Linux
- [ ] MacOS
- [ ] Web
- [ ] Windows
Flutter doctor
[✓] Flutter (Channel stable, 3.24.0, on macOS 14.5 23F79 darwin-arm64, locale en-IN) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 16.0) [✓] Chrome - develop for the web [✓] Android Studio (version 2024.1) [✓] Android Studio (version 2023.2) [✓] VS Code (version 1.92.2) [✓] Connected device (5 available) [✓] Network resources
• No issues found!
Minimal code example
var gif = await controller.exporter.exportGif(); if (gif == null) { throw Exception(); }
Current Behavior
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: RangeError (length): Invalid value: Not in inclusive range 0..255: 65423 #0 Int32List.[] (dart:typed_data-patch/typed_data_patch.dart) #1 NeuralQuantizer._inxSearch (package:image/src/util/neural_quantizer.dart:141:22) #2 NeuralQuantizer.getColorIndex (package:image/src/util/neural_quantizer.dart:68:12) #3 Quantizer.getIndexImage (package:image/src/util/quantizer.dart:36:14) #4 ditherImage (package:image/src/filter/dither_image.dart:69:22) #5 quantize (package:image/src/filter/quantize.dart:26:10) #6 Exporter._encodeGifWIthTransparency (package:screen_recorder/src/exporter.dart:109:28) #7 Exporter._exportGif (package:screen_recorder/src/exporter.dart:79:9)
Expected Behavior
it should generate the gif like in android
Steps To Reproduce
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: RangeError (length): Invalid value: Not in inclusive range 0..255: 65423 #0 Int32List.[] (dart:typed_data-patch/typed_data_patch.dart) #1 NeuralQuantizer._inxSearch (package:image/src/util/neural_quantizer.dart:141:22) #2 NeuralQuantizer.getColorIndex (package:image/src/util/neural_quantizer.dart:68:12) #3 Quantizer.getIndexImage (package:image/src/util/quantizer.dart:36:14) #4 ditherImage (package:image/src/filter/dither_image.dart:69:22) #5 quantize (package:image/src/filter/quantize.dart:26:10) #6 Exporter._encodeGifWIthTransparency (package:screen_recorder/src/exporter.dart:109:28) #7 Exporter._exportGif (package:screen_recorder/src/exporter.dart:79:9)
Aditional information
No response
I'm facing a similar issue. I'm recording the camera view. Everything works fine on the emulator, but I'm getting errors on a real device.
Problems with platform views are a known issue: https://github.com/Baseflow/screenrecorder?tab=readme-ov-file#%EF%B8%8F-known-issues-and-limitations It's nothing this library can fix, since it's a limitation of Flutter itself.
@ueman I agree with your point, however, I still maintain that the package is buggy when running on a real device. I've verified this by downloading the example provided by the package. It still exhibits the same error, whereas the emulator works fine. I'm tesed on Iphon 12 Pro.
@bhatakeed @ueman After several hours, I discovered that the issue lies in the image format of the iPhone. Images captured from the iPhone return in a 64-bit color image format. Meanwhile, the image package that the library depends on only supports 32-bit color. I have fixed this in a this pull request #47 .
when will it be released?
@Jaew00Shin my PR invalid lint rule of repo. However, I'm quiet busy to debug and fix. So U can ref to my repo to apply.
Same bug here. This package is unusable on iOS (didn't test other platforms). The example code fails on exportGif with this error:
RangeError (RangeError (length): Invalid value: Not in inclusive range 0..255: 10280)