Script the Movie Render Queue for several renders

Hello !

I’m trying to do batch rendering in Unreal engine, but I’m not sure to fully understand the Movie render pipeline process.
I first tried to implement it in blueprint following the unreal official documentation - Using Movie Render Queue in Runtime Builds – and adapt this to loop and make many render (10000+ jobs)

Here is a simplified version of my blueprint implementation :

A massive issue that I encountered is a memory leek issue where Unreal fills out my VRAM, RAM and Virtual Memory on hard disk. I’m not alone with this issue (see this, this and more). Does someone succeed in making batch render with no memory leak ? I Believe there is a way to avoid this by implementing it differently.

From there I found that unreal had a way to customize the movie pipeline executor in python where you seem to have more control. But I didn’t find anywhere the way to render multiple job. I see that it is mentioned is this python example file of Unreal : " \Engine\Plugins\MovieScene\MovieRenderPipeline\Content\Python\MoviePipelineExampleRuntimeExecutor.py" in the function on_movie_pipeline_finished : “If your queue had more than one job, now would be the time to increment the index of which job you are working on, and start the next one”, but I didn’t find how to do this.

One more thing I found that tells me my blueprint is incorrect is that the Render Job node says : “ If you need to render multiple jobs (in a queue) then you need to either implement the queue behavior yourself, or use GetQueue()=>AllocateJob(…) instead and use the non-convenience functions”
I’m not sure how to “implement the queue behavior yourself”.
I understand that in my way of doing it I do not allocate many jobs to a single render queue and then render, that seems to be toe problem, tell me if I’m wrong.

If you have any tips or any clarification on how this pipeline works, either on blueprint, python or c++ and if you have a way to avoid this memory leak, I would be glad to read it.

Thanks for reading !

Tom

Hello,

aside from the memory leak problem (which we also have), there is a way to allocate multiple jobs inside a queue and render that queue (Movie Pipeline Queue Engine Subsystem).

Here is a link to a documentation (pictures below taken from documentaiton as well): Movie Render Queue in Runtime in Unreal Engine | Unreal Engine 5.0 Documentation

Allocate multiple jobs in a queue:

Render queue

Thanks for your answer,

Reading more attentively the Unreal documentation you provide, I get how to specify a level sequence and render the queue with multiple jobs.
But do you know a way to modify the scene between each job, like changing an asset/a material ?
There is a function “Bind event to on individual job finished deleguate” but I can’t make it work.

Hello,

You can bind an event like you said “Bind event to on individual job finished delegate” - drag a node from the red Event and choose Add Custom Event. Then this event can execute whatever you want to do between jobs.


If you are changing assets/materials, we guess maybe there is not enough time between the finished job and the next job for these changes to appear. In this case maybe it is better to just render one job at a time: Allocate new job -> render with executor -> detect job finished rendering -> clear queue (if using) -> change assets/materials -> allocate new job

You will probably need to use the executor system to render anyway, because it returns executor object reference from which you can bind an event when a job/queue has finished rendering. This way you will know when to change your scene.