Working on a game where i need to record designated camera views(1 or more) into respective video files/ image sequence. The camera wont necessarily be the gameplay cam. Ive already managed to do it in the editor using [DeveloperTools->MediaCapture and FileMediaOutput] to preview our hardware constraints for the recording. But I’m looking for a more in game solution that can be kept after packaging.
I cannot help you directly, but you essentially just need to figure out how to write to a texture. And then create a texture of every frame the camera sees. Browsing the docs I found this: Render to Texture Toolset Setup | Unreal Engine Documentation
Sorry I couldn’t be more specific.
(Also I am sure there are better ways. But I have implemented something similar to this in Unity C# before and it worked well)
I haven’t yet looked into recording in game footage options, but after seeing this thread you have peaked my interests
I will be diving into this as much as I can, because its a really powerful feature to have.
After a quick search, it seems that Unreal already has a pretty intuitive replay/ recording system. I’m taking a look at this Replay System Tutorial. It looks promising.
I had initially done a render to texture using a camera view and saving it on every tick. But this was without the toolset you have mentioned. My method would basically freeze the gameplay fps to almost 1. I will try out your recommendation and update here.
Hey thanks for this one, we currently already have a recorder and playback system similar to this in the project, but the replay section broke during a version change. Maybe I can use this to go through it and figure out what needs changing. Will update when Ive tried it out. Thank you.
I was able to get the UMovieSceneCapture working on my end, so I believe I should be able to help you figure out what’s going wrong on your end.
With just the information that you provided that UMovieSceneCapture::Initialize is causing the project to crash, I would guess that the problem is that scene_vieport is null and you’re passing that into Initialize.
Here is a function I am calling in an actor component class I created that gets created in my player controller class. I’m calling InitializeSceneCapture in UMyActorComponent::BeginPlay.
void UMyActorComponent::InitializeSceneCapture()
{
const UWorld* World = this->GetWorld();
if (!World)
{
UE_LOG(LogMyActorComponent, Error, TEXT("InitializeSceneCapture: World was invalid"));
return;
}
UGameViewportClient* GameViewportClient = World->GetGameViewport();
if (!GameViewportClient)
{
UE_LOG(LogMyActorComponent, Error, TEXT("InitializeSceneCapture: Unable to get GameViewport"));
return;
}
TSharedPtr<SViewport> GameViewportWidget = GameViewportClient->GetGameViewportWidget();
if (!GameViewportWidget)
{
UE_LOG(LogMyActorComponent, Error, TEXT("InitializeSceneCapture: Unable to get GameViewport widget"));
return;
}
TSharedPtr<FSceneViewport> SceneViewportPtr = MakeShareable(new FSceneViewport(GameViewportClient, GameViewportWidget));
if (!SceneViewportPtr)
{
UE_LOG(LogMyActorComponent, Error, TEXT("InitializeSceneCapture: Unable to create pointer to TSharedPtr<FSceneViewport>"));
return;
}
if (!this->MovieSceneCapture)
{
UE_LOG(LogMyActorComponent, Error, TEXT("InitializeSceneCapture: MovieSceneCapture was invalid"));
return;
}
this->InitializeSceneCaptureSettings();
this->MovieSceneCapture->Initialize(SceneViewportPtr, 0);
this->MovieSceneCapture->StartWarmup();
this->MovieSceneCapture->StartCapture();
}
This is working for me, so I think
scene_viewport here is most likely null and that’s causing UMovieSceneCapture::Initialize to crash.
Hey thanks for working on this today, yes it could be that the viewport ptr is null, but I do have it within if statements to check whether it can be created. Ill go back in tomorrow and try it out again.
Will update when I get something, also did it make a difference when u gave PIEID as 0 vs GPlayInEditorID? I had tried it with 1 and the GPlayInEditorID
@sambyte61 could you let me know what did you set in this function? As far as i understood, initialise itself would set everything.