irajsb / UE_CaptureSubsystem

Runtime video and screenshot capture system for Unreal Engine
MIT License
91 stars 15 forks source link

Unsafe game exit #6

Closed F1nansist closed 10 months ago

F1nansist commented 10 months ago

When u start recording u should manually stop recording or happened something strange. For example, someone starts recording and then presses alt+f4 and recording will not stop by itself. In this case created video-file is empty. it is occupied and u cant delete it.

irajsb commented 10 months ago

I don't think there is any app that can alt+f4 and exit correctly they just get force interrupted by windows ( Elden ring is only app that prevents that by some method , once you press alt+f4 screen fades to black and saves then exits ) . in case of video encoding files even if you record for an hour unless you end the file correctly it will not be playable. https://forums.unrealengine.com/t/catching-blocking-alt-f4-in-packaged-game/348273

F1nansist commented 10 months ago

I tried to stop recording while sub system start deinitializing but file still isnt playable. Looks like is needed to stop recording a litle bit earlier but dont understand where i can do this

irajsb commented 10 months ago

Added to latest version:

void UVideoCaptureSubsystem::Deinitialize()
{
    Super::Deinitialize();
    ForceEndCapture();
}

Which forces stopping without waiting for remaining of frames since application is force closing