Download

Headless rendering with UE4Editor-Cmd.exe

I am having trouble getting output files when executing a rendering script from the command line. The same script running inside of Unreal has no issues. The logs show everything working…just no output from the engine. Is there a way to get the Sequencer output?

I have placed a minimal script to recreate the issue as well as the command being used below. Thanks in advance for any help!

import unreal

def render_sequence_to_movie(sequencer_asset_path):
	capture_settings = unreal.AutomatedLevelSequenceCapture()
	capture_settings.settings.output_directory = unreal.DirectoryPath("C:/tmp/")
	capture_settings.level_sequence_asset = unreal.SoftObjectPath(sequencer_asset_path)

	return_val = unreal.SequencerTools.render_movie(capture_settings, on_finished_callback)

def on_render_movie_finished(success):
	print("Movie has finished rendering. Python can now invoke another movie render if needed. Sucess: " + str(success))
	
on_finished_callback = unreal.OnRenderMovieStopped()
on_finished_callback.bind_callable(on_render_movie_finished)
render_sequence_to_movie("/Game/NewSequence.NewSequence")

`‘C:\Program Files\Epic Games\UE_4.26\Engine\Binaries\Win64\UE4Editor-Cmd.exe’ ‘C:\Users[UNAME]\Documents\Unreal Projects\MyProject\MyProject.uproject’ -ExecutePythonScript=test_unreal.py -RenderOffscreen