MovieRenderPipeline.WaveOutput.WriteDelay
MovieRenderPipeline.WaveOutput.WriteDelay
#Overview
name: MovieRenderPipeline.WaveOutput.WriteDelay
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
How long (in seconds) should the .wav writer stall the main thread to wait for the async write to finish\nbefore moving on? If your .wav files take a long time to write and they\'re not finished by the time the\nencoder runs, the encoder may fail.\n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of MovieRenderPipeline.WaveOutput.WriteDelay is to control the delay time for the .wav file writing process in the Movie Render Pipeline of Unreal Engine 5. This setting variable is specifically used in the audio output and rendering system of the engine.
This setting variable is primarily used by the Movie Render Pipeline Core module and the Movie Render Pipeline Render Passes module. It’s specifically utilized in the audio output functionality of these modules.
The value of this variable is set as a console variable (CVar) with a default value of 0.5 seconds. It can be modified at runtime through the console or programmatically.
This variable interacts with the audio export and wave output processes. It’s used to introduce a delay in the main thread, allowing time for the asynchronous write of .wav files to complete.
Developers must be aware that this variable directly affects the performance and behavior of the audio rendering pipeline. If set too low, it might lead to incomplete .wav files when the encoder runs. If set too high, it could unnecessarily slow down the rendering process.
Best practices when using this variable include:
- Adjusting the value based on the specific hardware and file sizes being dealt with.
- Monitoring the log output to ensure the delay is sufficient for the .wav files to complete writing.
- Finding a balance between allowing enough time for file writing and maintaining overall rendering performance.
- Consider increasing the value if encountering issues with incomplete audio files during encoding.
- Be cautious about setting very high values as it could significantly slow down the rendering process.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/Graph/Nodes/MovieGraphAudioOutputNode.cpp:12
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarWaveOutputDelay(
TEXT("MovieRenderPipeline.WaveOutput.WriteDelay"),
0.5f,
TEXT("How long (in seconds) should the .wav writer stall the main thread to wait for the async write to finish\n")
TEXT("before moving on? If your .wav files take a long time to write and they're not finished by the time the\n")
TEXT("encoder runs, the encoder may fail.\n"),
ECVF_Default);
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/Graph/Nodes/MovieGraphAudioOutputNode.cpp:258
Scope (from outer to inner):
file
function void UMovieGraphAudioOutputNode::StartAudioExport
Source code excerpt:
// for 0.5s to give it a chance to write to disk. It'll only potentially be an issue with command line encoding if it takes
// longer than 0.5s to write to disk.
if (const TConsoleVariableData<float>* CVar = IConsoleManager::Get().FindTConsoleVariableDataFloat(TEXT("MovieRenderPipeline.WaveOutput.WriteDelay")))
{
UE_LOG(LogMovieRenderPipeline, Log, TEXT("Delaying main thread for %f seconds while audio writes to disk."), CVar->GetValueOnGameThread());
FPlatformProcess::Sleep(CVar->GetValueOnGameThread());
}
}
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineRenderPasses/Private/MoviePipelineWaveOutput.cpp:175
Scope (from outer to inner):
file
function void UMoviePipelineWaveOutput::BeginFinalizeImpl
Source code excerpt:
// for 0.5s to give it a chance to write to disk. It'll only potentially be an issue with command line encoding if it takes
// longer than 0.5s to write to disk.
if (const TConsoleVariableData<float>* CVar = IConsoleManager::Get().FindTConsoleVariableDataFloat(TEXT("MovieRenderPipeline.WaveOutput.WriteDelay")))
{
UE_LOG(LogMovieRenderPipeline, Log, TEXT("Delaying main thread for %f seconds while audio writes to disk."), CVar->GetValueOnGameThread());
FPlatformProcess::Sleep(CVar->GetValueOnGameThread());
}
}