[GH-ISSUE #637] Crash when trying to save a video using the system encoder #2122

Closed
opened 2026-03-01 18:53:15 +03:00 by kerem · 0 comments
Owner

Originally created by @Swandog on GitHub (Apr 13, 2020).
Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/637

Hi. I was trying to save a recording as video using the system encoder, and ScreenToGif crashed almost immediately, and made a 0 byte AVI file.

Based on another issue I read, I went searching through the Windows Events, and I believe this is the crash event:

- <System>
  <Provider Name=".NET Runtime" /> 
  <EventID Qualifiers="0">1026</EventID> 
  <Level>2</Level> 
  <Task>0</Task> 
  <Keywords>0x80000000000000</Keywords> 
  <TimeCreated SystemTime="2020-04-13T20:53:57.894348600Z" /> 
  <EventRecordID>12312</EventRecordID> 
  <Channel>Application</Channel> 
  <Computer>DESKTOP-CDANMI9</Computer> 
  <Security /> 
  </System>
- <EventData>
  <Data>Application: ScreenToGif.exe Framework Version: v4.0.30319 
    Description: The process was terminated due to an unhandled exception. 

    Exception Info: System.AccessViolationException 
        at ScreenToGif.ImageUtil.Video.AviWriter.AVISaveOptions(IntPtr, UInt32, Int32, IntPtr[], IntPtr[]) 
        at ScreenToGif.ImageUtil.Video.AviWriter..ctor(System.String, Int32, Int32, Int32, UInt32) 
        at ScreenToGif.Windows.Other.Encoder+<Encode>d__24.MoveNext() 
        at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[[ScreenToGif.Windows.Other.Encoder+<Encode>d__24, ScreenToGif, Version=2.23.1.0, Culture=neutral, PublicKeyToken=null]](<Encode>d__24 ByRef) 
        at ScreenToGif.Windows.Other.Encoder.Encode(System.Collections.Generic.List`1<ScreenToGif.Model.FrameInfo>, Int32, ScreenToGif.Util.Parameters, System.Threading.CancellationTokenSource) 
        at ScreenToGif.Windows.Other.Encoder+<>c__DisplayClass13_0.<InternalAddItem>b__0() 
        at System.Threading.Tasks.Task.Execute() 
        at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 
        at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 
        at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef) 
        at System.Threading.Tasks.Task.ExecuteEntry(Boolean) 
        at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 
        at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 
        at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) 
        at System.Threading.ThreadHelper.ThreadStart(System.Object)</Data> 
  </EventData>
  </Event>

I originally created the project in 2.17.1 (the Portable version), and I saw this issue. I tried downloading 2.23.1 (again, the Portable version), and saw the same problem.

Saving via gif works okay. I haven't tried ffmpeg because I don't have it installed, yet.

Let me know what I can do to help. I'm a programmer myself, but I've never worked in .NET and rarely on Windows, so I'll be new to this.

Originally created by @Swandog on GitHub (Apr 13, 2020). Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/637 Hi. I was trying to save a recording as video using the system encoder, and ScreenToGif crashed almost immediately, and made a 0 byte AVI file. Based on another issue I read, I went searching through the Windows Events, and I believe this is the crash event: ```- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"> - <System> <Provider Name=".NET Runtime" /> <EventID Qualifiers="0">1026</EventID> <Level>2</Level> <Task>0</Task> <Keywords>0x80000000000000</Keywords> <TimeCreated SystemTime="2020-04-13T20:53:57.894348600Z" /> <EventRecordID>12312</EventRecordID> <Channel>Application</Channel> <Computer>DESKTOP-CDANMI9</Computer> <Security /> </System> - <EventData> <Data>Application: ScreenToGif.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.AccessViolationException at ScreenToGif.ImageUtil.Video.AviWriter.AVISaveOptions(IntPtr, UInt32, Int32, IntPtr[], IntPtr[]) at ScreenToGif.ImageUtil.Video.AviWriter..ctor(System.String, Int32, Int32, Int32, UInt32) at ScreenToGif.Windows.Other.Encoder+<Encode>d__24.MoveNext() at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[[ScreenToGif.Windows.Other.Encoder+<Encode>d__24, ScreenToGif, Version=2.23.1.0, Culture=neutral, PublicKeyToken=null]](<Encode>d__24 ByRef) at ScreenToGif.Windows.Other.Encoder.Encode(System.Collections.Generic.List`1<ScreenToGif.Model.FrameInfo>, Int32, ScreenToGif.Util.Parameters, System.Threading.CancellationTokenSource) at ScreenToGif.Windows.Other.Encoder+<>c__DisplayClass13_0.<InternalAddItem>b__0() at System.Threading.Tasks.Task.Execute() at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef) at System.Threading.Tasks.Task.ExecuteEntry(Boolean) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at System.Threading.ThreadHelper.ThreadStart(System.Object)</Data> </EventData> </Event> ``` I originally created the project in 2.17.1 (the Portable version), and I saw this issue. I tried downloading 2.23.1 (again, the Portable version), and saw the same problem. Saving via gif works okay. I haven't tried ffmpeg because I don't have it installed, yet. Let me know what I can do to help. I'm a programmer myself, but I've never worked in .NET and rarely on Windows, so I'll be new to this.
kerem 2026-03-01 18:53:15 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ScreenToGif#2122
No description provided.