Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Unity video player is not working

Discussion in 'Audio & Video' started by Tomoko1995, Mar 23, 2022.

  1. Tomoko1995

    Tomoko1995

    Joined:
    Mar 23, 2022
    Posts:
    4
    Hello, I have a very unique issue. As far as I can tell I'm probably the only person with this exact problem. whenever I attempt to watch a second video in scene . weather it be via YouTube URL or an MP4 file I get the same error (video works on first attempt. After pausing and playing. It fails on the second attempt and any further attempts until I restart unity entirely)

    WindowsVideoMedia error 0xc00d36b4 while reading C:/Users/johnb/My project/Assets/Galaga Walkthrough_Gameplay NES HD 1080p.mp4

    Context: IMFSourceReader::WaitForSample in StepAllStreams
    Error details: The data specified for the media type is invalid, inconsistent, or not supported by this object.
    Track types:
    Unreadable Track

    I'm using an older version of unity since VRchat requires you use unity 4.3 from 2019

    Never the less. The issue occurs in game and in unity. while in game I can watch a single video per instance. But anything more and the video breaks. Same exact issue happens within a project while editing a world inside unity

    This "unsupported video" nonsense can't be the issue. Because the video works on the first attempt. But won't allow a second playing of the same video.

    What does it mean by "windows video media" what exactly is this? An application? Because typing that in results in nothing found. I thought it might be referring to windows media player. But that can't be it. I uninstalled and reinstalled it and no dice.
     
  2. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    WindowsVideoMedia is the class that communicates between the Windows Media Foundation and Unity. WindowsVideoMedia error 0xc00d36b4 is a generic way to say the Windows Media Foundation could not open and play the file. Most of the time, it happens because the file has weird settings or is not supported by the foundation.

    But in your case, it is a little bit different. If I understand correctly, the foundation was able to play it without any error, but after pausing and resuming, the video would stop (crash, black screen?) and send the error mentioned. Am I right?
    1. Is it happening with every file or just with this one in particular? Can you try this video, for example?
    2. Can you play the file in any other software like VLC or Media Player?
    3. Can you try reproducing the issue with a new empty project?
    4. Are you using the latest 2019.4+ version? If not, try updating it to the latest if you can.
    5. For testing purposes, can you try upgrading your project (keep a backup) to a more recent version (>2021.2)
     
  3. Tomoko1995

    Tomoko1995

    Joined:
    Mar 23, 2022
    Posts:
    4
    "but after pausing and resuming, the video would stop (crash, black screen?) and send the error mentioned. Am I right?"

    Yes. But not pausing as in pressing pause. But rather going to play mode. Then back to edit mode then back to play mode (normal pause works)

    Upon going back to play mode I get some 999+ errors (the one I posted above)

    1.)Is it happening with every file or just with this one in particular? Can you try this video, for example?

    Yes. With every file. And url that goes through the windows video media thing (I will test this video after work)

    2.) Can you play the file in any other software like VLC or Media Player

    Correct. I have tried them in these and it works with no issues

    3.)Can you try reproducing the issue with a new empty project?

    Will do this afternoon.

    4.)Are you using the latest 2019.4+ version? If not, try updating it to the latest if you can.

    Unsure. But I will check when I'm home!

    5.) For testing purposes, can you try upgrading your project (keep a backup) to a more recent version (>2021.2)
    Yes. I will do this.

    Thank you. Please check back later for an update later :D
     
    The_Island likes this.
  4. Tomoko1995

    Tomoko1995

    Joined:
    Mar 23, 2022
    Posts:
    4
    I downloaded the latest version of unity (Unity 2021.2.16)
    and tested my original video as well as the test video you provided me. both times. the video works once you press play. but apon going back to edit. then back to play. i get this error message now


    WindowsVideoMedia error 0x887a0005 while reading C:/Users/johnb/My project (2)/Assets/test video.mp4

    Context: IMFSourceReader::WaitForSample in StepAllStreams
    Error details: The GPU device instance has been suspended. Use GetDeviceRemovedReason to determine the appropriate action.

    Track types:
    Unreadable Track

    this error message is entirely different to the one from earlier.

    as far as if im using the latest 2019 version. im not. VRchat is specific in that it uses a precise version. using later versions wont even let you upload to their servers so that rules out that possibility.
     
    Last edited: Mar 23, 2022
  5. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    Yeah, it looks like an issue with your hardware and Windows Media Foundation. The last thing I would try is updating your drivers to the latest. If this doesn't work, open a bug report following these steps. We will investigate the issue.

    A possible workaround would be to use VP8. It should still work in VR chat, and it may fix your problem. You can use any online converter or FFmpeg to convert your file to VP8. You can try to use the transcode feature in the Editor to transcode to VP8, but it uses Windows Media Foundation. So a high chance to either fail or give a poor result in your case.
     
  6. Tomoko1995

    Tomoko1995

    Joined:
    Mar 23, 2022
    Posts:
    4
    Thank you for the feedback. I'll try these solutions. Thank you!
     
  7. grobonom

    grobonom

    Joined:
    Jun 23, 2018
    Posts:
    335
    Hi all :)
    Is there a way to decode and understand videoplayer errors ?
     
  8. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    The errors are generally from MediaFoundation so maybe you can check their docs. There is also, this cool site that often can find the name from a HEX Code. https://www.magnumdb.com/search?q=0x887a0005

    If you can't find anything. Just open a thread and I can try to help you find the issue. Otherwise, if you get a generic error like the one above unfortunately, you have to check your file setting. On Windows the biggest error is having a H265 file without the 1$ addons from Microsoft.
     
    grobonom likes this.
  9. grobonom

    grobonom

    Joined:
    Jun 23, 2018
    Posts:
    335
    Thanks for your answer ! :D
    My problem is that i cannot plmay mp4 from web.
    This comes from my OS ( win7 ) on wich i updated the nvidia driver to the latest.

    My app works fine on win10 bus as i still develop on win7, i was wondering what i was missing ( and to be honest i strictly don't understand all those media things, codecs, formats, etc....... )
    Is there a 'basic standard' thing to install on windows to make simple standard ( audio and video ) things work ?

    thanks and happy unitying ! :)
     
  10. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    grobonom likes this.
  11. grobonom

    grobonom

    Joined:
    Jun 23, 2018
    Posts:
    335
    Sure :D This is very kind of you !!!

    The error i got in unity console is:
    WindowsVideoMedia error 0x80072f8f while reading https://www.kleioscope.fr/appmedias/carcass/_FR/V0000-29092022-540lo-.mp4

    VideoPlayer cannot play url : https://www.kleioscope.fr/appmedias/carcass/_FR/V0000-29092022-540lo-.mp4

    EDIT: note that the video playback works fine when the file requested is a .webm file ;)
    EDIT2: also, the .mp4 file playback works perfectly when the file comes from my hard drive.

    Here it is:
    Code (CSharp):
    1. General
    2. Complete name                            : V0000-29092022-540-.mp4
    3. Format                                   : MPEG-4
    4. Format profile                           : Base Media
    5. Codec ID                                 : isom (isom/iso2/avc1/mp41)
    6. File size                                : 11.1 MiB
    7. Duration                                 : 3 min 11 s
    8. Overall bit rate                         : 486 kb/s
    9. Frame rate                               : 30.000 FPS
    10. Writing application                      : Lavf58.29.100
    11.  
    12. Video
    13. ID                                       : 1
    14. Format                                   : AVC
    15. Format/Info                              : Advanced Video Codec
    16. Format profile                           : High@L3.1
    17. Format settings                          : CABAC / 5 Ref Frames
    18. Format settings, CABAC                   : Yes
    19. Format settings, Reference frames        : 5 frames
    20. Codec ID                                 : avc1
    21. Codec ID/Info                            : Advanced Video Coding
    22. Duration                                 : 3 min 11 s
    23. Bit rate                                 : 384 kb/s
    24. Width                                    : 960 pixels
    25. Height                                   : 540 pixels
    26. Display aspect ratio                     : 16:9
    27. Frame rate mode                          : Constant
    28. Frame rate                               : 30.000 FPS
    29. Color space                              : YUV
    30. Chroma subsampling                       : 4:2:0
    31. Bit depth                                : 8 bits
    32. Scan type                                : Progressive
    33. Bits/(Pixel*Frame)                       : 0.025
    34. Stream size                              : 8.71 MiB (79%)
    35. Writing library                          : x264 core 157
    36. Encoding settings                        : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=17 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=2pass / mbtree=1 / bitrate=384 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=576 / vbv_bufsize=768 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
    37. Codec configuration box                  : avcC
    38.  
    39. Audio
    40. ID                                       : 2
    41. Format                                   : AAC LC
    42. Format/Info                              : Advanced Audio Codec Low Complexity
    43. Codec ID                                 : 2 / 40 / mp4a-40-2
    44. Duration                                 : 3 min 11 s
    45. Duration_LastFrame                       : -9 ms
    46. Bit rate mode                            : Constant
    47. Bit rate                                 : 96.0 kb/s
    48. Channel(s)                               : 2 channels
    49. Channel layout                           : L R
    50. Sampling rate                            : 44.1 kHz
    51. Frame rate                               : 43.066 FPS (1024 SPF)
    52. Compression mode                         : Lossy
    53. Stream size                              : 2.19 MiB (20%)
    54. Default                                  : Yes
    55. Alternate group                          : 1
    56.  
    57.  
     
    Last edited: Jun 15, 2023
  12. grobonom

    grobonom

    Joined:
    Jun 23, 2018
    Posts:
    335
    Hi.

    I searched a bit on this MP4 problem..... Finally, i tried to open the big buck bunny MP4 video and.... It vorked



    So i started to take a peek at my website server.... tried things in the htaccess.... And noticed my MP4s worked fine in http:// but not in https://

    I'm still not sure of anything but maybe this is a clue to take in care ?

    What is your opinion ?

    EDIT: Back there with some more info.
    definetely, this url:
    http://kleioscope.fr/appmedias/carcass/_FR/bbb.mp4
    works with the unity video player ( it is the big buck bunny video, for beeing sure it is not a f*cked-up mp4 )
    And also, this url:
    https://kleioscope.fr/appmedias/carcass/_FR/bbb.mp4
    do not work in videoplayer with an error 0x80072f8f

    Then i thought i could format the requested URL on my server side with the htaccess file, by detecting appmedias/carcass in the requested URL and transform https to http in the request.
    This just don't work.

    Therefore i guess the problem comes from the videoplayer in windows 7 ( note that any http or https URL works in windows 10 )

    Any idea to solve this ? :)

    EDIT2: for those wanting to give a try with my files on server, here's the small unity3D project:
     

    Attached Files:

    Last edited: Jun 16, 2023
  13. DominiqueLrx

    DominiqueLrx

    Unity Technologies

    Joined:
    Dec 14, 2016
    Posts:
    260
    Hi!

    So it seems the web server's config for https is not supported by the networking layer in Microsoft's Media Foundation on Windows 7. The error code you're getting is Windows telling us that something's not going well at the network level when trying to read the file, which translates to WININET_E_DECODING_FAILED, which is documented to mean "The connection with the server has been reset.".

    Are you able to play this source when you point a web browser to it?

    And are you able to play a https source on this system (with web browser or Unity) when it comes from another server? Here's an example I just looked up: https://file-examples.com/storage/fefb234bc0648a3e7a1a47d/2017/04/file_example_MP4_480_1_5MG.mp4

    Dominique
     
  14. grobonom

    grobonom

    Joined:
    Jun 23, 2018
    Posts:
    335
    Hi @DominiqueLrx :) Thanks for your answer !

    Yes this is the info i found: wininet_decode_fail :/ however i was missing the 'connection reset' info....
    My first thought was that this came from my win7 codecs....

    The strange thing is that the U3D videoplayer use i make in my app was developped on the win7 machine i use ! :O
    The point is that i recently updated my nvidia driver. And since then i cannot play those videos from web....
    I tried many things with many codecs installers but there was nothing to do....

    Yes my videos can be played in opera and firefox with no problems and i can also play big buck bunny videos in unity with http and https.....

    Hmmm..... connection reset ???? :O
    lemme try something....
    I be back very soon with infos and with answers to your question ;)

    Have a nice day and happy unitying ! :D

    EDIT: Back there with infos on your video link:
    It opens properly in opera and firefox but with unity3D 2022.1.6.f1 i have the same error:
    WindowsVideoMedia error 0x80072f8f while reading https://www.file-examples.com/storage/fefb234bc0648a3e7a1a47d/2017/04/file_example_MP4_480_1_5MG.mp4

    Maybe i should give a try to a unity3D update ?

    EDIT2: update to 2022 LTS changed nothing :( and adds a bug: editor ALWAYS runs as admin ( when no admin flag of hub or editor is ON )..... Uninstalling :/
     
    Last edited: Jun 20, 2023
  15. grobonom

    grobonom

    Joined:
    Jun 23, 2018
    Posts:
    335
    bumpies ? :)
     
  16. DominiqueLrx

    DominiqueLrx

    Unity Technologies

    Joined:
    Dec 14, 2016
    Posts:
    260
    Hi again!

    Thanks for these additional tests. We can see that even when files are served from other servers - not just yours - there can be problems. Although it's a bit puzzling when you say

    [...] i can also play big buck bunny videos in unity with http and https.....​

    So some mp4 files do play correctly (like big buck bunny), but others (like the ones you created or some from www.file-examples.com) don't.

    It's starting to look like bug-submission time... The most recent Win7-specific bug fix I can see for video is already integrated in 2022.1.6f1 (it was integrated at 2022.1.0a13 and had to do with reading movies from asset bundles... quite a different area).

    You can of course keep trying with more recent versions like 2022.3 or 2023.1/2023.2, but I doubt this will be an actual solution for you unless you're ready to upgrade.

    A completely different approach would be to use the webm file format (with vp8 codec and vorbis audio), like you already found is working. This is a different code path that will not be affected by whatever seems to bother Microsoft Media Foundation in the current situation. But the downside is that in this implementation the file is completely downloaded before playback starts (you may or may not perceive this, depending on connection speed and file size). The other difference is that the decoding is not hardware-accelerated. Again, you may not perceive it depending on resolution and what's happening in your game while the movie is playing. Furthermore, mp4/h.264 decoding is not hardware-accelerated on Win7, so this is not where you'll see a difference if any, but it is on Win >=10.

    Please let us know when/if you've submitted a bug: posting the bug id over here will let us contact our customer QAs quickly to help them with the investigation.

    Dominique
     
  17. Smallu3755

    Smallu3755

    Joined:
    Dec 5, 2023
    Posts:
    3
    I searched on every forum on internet and eventually end up fixing this by disabling cookies forwarding.
     
  18. Nafryti

    Nafryti

    Joined:
    Jun 16, 2022
    Posts:
    1
    I had a Windows Update just before this issue started up for me today (yesterday as of writing) with the latest recommended for VRChat Creator Companion Unity version 2022.3.6f1 and updating all the SDK's and assets for the project.
    I recall something about an HEVC update, to enable it for devices that didn't have a dedicated encoder, or something like that in the update and didn't pay much mind to it, but today I had 3 strange ones about ODBE and some others. Unity is the only application affected, which makes me wonder if there's a backend update that broke Unity's communication ability to Google's playlist service or something. (going off of the console error log)

    I'll post what the console reports every time I try previewing my AudioLink settings with a Youtube URL in Unity Player
    First I get this in the console:
    Then I get this right after:
    I haven't the remotest clue as to where to start, I've been across the horizon on Google and back downloading updated VLC players, codecs, and ultimately landed here and tried the cookies forwarding "fix" from the post above by @Smallu3755, and still no resolution. I've already restarted my PC once, earlier, I even ran SFC /scannow in an elevated terminal.

    any help would be great!

    Additional info:
    Using the links above I was able to download the default AudioLink prefab link URL just fine, and then play it just fine.
     
    Last edited: May 2, 2024
    ComplexInteractive likes this.