Unity/TeamCity/CommadLine Video Encoder Build Issue

Hi,

I am trying to use TeamCity to generate a build using unity and so far it has been fine.

But recently only when I build through TeamCity I get this error when trying to play a video using Unity’s video player:

Could not find material Hidden/VideoDecode

(Filename: C:/buildslave/unity/build/Runtime/Video/Base/VideoYUV420Convert.cpp Line: 803)

Could not find video decode shader pass YCbCr_TO_RGB1 in shader

(Filename: C:/buildslave/unity/build/Runtime/Video/Base/VideoYUV420Convert.cpp Line: 863)

Could not find video decode shader pass YCbCrA_TO_RGBAFull in shader

(Filename: C:/buildslave/unity/build/Runtime/Video/Base/VideoYUV420Convert.cpp Line: 863)

Could not find video decode shader pass YCbCrA_TO_RGBA in shader

(Filename: C:/buildslave/unity/build/Runtime/Video/Base/VideoYUV420Convert.cpp Line: 863)

Could not find video decode shader pass Flip_RGBA_To_RGBA in shader

(Filename: C:/buildslave/unity/build/Runtime/Video/Base/VideoYUV420Convert.cpp Line: 863)

Could not find video decode shader pass Flip_RGBASplit_To_RGBA in shader

(Filename: C:/buildslave/unity/build/Runtime/Video/Base/VideoYUV420Convert.cpp Line: 863)

Could not find video decode shader pass Flip_SemiPlanarYCbCr_To_RGB1 in shader

(Filename: C:/buildslave/unity/build/Runtime/Video/Base/VideoYUV420Convert.cpp Line: 863)

Could not find video decode shader pass Flip_SemiPlanarYCbCrA_To_RGBA in shader

(Filename: C:/buildslave/unity/build/Runtime/Video/Base/VideoYUV420Convert.cpp Line: 863)

Could not find video decode shader pass Composite_RGBA_TO_RGBA in shader

(Filename: C:/buildslave/unity/build/Runtime/Video/Base/VideoYUV420Convert.cpp Line: 863)

This error does not show if I run a manual build through Unity only.

What is generating this error?

Thanks in advance.

Ran some more tests and managed to replicate this by manually running the editor from the command line using batch mode.

So possibly a command line issue, not a TeamCity one.

Edit: To clarify, running the build through the command line utilises the BuildPipeline.BuildPlayer function. Whereas, The manual editor build uses the Build option in the player settings.

I found a workaround for this issue.
I set up the call to the BuildPipeline.BuildPlayer and added it as a Menu Item inside of Unity.
This Menu Item ran the BuildPlayer function in the editor and created a working build.
Then I ran my TeamCity build after the editor and it also created a working build.
(Working build meaning that the error message no longer appeared and was playing the video)

From the looks of it, I believe this to be a Unity bug and will look to report it as such unless if anyone has spotted something I missed.

I got a response on the Unity answers section (Surprised as I thought it never posted due to the issues I have with my account on there) and this seems to do the trick:

So far, early tests have been successful and I will keep an eye on this in the future.

1 Like