Closed ancho98 closed 4 months ago
Another error add: When I play game and record to use 'selected viewport'. It makes crash. But if I played 'New Editor Window(PIE)' It work sometime.
And I thought plugin take a video and audio. But in my mp4 file there is no sound. tip for me.
Plugin does record video and audio . Is your drivers up to date ? cause I can see [2024.03.13-08.25.01:594][ 73]LogCaptureSubsystem: Warning: Using software encoder which means it failed to create gpu encoder .
There is two type of error.
[2024.03.14-02.20.59:558][179]LogCaptureSubsystem: Capturing Video
[2024.03.14-02.20.59:559][179]LogCaptureSubsystem: Creating Director
[2024.03.14-02.20.59:559][179]LogCaptureSubsystem: Creating Audio Encoder
[2024.03.14-02.20.59:560][179]LogBlueprintUserMessages: [LV_AIStudio_C_3] Capture start
[2024.03.14-02.20.59:589][183]LogTemp: Creating Encoder
[2024.03.14-02.20.59:589][183]LogCaptureSubsystem: Creating Encoder Thread
[2024.03.14-02.20.59:589][183]LogCaptureSubsystem: Creating Video encoder
[2024.03.14-02.20.59:589][183]LogCaptureSubsystem: nvenc added
[2024.03.14-02.20.59:589][183]LogCaptureSubsystem: Warning: Using software encoder
[2024.03.14-02.20.59:589][183]LogCaptureSubsystem: Creating Video Queue
[2024.03.14-02.20.59:591][183]LogCaptureSubsystem: Allocating Video Filter
crash report
LoginId:db6364de4234a01f75ca4b92b3cb168f EpicAccountId:477dc34bc8ea42369e96133bb8eb6126
Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffffffffffff
ucrtbase
ucrtbase
ucrtbase
UnrealEditor_Core!TStringBuilderBase
3. When Capture video by using float viewport(PIE).
crash error log
[2024.03.14-02.17.36:564][293]LogCaptureSubsystem: Capturing Video [2024.03.14-02.17.36:622][293]LogViewport: Scene viewport resized to 1440x2560, mode WindowedFullscreen. [2024.03.14-02.17.36:632][293]LogCaptureSubsystem: Warning: Viewport resize detected Resizing render targets [2024.03.14-02.17.36:662][293]LogCaptureSubsystem: Creating Director [2024.03.14-02.17.36:662][293]LogCaptureSubsystem: Creating Audio Encoder [2024.03.14-02.17.36:663][293]LogBlueprintUserMessages: [LV_AIStudio_C_3] Capture start [2024.03.14-02.17.36:683][293]LogViewport: Scene viewport resized to 1434x2520, mode WindowedFullscreen. [2024.03.14-02.17.36:693][293]LogCaptureSubsystem: Warning: Viewport resize detected Resizing render targets [2024.03.14-02.17.36:711][295]LogTemp: Creating Encoder [2024.03.14-02.17.36:711][295]LogCaptureSubsystem: Creating Encoder Thread [2024.03.14-02.17.36:711][295]LogCaptureSubsystem: Creating Video encoder [2024.03.14-02.17.36:711][295]LogCaptureSubsystem: nvenc added [2024.03.14-02.17.36:711][295]LogCaptureSubsystem: Warning: Using software encoder [2024.03.14-02.17.36:712][295]LogCaptureSubsystem: Error: 殠쩽࣋ Error: 㳰쩽࣋ [2024.03.14-02.17.36:712][295]LogCaptureSubsystem: Ending Video [2024.03.14-02.17.36:712][295]LogCaptureSubsystem: Creating Video Queue [2024.03.14-02.17.36:713][295]LogCaptureSubsystem: Allocating Video Filter
crash report
LoginId:db6364de4234a01f75ca4b92b3cb168f EpicAccountId:477dc34bc8ea42369e96133bb8eb6126
Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000000000004b0
UnrealEditor_D3D12RHI!FD3D12Texture::Lock() [D:\build++UE5\Sync\Engine\Source\Runtime\D3D12RHI\Private\D3D12Texture.cpp:1772]
UnrealEditor_D3D12RHI!FD3D12DynamicRHI::LockTexture2D_RenderThread() [D:\build++UE5\Sync\Engine\Source\Runtime\D3D12RHI\Private\D3D12Texture.cpp:2144]
UnrealEditor_CaptureSubsystem!UCaptureSubsystemDirector::GetScreenVideoData() [C:\Workspace\DBAIMetaHumanNewVersion\Project_Ari\Plugins\CaptureSubsystem\Source\CaptureSubsystem\Private\CaptureSubsystemDirector.cpp:322]
UnrealEditor_CaptureSubsystem!UCaptureSubsystemDirector::OnBackBufferReady_RenderThread() [C:\Workspace\DBAIMetaHumanNewVersion\Project_Ari\Plugins\CaptureSubsystem\Source\CaptureSubsystem\Private\CaptureSubsystemDirector.cpp:224]
UnrealEditor_CaptureSubsystem!TBaseUObjectMethodDelegateInstance<0,UCaptureSubsystemDirector,void __cdecl(SWindow &,TRefCountPtrFSlateRHIRenderer::DrawWindows_Private'::
51'::SlateDrawWindowsCommandName,FSlateRHIRenderer::DrawWindows_Private'::
51'::SlateDrawWindowsCommandName,
two type of error look similar but call stack is bit different.
When I call StartCapture() my viewport resized. Do you know why??
Can you change to directx 11 and test again?
I tested capture with default ThirdPerson template and It worked very good. My main project have lots of plugins So I think one of them make crash with capture system. Or some of project setting error. But I can't pretend the reason yet
// Open the video codec
int Err = avcodec_open2(VideoEncoderCodecContext, EncoderCodec, nullptr);
if (Err < 0)
{
// If the hardware codec fails to initialize, switch to the software codec
if (strcmp(EncoderCodec->name, "h264_nvenc") == 0 || strcmp(EncoderCodec->name, "h264_amf") == 0)
{
EncoderCodec = avcodec_find_encoder(AV_CODEC_ID_H264);
UE_LOG(LogCaptureSubsystem, Warning, TEXT("Using software encoder"));
SetupEncoderContext(EncoderCodec, bit_rate);
Err = avcodec_open2(VideoEncoderCodecContext, EncoderCodec, nullptr);
if (Err < 0)
{
LogErrorUE("Video codec open error", Err, false);
}
}
else
{
LogErrorUE("Video codec open error", Err, false);
}
}
In this code I check the variables with debuger
int Err = avcodec_open2(VideoEncoderCodecContext, EncoderCodec, nullptr);
Over here VideoEncoderCodecContext is fine.
But after avcodec_open2() function change codec to null and return 22 error.
Error log print like this. The main is Invalid argument.
Every error's cause this part. Do you know why the codec open function not work? In other project it work very fine. I have no idea about ffmpeg and avcodev lib. Thanks for your respond
I fixed it!
This is my blueprint node. when I turn on Show UI then It makes crash!
and other issue was I put down file path in Video filter section!
Thanks a lot.
I saw 'Show UI' option need to upgrade driver version or use dx11. Do you have any plan to change for use dx12 and Show UI option?
The limitation of dx12 and show UI is not a issue on my side its limited on unreal engine side. even if it works in packaged game UI will still not show. for video file name make sure to pass a folder where user has permission to use ( for example not drive C ). There is a function called get recommended video file name that puts video in user documents but you can also put it inside the packaged game folder.
Got it! I tried show UI option with dx11 and used developers directory. It works correctly. Maybe I don't need to use capture UI now. It will be fine. Thank you!
And this is another simple question! Is the Bit Rate unit bps or kbps in Options?
bits per second (bps)
I just use StartCapture in Level Blueprint
LoginId:db6364de4234a01f75ca4b92b3cb168f EpicAccountId:477dc34bc8ea42369e96133bb8eb6126
The error report display this.
and in crash report print log like this
In LogErrorUE() function it print unicode. but I have no idea how can check the reason. because it called on TaskGraph