I’m using UE4.26.
I’ve created a blueprint that pauses the game takes a screenshot, unpauses the game, advances one frame, takes a screenshot and so on.
This works great for the gameplay elements and allows me to render image sequences at varying framerates with the correct timing for physics simulations etc.
The problem I’m having is when playing video using FileMediaSource and MediaTexture assets.
If I pause the game using the SetGamePaused blueprint node, or the ‘pause’ console command the video continues to play.
If I hit the in-editor pause simulation button the video pauses as expected.
To try to get around this, I set up an Event Interface to notify the video player that the game has paused which allows me to pause the media source. This works as expected and pauses the video and resumes when I unpause the game.
However! There is a 1-2 second delay between playing the Media Source asset and the video actually playing, so if I only pause for 0.03 seconds, advance the time, play and take the screenshot, the video hasn’t had time to move on.
I tried manually advancing the video using the seek blueprint node and setting the new time to current video time + duration of pause, but I faced the same problem; the video doesn’t advance quickly enough to be captured by the next screenshot.
I was initially blaming the video size and buffering, but even with small videos there is a considerable delay. Also, this isn’t the case when using the pause/play simulation button in the editor which seems instant.
Any tips/work-arounds would be greatly appreciated