game-ci / unity-builder

Build Unity projects for different platforms
https://github.com/marketplace/actions/unity-builder
MIT License
839 stars 239 forks source link

webm not supported by game-ci/unity-builder@v4 #664

Closed DenverGylee closed 3 weeks ago

DenverGylee commented 3 weeks ago

Bug description I switched my video files all to webm so that they can be compiled and distributed using the unity-builder image, what I assume is on top of a Linux distro. It appears these are not working, though. You can see below when my Addressables attempt to build, they fail on all webm files. When I run the build locally, they build the Addressables as expected.

Example log of error is provided in "Additional details"

How to reproduce

  1. Import a webm file into a Unity project.
  2. Mark the asset as Addressable? (I have not determined yet whether this is required)
  3. Build the Unity project using game-ci/unity-builder@v4
  4. Finding: webm files will not be included in your build.

Expected behavior

This error log would not show up and the Addressable asset would be created for webm files.

Additional details

2024-08-14T05:26:22.0647061Z Cannot recognize file type for entry located at 'Assets/Game.Assets/Video/VIDEO_FILE.webm'. Asset location will be ignored.
2024-08-14T05:26:22.0651361Z UnityEngine.StackTraceUtility:ExtractStackTrace () (at /home/bokken/build/output/unity/unity/Runtime/Export/Scripting/StackTrace.cs:37)
2024-08-14T05:26:22.0655425Z UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
2024-08-14T05:26:22.0657944Z UnityEngine.Logger:Log (UnityEngine.LogType,object)
2024-08-14T05:26:22.0659801Z UnityEngine.Debug:LogWarning (object)
2024-08-14T05:26:22.0665043Z UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode:ThrowExceptionIfInvalidFiletypeOrAddress (UnityEditor.AddressableAssets.Settings.AddressableAssetEntry,bool) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:1291)
2024-08-14T05:26:22.0675371Z UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode:GenerateBuildInputDefinitions (System.Collections.Generic.List`1<UnityEditor.AddressableAssets.Settings.AddressableAssetEntry>,System.Collections.Generic.List`1<UnityEditor.AssetBundleBuild>,string,string,bool) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:1269)
2024-08-14T05:26:22.0688691Z UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode:PrepGroupBundlePacking (UnityEditor.AddressableAssets.Settings.AddressableAssetGroup,System.Collections.Generic.List`1<UnityEditor.AssetBundleBuild>,UnityEditor.AddressableAssets.Settings.GroupSchemas.BundledAssetGroupSchema,System.Func`2<UnityEditor.AddressableAssets.Settings.AddressableAssetEntry, bool>) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:1219)
2024-08-14T05:26:22.0705361Z UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode:ProcessBundledAssetSchema (UnityEditor.AddressableAssets.Settings.GroupSchemas.BundledAssetGroupSchema,UnityEditor.AddressableAssets.Settings.AddressableAssetGroup,UnityEditor.AddressableAssets.Build.DataBuilders.AddressableAssetsBuildContext) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:1088)
2024-08-14T05:26:22.0721100Z UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode:ProcessGroupSchema (UnityEditor.AddressableAssets.Settings.AddressableAssetGroupSchema,UnityEditor.AddressableAssets.Settings.AddressableAssetGroup,UnityEditor.AddressableAssets.Build.DataBuilders.AddressableAssetsBuildContext) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:1021)
2024-08-14T05:26:22.0734478Z UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode:ProcessGroup (UnityEditor.AddressableAssets.Settings.AddressableAssetGroup,UnityEditor.AddressableAssets.Build.DataBuilders.AddressableAssetsBuildContext) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:997)
2024-08-14T05:26:22.0744890Z UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptBase:ProcessAllGroups (UnityEditor.AddressableAssets.Build.DataBuilders.AddressableAssetsBuildContext) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Build/DataBuilders/BuildScriptBase.cs:163)
2024-08-14T05:26:22.0756721Z UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptPackedMode:BuildDataImplementation<UnityEditor.AddressableAssets.Build.AddressablesPlayerBuildResult> (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Build/DataBuilders/BuildScriptPackedMode.cs:84)
2024-08-14T05:26:22.0766842Z UnityEditor.AddressableAssets.Build.DataBuilders.BuildScriptBase:BuildData<UnityEditor.AddressableAssets.Build.AddressablesPlayerBuildResult> (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Build/DataBuilders/BuildScriptBase.cs:92)
2024-08-14T05:26:22.0776109Z UnityEditor.AddressableAssets.Settings.AddressableAssetSettings:BuildPlayerContentImpl (UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput,bool) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Settings/AddressableAssetSettings.cs:2828)
2024-08-14T05:26:22.0785308Z UnityEditor.AddressableAssets.Settings.AddressableAssetSettings:BuildPlayerContent (UnityEditor.AddressableAssets.Build.AddressablesPlayerBuildResult&,UnityEditor.AddressableAssets.Build.AddressablesDataBuilderInput) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Settings/AddressableAssetSettings.cs:2791)
2024-08-14T05:26:22.0794115Z UnityEditor.AddressableAssets.Settings.AddressableAssetSettings:BuildPlayerContent (UnityEditor.AddressableAssets.Build.AddressablesPlayerBuildResult&) (at ./Library/PackageCache/com.unity.addressables@1.21.19/Editor/Settings/AddressableAssetSettings.cs:2768)
2024-08-14T05:26:22.0799758Z Game.Editor.BuildScript:Build (UnityEditor.BuildTarget,int,string) (at Assets/Game/Editor/BuildScript.cs:197)
2024-08-14T05:26:22.0802618Z Game.Editor.BuildScript:Build () (at Assets/Game/Editor/BuildScript.cs:93)
mfbrantner commented 3 weeks ago

.webm is the correct container format for the Linux editor, but are you using the correct codec? Needs to be VP8 iirc.

See: https://docs.unity3d.com/Manual/VideoSources-FileCompatibility.html

DenverGylee commented 3 weeks ago

Hi @mfbrantner, yes I'm using VP8 for video and Vorbis for audio. Converted the files using the following ffmpeg command: ffmpeg -i file.mp4 -c:v libvpx -b:v 1M -c:a libvorbis file.webm

ffmpeg docs state libvpx is the encoder for VP8 (https://trac.ffmpeg.org/wiki/Encode/VP8)

The webm files do work if I create a build locally on my Windows machine. They only seem to fail in the container (note I haven't tested yet on a Linux machine)

DenverGylee commented 3 weeks ago

I was able to resolve the issue. I had Transcode enabled on the VideoClip asset which seems to have been the problem. Disabling and leaving the asset as webm with VP8 video encoding and Vorbis audio encoding fixed it. The issue is nrelated to the game-ci image.

webbertakken commented 3 weeks ago

Is or is not related to the game-ci image?

Would be great if we could prevent others from having the same problem. Do you think it would be helpful to have this mentioned in the docs?