irajsb / UE_CaptureSubsystem

Runtime video and screenshot capture system for Unreal Engine
MIT License
81 stars 14 forks source link

Accessed nullptr after adding nvenc #5

Closed F1nansist closed 7 months ago

F1nansist commented 8 months ago

Hi. It is what i can share from logs

[2023.11.30-13.03.33:255][669]LogCaptureSubsystem: Capturing Video [2023.11.30-13.03.33:256][669]LogCaptureSubsystem: Creating Director [2023.11.30-13.03.33:257][669]LogCaptureSubsystem: Creating Audio Encoder [2023.11.30-13.03.33:290][672]LogCaptureSubsystem: Creating Encoder Thread [2023.11.30-13.03.33:291][672]LogCaptureSubsystem: Creating Video encoder [2023.11.30-13.03.33:291][672]LogCaptureSubsystem: nvenc added [2023.11.30-13.03.35:362][672]LogWindows: Error: === Critical error: === [2023.11.30-13.03.35:363][672]LogWindows: Error: [2023.11.30-13.03.35:363][672]LogWindows: Error: Fatal error! [2023.11.30-13.03.35:363][672]LogWindows: Error: [2023.11.30-13.03.35:363][672]LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000088 [2023.11.30-13.03.35:363][672]LogWindows: Error: [2023.11.30-13.03.35:363][672]LogWindows: Error: [Callstack] 0x00007ffb1bb31425 avformat-59.dll!UnknownFunction [] [2023.11.30-13.03.35:363][672]LogWindows: Error: [Callstack] 0x00007ffb1bb5e2a7 avformat-59.dll!UnknownFunction [] [2023.11.30-13.03.35:363][672]LogWindows: Error: [Callstack] 0x00007ffb1bb60905 avformat-59.dll!UnknownFunction [] [2023.11.30-13.03.35:363][672]LogWindows: Error: [Callstack] 0x00007ffb1b561caa UnrealEditor-CaptureSubsystem.dll!UCaptureSubsystemDirector::Create_Video_Encoder() [D:\UnrealProjects\PolyCore5.1\Plugins\UE_CaptureSubsystem\Source\CaptureSubsystem\Private\CaptureSubsystemDirector.cpp:532] [2023.11.30-13.03.35:363][672]LogWindows: Error: [Callstack] 0x00007ffb1b560295 UnrealEditor-CaptureSubsystem.dll!UCaptureSubsystemDirector::CreateEncodeThread() [D:\UnrealProjects\PolyCore5.1\Plugins\UE_CaptureSubsystem\Source\CaptureSubsystem\Private\CaptureSubsystemDirector.cpp:327] [2023.11.30-13.03.35:363][672]LogWindows: Error: [Callstack] 0x00007ffb1b56b877 UnrealEditor-CaptureSubsystem.dll!UCaptureSubsystemDirector::OnBackBufferReady_RenderThread() [D:\UnrealProjects\PolyCore5.1\Plugins\UE_CaptureSubsystem\Source\CaptureSubsystem\Private\CaptureSubsystemDirector.cpp:205] [2023.11.30-13.03.35:363][672]LogWindows: Error: [Callstack] 0x00007ffb1b56582c UnrealEditor-CaptureSubsystem.dll!TBaseUObjectMethodDelegateInstance<0,UCaptureSubsystemDirector,void __cdecl(SWindow &,TRefCountPtr const &),FDefaultDelegateUserPolicy>::ExecuteIfSafe() [E:\UE_5.1\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:618]

Sorry I dont have debug symbols yet

irajsb commented 8 months ago

A common thing that can cause this failure is driver being outdated or GPU not supporting hardware encoding . Please check

F1nansist commented 8 months ago

Recording with CPU throw same error but without nvenc I updated all drivers but still have this issue. I am working on 5.1.1. I checked out Editor and Standalone

irajsb commented 8 months ago

Check that you've correct path and that path is not write protected/ doesn't require admin privilege .

F1nansist commented 7 months ago

Crashes were occured while recommended video file name was used because plugin tried to create file in folder which doesnt exist (im talking about "Capture/" stuff). It is strange that recommended file path is not valid by default. It has to be in readme that recommened file path uses Capture dir in project to save file and if u dont create this dir by urself u will get crash.

irajsb commented 7 months ago

Added an snippet to create output folder if not already existing

    if (!FPaths::FileExists(Options.OutFileName))
    {
        const FString FolderPath = FPaths::GetPath(Options.OutFileName);
        if (!FPaths::DirectoryExists(FolderPath))
        {
            FPlatformFileManager::Get().GetPlatformFile().CreateDirectoryTree(*FolderPath);
        }
    }