Rendering a ULevelSequence with Movie Render Queue in Unreal Engine 5 using the C++ SDK

I have this code but unfortunately it doesn’t trigger the render also I cannot figure how to modify the output settings like resolution or fileformat.

Here is my current try where I tried to create this function

#include "MoviePipelineEditorBlueprintLibrary.h"
#include "MoviePipelineQueueEngineSubsystem.h"
#include "MovieRenderPipelineSettings.h"

void RenderLevelSequence(ULevelSequence* LevelSequence, const FString path, const FString OutputLayamaFile)

    // Get Subsystem
    UMoviePipelineQueueEngineSubsystem* MoviePipelineQueueEngineSubsystem = GEngine->GetEngineSubsystem<UMoviePipelineQueueEngineSubsystem>();
    // Get ActiveQueue
    UMoviePipelineQueue* ActiveQueue = MoviePipelineQueueEngineSubsystem->GetQueue();

    // Create a new job
    UMoviePipelineExecutorJob* ActiveJob = UMoviePipelineEditorBlueprintLibrary::CreateJobFromSequence(ActiveQueue, LevelSequence);

    const UMovieRenderPipelineProjectSettings* ProjectSettings = GetDefault<UMovieRenderPipelineProjectSettings>();


    if (ProjectSettings->LastPresetOrigin.IsValid())
    {
        ActiveJob->SetPresetOrigin(ProjectSettings->LastPresetOrigin.Get());
    }

    UMoviePipelineEditorBlueprintLibrary::EnsureJobHasDefaultSettings(ActiveJob);
    // Start render job
    MoviePipelineQueueEngineSubsystem->RenderJob(ActiveJob);

}

Unfortunately the rendering task seems that is never started.

Any help is welcome!

Read more here: Source link