NickeManarin/ScreenToGif · error · Exception

Impossible to capture the manual screenshot.

Error message

Impossible to capture the manual screenshot.

What it means

NewRecorder's manual-capture snapshot loop calls Capture.ManualCaptureAsync repeatedly until FrameCount > 0, with a hard retry cap. After limit exceeds 5 (six failed attempts) it throws — the capture backend persistently returned zero frames.

Source

Thrown at ScreenToGif/Windows/NewRecorder.xaml.cs:1194

            catch (Exception ex)
            {
                LogWriter.Log(ex, "Impossible to start the screencasting.");
                ErrorDialog.Ok(Title, LocalizationHelper.Get("S.Recorder.Warning.CaptureNotPossible"), ex.Message, ex);
                return;
            }
        }

        #region Take the screenshot

        try
        {
            var limit = 0;
            do
            {
                FrameCount = await Capture.ManualCaptureAsync(new FrameInfo(RecordClicked, KeyList), UserSettings.All.ShowCursor);

                if (limit > 5)
                    throw new Exception("Impossible to capture the manual screenshot.");

                limit++;
            }
            while (FrameCount == 0);

            KeyList.Clear();

            //Displays that a frame was manually captured.
            DisplayTimer.ManuallyCapturedCount++;
            CommandManager.InvalidateRequerySuggested();
        }
        catch (GraphicsConfigurationException g)
        {
            IsRecording = false;

            LogWriter.Log(g, "Impossible to take a snap due to wrong graphics adapter.");
            GraphicsConfigurationDialog.Ok(g, _viewModel.CurrentMonitor);
        }

View on GitHub (pinned to a4d0a67c21)

Solutions

  1. Make sure the desktop is unlocked and not on the secure desktop (UAC prompt) when snapping.
  2. Toggle 'Use Desktop Duplication API' off (or on) in Options > Capture to switch the backend.
  3. Update the GPU driver.
  4. Close full-screen exclusive applications before capturing.

Example fix

// before
var limit = 0;
do
{
    FrameCount = await Capture.ManualCaptureAsync(new FrameInfo(RecordClicked, KeyList), UserSettings.All.ShowCursor);
    if (limit > 5)
        throw new Exception("Impossible to capture the manual screenshot.");
    limit++;
}
while (FrameCount == 0);

// after
var limit = 0;
do
{
    FrameCount = await Capture.ManualCaptureAsync(new FrameInfo(RecordClicked, KeyList), UserSettings.All.ShowCursor);
    if (limit > 5)
        throw new Exception("Impossible to capture the manual screenshot. The capture backend returned no frame after 6 attempts. Unlock the desktop or switch capture mode.");
    limit++;
}
while (FrameCount == 0);
Defensive patterns

Strategy: retry

Validate before calling

// Check capture surface availability before the loop
if (Capture == null || !await Capture.IsAvailableAsync()) /* warn user */

Type guard

// n/a

Try / catch

try { /* manual capture loop */ }
catch (GraphicsConfigurationException g) { GraphicsConfigurationDialog.Ok(g, _viewModel.CurrentMonitor); }
catch (Exception e) { ErrorDialog.Ok(Title, ...); }

Prevention

When it happens

Trigger: Capture.ManualCaptureAsync returns FrameCount == 0 on six consecutive calls. Causes: the capture source (DDU or BitBlt) yielded no frame each time, e.g. desktop not composited, screen locked, capture surface unavailable, DXGI AcquireNextFrame returning empty.

Common situations: Screen locked or UAC secure-desktop active during the snap; full-screen exclusive application blocking BitBlt/DDU; graphics adapter issue; capture backend misconfigured; high-DPI/rotation path returning zero; antivirus hooking the capture surface.

Related errors


AI-assisted analysis of NickeManarin/ScreenToGif@a4d0a67c21 (2026-08-13). Data as JSON: /api/errors/52b390d6090d958b. Report an issue: GitHub.