LeGoffMael / video_editor

A flutter package for editing video written in pure Dart with fully customizable UI. Supports crop, trim, rotation and cover selection.
https://pub.dev/packages/video_editor
MIT License
403 stars 242 forks source link

[ App crash ]. Unsupported operation: Infinity or NaN toInt. #165

Open XeroDays opened 1 year ago

XeroDays commented 1 year ago

Crashlytics logs are attached

Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Unsupported operation: Infinity or NaN toInt. Error thrown Instance of 'ErrorDescription'.
       at VideoEditorController.updateTrim(controller.dart)
       at _TrimSliderState._updateControllerTrim(trim_slider.dart:481)
       at _TrimSliderState._changeTrimRect(trim_slider.dart:430)
       at _TrimSliderState._onHorizontalDragUpdate(trim_slider.dart:348)
       at DragGestureRecognizer._checkUpdate.<fn>(monodrag.dart:483)
       at GestureRecognizer.invokeCallback(recognizer.dart:253)
       at DragGestureRecognizer._checkUpdate(monodrag.dart:483)
       at DragGestureRecognizer.handleEvent(monodrag.dart:330)
       at PointerRouter._dispatch(pointer_router.dart:98)
       at PointerRouter._dispatchEventToRoutes.<fn>(pointer_router.dart:143)
       at _LinkedHashMapMixin.forEach(dart:collection)
       at PointerRouter._dispatchEventToRoutes(pointer_router.dart:141)
       at PointerRouter.route(pointer_router.dart:127)
       at GestureBinding.handleEvent(binding.dart:460)
       at GestureBinding.dispatchEvent(binding.dart:440)
       at RendererBinding.dispatchEvent(binding.dart:336)
       at GestureBinding._handlePointerEventImmediately(binding.dart:395)
       at GestureBinding.handlePointerEvent(binding.dart:357)
       at GestureBinding._flushPointerEventQueue(binding.dart:314)
       at GestureBinding._handlePointerDataPacket(binding.dart:295)
Megatronicus commented 1 year ago

Why isn't he answering at all, this is from Aug 19. I just got a crash too.

XeroDays commented 1 year ago

i wanted to use the trimmer feature, so to solve this issue, i have used other dependency named as "Video_Trimmer". you can use that. He's not responding!

Megatronicus commented 1 year ago

Thanks for answering since the author won't. Thanks for the advice as well! I'll try video_trimmer then =) Best regards bro =)

LeGoffMael commented 1 year ago

Hello, sorry for late reply. Could you provide more information and a way to reproduce this error ? Without more information it is difficult to help you. If you could tell me the environment your using and provide me a video which lead to the error that would be great

XeroDays commented 1 year ago

Okay so... We were using only the trimming feature of the plugin. When the video is imported to it there is some nullable value in the Trimmer handles which is not able to calculate.. Seems like zero value is divided by a number.. or Integer to Double conversion failure.. i didn't have time that day so i removed the whole plugin.

I am not sure how you can recreate it exactly but try:

  1. Add 5-second video when the minimum is set to 3 seconds.
  2. adding 60-second video with a maximum video length value set to 90 seconds.

Fluttter version : 3.7.12

LeGoffMael commented 1 year ago

what platform ? android / ios ?

Do you remember trying to use the example app of the package and being able to reproduce the error ?

XeroDays commented 1 year ago

Platform: Android

Actually Example app is not used, but I copied the code of it..
Let me check if I can recreate it..