bartekmotyl / simple-video-cutter

Windows-based tool for efficient browsing and cutting video footage
MIT License
317 stars 42 forks source link

Unhandled exception when scrubbing timeline through videos shorter than 3 seconds #69

Closed danieljimeneznz closed 1 year ago

danieljimeneznz commented 1 year ago

Hi - firstly love this tool, super useful at cutting down content for ML. I receive the following error when attempting to cut videos shorter than 3 seconds:

System.OverflowException: Negating the minimum value of a twos complement number is invalid.
   at System.Math.AbsHelper(Int64 value)
   at SimpleVideoCutter.VideoCutterTimeline.LocateNearestKeyFrame(Int64 position)
   at SimpleVideoCutter.VideoCutterTimeline.FindNearestAcceptableKeyFrame(Int64 position)
   at SimpleVideoCutter.VideoCutterTimeline.NormalizeMouseEventX(Int32 x)
   at SimpleVideoCutter.VideoCutterTimeline.VideoCutterTimeline_MouseMove(Object sender, MouseEventArgs e)
   at System.Windows.Forms.Control.OnMouseMove(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseMove(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.UserControl.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

When pressing Continue on this dialog the application continues to function as expected, it's just annoying because this popup comes up a fair amount and can probably just be caught and ignored.

bartekmotyl commented 1 year ago

Hi, thanks for reporting. Would it be possible to provide a sample video to reproduce the problem?

danieljimeneznz commented 1 year ago

Let me know if this doesn't work for you. If you click on the timeline scrubber at about the first frame then the error should popup.

https://user-images.githubusercontent.com/13009825/198906934-0bd1ef70-68f5-41ca-b590-5bc937d2f9f3.mp4

bartekmotyl commented 1 year ago

Fixed in development branch, fix will be included in next release.