Search Issue Tracker

By Design

Votes

0

Found in

2017.4.11f1

Issue ID

1084633

Regression

No

[Android][VideoPlayer] Video not rendered correctly if the app is built in batchmode

Mobile

-

A video played with Unity's VideoPlayer class renders incorrectly (black with artifacts) if the .apk is built using "-executeMethod SomeBuildMethod" but displays normally if SomeBuildMethod is instead used from inside Unity.

To reproduce:

To reproduce:

1. Download attached project "Android Black Video Shader Error.zip" and open in Unity
2. Open "Scene" scene
3. Enter Play mode
4. Observe that the video plays
5. Exit Play mode
6. In the top Unity menu press "Build" > "Build Android" - This is a simple build command from BuildCommands.cs that builds to a file named build .apk
7. Send the build to an Android device from the command line:
adb install -r build.apk
8. Run the build on the device
9. Observe that the video still plays on the device
10. Close Unity.
11. Make another build, this time running this in the command line:
[path_to_unity.exe] -batchmode -projectPath "[path_to_this_project]\Android Black Video Shader Error" -executeMethod BuildCommands.BuildAndroid -quit
12. Observe that the build has a very different size from the previous one (in my case 21.1 MB for the new one, instead of 22.9 MB), while they should be the same, save for maybe a few bytes
13. Send this new build to the device and run it
14. See that the video does not render correctly - in this case, it's black with dot and dash artifacts

Notes:
- Logcat is shared in the comments section

Reproduced on Devices:

Asset tag Device name OS version CPU SoC GPU renderer GLES version Serial number

VLNQA00093 Samsung Galaxy S6 Edge 7.0 Exynos 7 Octa 7420 Mali-T760 OpenGL ES 3.2 05157df580154b28
VLNQA00134 Samsung Galaxy S8 8.0.0 Exynos 9 Octa 8895 Mali-G71 OpenGL ES 3.2 ce031713e36b302a0c
VLNQA00091 Google Pixel 2 XL 9 Snapdragon 835 MSM8998 Adreno (TM) 540 OpenGL ES 3.2 710KPZK0465061

Reproduced on Unity 2017.2.3p4, 2017.3.2f1, 2017.4.11f1, 2018.1.9f2, 2018.2.9f1, 2018.3.0b3 and 2019.1.0a2

  1. Resolution Note (2019.3.X):

    The build script used by the user didn't specify the scenes to be included in the build. When building through UI, the Unity build pipeline loads the scene open in the Unity Editor as the scene to be included in the build, but when building through batchmode, no scene is loaded and thus the scene Assets are not included (should be the same for textures, audio etc.).
    Adding 'scenes = new[] { "Assets/Scene.unity" }' to BuildPlayerOptions resolves this issue.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.