I am having a problem with playing Video on WebGL on Firefox. My Unity version is 5.6.0f3. I am playing the video from URL, but when it doesn’t work, and the warning I am getting is
Cannot play media. No decoders for requested formats: video/x-ms-wmv
Update: changing transcoding from h264 to vp8 removes the error message, but the video still doesn’t play. Tried various transcoding settings in Unity, no change. Tried uGUI (via RawImage) using a render texture, and quad in scene using material override.
Tried encoding video file using h264 with premiere (had previously tried w/ VLC).
Screenshot of tests included. Right side is UI element, left is quad, both trying and failing to play video.
Console output is below - this test was in Firefox. Seeing same thing in Edge.
Successfully compiled asm.js code (total compilation time 4ms; not stored in cache (too small to benefit)) UnityLoader.js
Successfully compiled asm.js code (total compilation time 1ms; not stored in cache (too small to benefit)) UnityLoader.js
You can reduce your startup time if you configure your web server to host .unityweb files using gzip compression. UnityLoader.js:4:8480
Successfully compiled asm.js code (total compilation time 3557ms; stored in cache) af326789-094e-4338-8667-e9748d62592f
unreachable code after return statement[Learn More] c53625cd-850b-45fe-9f29-60710f10c234:2:4519
Initialize engine version: 2017.2.0f1 (35e55a2a85de)
c53625cd-850b-45fe-9f29-60710f10c234:2:174198
Creating WebGL 2.0 context. UnityLoader.js:1:7731
Renderer: Mozilla
c53625cd-850b-45fe-9f29-60710f10c234:2:174198
Vendor: Mozilla
c53625cd-850b-45fe-9f29-60710f10c234:2:174198
Version: OpenGL ES 3.0 (WebGL 2.0)
c53625cd-850b-45fe-9f29-60710f10c234:2:174198
GLES: 3
c53625cd-850b-45fe-9f29-60710f10c234:2:174198
EXT_color_buffer_float GL_EXT_color_buffer_float EXT_texture_filter_anisotropic GL_EXT_texture_filter_anisotropic EXT_disjoint_timer_query GL_EXT_disjoint_timer_query OES_texture_float_linear GL_OES_texture_float_linear WEBGL_compressed_texture_s3tc GL_WEBGL_compressed_texture_s3tc WEBGL_debug_renderer_info GL_WEBGL_debug_renderer_info WEBGL_lose_context GL_WEBGL_lose_context MOZ_WEBGL_lose_context GL_MOZ_WEBGL_lose_context MOZ_WEBGL_compressed_texture_s3tc GL_MOZ_WEBGL_compressed_texture_s3tc
c53625cd-850b-45fe-9f29-60710f10c234:2:174198
OPENGL LOG: Creating OpenGL ES 3.0 graphics device ; Context level <OpenGL ES 3.0> ; Context handle 1
c53625cd-850b-45fe-9f29-60710f10c234:2:174198
UnloadTime: 0.835000 ms
c53625cd-850b-45fe-9f29-60710f10c234:2:174198
Cannot play media. No decoders for requested formats: video/x-ms-wmv, video/x-ms-wmv, video/x-ms-wmv, video/x-ms-wmv
Hi Julien! It’s Ricky. I’m having the same issue ;(
When I open the game as an app from my desktop it works great. But when running my game through WebGL the game play runs ok however the video doesn’t work. I get same error as OP.
Hey folks,
Just FYI, we did eventually get this working using h.264 and pointing at a URL instead of embedding the media in the WebGL app. Sounds like other folks are having other issues, but it’s at least worth a try.
Can some one explain how you got this working please!
Do not know how to do:
“using h.264 and pointing at a URL instead of embedding the media in the WebGL app”
Been having the same problem! My video clip works in the editor, but when I build a WebGl and open it, no video plays. I have tried using URL’s, VideoClips with Material Override and Render Texture and nothing has worked! I know with URLs you need an absolute path, but I don’t know where to upload my videos to get that URL path. Then there were some mentions of using script to find the video, but I am not really a programmer.
Did you ever find a solution to this? Having the same issue at the moment. Using the absolute path of a video file stored in a folder within my home directory seems to crash Unity.
Thanks for a comprehensive example @JuanJSAR . Currently Unity web builds do not indeed work properly for embedding video files. There is a bug report about that in our database, and unsure about what to do about it, because embedding video files in a build as assets is usually not the thing that people would want to do.
That is, it is much better to place videos in StreamingAssets because that way the game can start up already without needing to first download the video. If the video is placed in regular assets, it will cause the whole video to be downloaded in full before the game can start up at all.
[Unity 2020.2.5] Used the method from @JuanJSAR . Im putting the videos in the streaming assets folder and while it works in the editor it breaks when played through the firefox browser even when run directly with build and run. Error reads: No way to decode the file video/mp4.
What gives?
Decoding the video is a task that is the browser’s responsibility. According to https://caniuse.com/mpeg4 . The error suggests that Firefox could not find a codec for the video type on the installed OS, or something similar. Do other browsers work?
please sir it doesn’t work even in other browsers even chrome I used the same setup why won’t a simple vodeo work I added a button so I can start and stop it no hope
thank you man it is good since you know about it then how can I retrieve camera feed in webgl and send it with webRTC can you help me with that please .???