Forum rules - please read before posting.

Video Player Issue

edited June 2024 in Technical Q&A

I've recently started using RenderTextures to display my video clips in an FMV game I'm working on.

When ran from an in-scene Actionlist (i.e OnStart or via a DialogueOption Actionlist) they play flawlessly.

However, when called from an external Actionlist from my assets folder there seems to be struggle taking place. - BUT MAINLY ONLY DURING AN ACTUAL BUILD.

The videos will often miss off the first second or 2 at the beginning. It's as if the engine is struggling trying to 'keep up' with it. I've tried setting it to 'Pause gameplay' and 'Run in Background' but the results are always the same, even if I try to prepare the video beforehand from within said Actionlist.

The external Actionlists are all calling a prefab VideoPlayer from within the scene that has a fixed constantID.

Oddly, when playing from the VideoPlayer itself rather than using a RenderTexture, there doesn't seem to be an issue.

As I mentioned, this only really occurs during an actual build.

I'm using the lastest Unity 2022.3.32 and AC 1.81.3.

On a side note, does the PrepareVideo and WaitTillFinish actually make a difference, as the ActionLists seem to continue to run despite the VideoClip being told to WaitTillFinish while preparing? It would be useful to actually have the WaitTillFinish actually do that, this way it's easier to sync up ActionList subtitle files that are set to play when a video plays.

Comments

  • I'll need more specific details. You say this "mainly" occurs during builds - is that to say it sometimes occurs in the Editor?

    Is it consistent with the videos in question, i.e. the same video will always have the same issue, or only if the order they're called in, etc.

    If the change you're making to have it work vs not work is the Video Player's Render Mode field, then it may be a Unity issue rather than an AC one, as AC isn't concerned with the manner in which the Video Player outputs its visuals.

    To test: what is the result of using a unique VideoPlayer object for each video, as opposed to relying on a single one for all. Have each component already have the intended video assigned within its Inspector.

    does the PrepareVideo and WaitTillFinish actually make a difference, as the ActionLists seem to continue to run despite the VideoClip being told to WaitTillFinish while preparing?

    If Prepare only? and Wait until finish? are both checked, the Action will wait until the VideoPlayer's prepareCompleted event has been invoked. When that is called is internal to Unity, however, but from what I've read this causes the video's first 8 or so frames to be ready.

  • Please ignore the bit about it only working in builds, it seems to do it in both.

    After a bit more testing I've noticed something - When the scene is loaded for the first time, the video play correctly when triggered. HOWEVER, when a scene is left and then returned to, the video skips the first few seconds as mentioned above. What's causing this I have absolutely no idea.

  • Does the Video have a Remember Video Player component?

    If so, does removing it make a difference?

    If not, it may be a Unity behaviour.

  • Removing the Rembmer Video Player component doesn't make a difference so I guess it must be a Unity issue. I'll just have to use multiple Video Player components.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.