Search Unity

Question Getting WindowsVideoMedia error 0xc00d36b4 on some devices.

Discussion in 'Audio & Video' started by ruiyl, Jan 27, 2021.

  1. ruiyl

    ruiyl

    Joined:
    Aug 4, 2019
    Posts:
    20
    Some of our clients have reported that some in-game videos don't play while some do play correctly. So, I took a look at their Player.log and found that there were some errors raised. These are some of them:

    WindowsVideoMedia error 0xc00d36b4 while reading archive:/CAB-efe72908991b9f35788263125cf7d6bd/CAB-efe72908991b9f35788263125cf7d6bd.resource
    Context: Setting media type for first video stream
    Error details: The data specified for the media type is invalid, inconsistent, or not supported by this object.
    Track types:
    Audio Track, type: 3-ca
    Audio Track, type: %10%16
    Video Track [1280 x 720], type: H264

    WindowsVideoMedia error 0xc00d36b4 while reading archive:/CAB-efe72908991b9f35788263125cf7d6bd/CAB-efe72908991b9f35788263125cf7d6bd.resource
    Context: Setting media type for first video stream
    Error details: The data specified for the media type is invalid, inconsistent, or not supported by this object.
    Track types:
    Audio Track, type: %10%16
    Video Track [1920 x 1080], type: H264

    All video file format is ".mp4". I'm not sure what caused the error, but my guess is the audio track because other files that play correctly were also encoded in H264 codec as well and they do not have an audio track.

    The question is:
    1. How do I encode the videos to avoid these errors.
    2. How do I catch these errors in the code. I try surrounding the part that sets VideoPlayer.clip and the part that calls VideoPlayer.Play() with a try/catch block, but the errors still got through.

    I've attached the Player.log files of the clients that reported the issue.
    Thanks for the help!
     

    Attached Files:

  2. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    getting the same audio errors even in the Unity Editor right after movie asset import when running editor on windows 7
    this has started somewhen AFTER Unity 2019.4.8f1 ( which DOES NOT show the problem )
    ( 2019.4.17f1 and all later version i tested have the problem )

    So my guess:
    • a videoplayer update that happened AFTER Unity 2019.4.8f1 causes/triggers this error on WINDOWS 7 machines
    • Unity Editor AND builds running on W7 seem to be affected
    • Build plays video perfectly fine on W10
    so your clients might try to run the game on windows 7 and getting those error in the player too

    That s quite a serious issue, that slipped through Unity QA here, as W7 is still a supported OS for builds ( and i hope editor too ? )
    On top of that tje issue is difficult to catch for game developers using W10 for the editor and to build the games, while players still might run on W7...
    Definitely worth a bug report ... will do the same as soon as i find the time...
     
  3. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    BTW:
    using different audio codecs ( which are supported by the windows mediafoundation ) doesnt help, they throw the same error
    on top of that, windows mediaplayer itself plays the videos+audio perfectly fine here on Windows 7, so its definitely a Unity bug ...
     
  4. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    I submitted a bugreport together with a small repro project
    I hope this issue will be fixed, as it affects all games build in later unity versions and using some kind of mp4 encoded videos with audio when players run the games on Windows 7
     
    D12294 likes this.
  5. ruiyl

    ruiyl

    Joined:
    Aug 4, 2019
    Posts:
    20
    @spacefrog Thank you very much for looking into the problem for me. I would have been trying to catch that error without your help.
     
  6. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
  7. dragologic

    dragologic

    Joined:
    Oct 28, 2012
    Posts:
    16
    This is happening to me too on latest Unity 2019.4.19
    However videos works on 2019.4.14
    I use windows 7 too


    Context: Setting media type for first video stream
    Error details: The data specified for the media type is invalid, inconsistent, or not supported by this object.
    Track types:
    Audio Track, type: %10%16
    Video Track [624 x 1000], type: H264
     
  8. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Your experience that it's working on 2019.4.14 sounds plausible - according to the issue tracker the problem got introduced with 2019.4.16f1
    I cant imagine why this doesnt get higher priority ?
    Be sure to give your vote on the issue tracker page to ensure a faster fix ....
     
  9. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    EDIT:
    ahh ... just read the "Fix in Review" line ....
    so its just my patience running out, but at least it seems that we get a fix ....
    and its planned for LTS versions too...
    took some time... but okay ... better late then never
     
  10. ruiyl

    ruiyl

    Joined:
    Aug 4, 2019
    Posts:
    20
    I am relieved that it is planned for the LTS version. Still, the wait is on.
     
  11. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Just verfied and confirmed that the bug is still existing in 2020.3.0f1 (which is called LTS nevertheless !! )
    Additionally it still exists in 2019.4.22f1 and 2021.1.0b11....
     
  12. Carlos9x

    Carlos9x

    Joined:
    Aug 5, 2017
    Posts:
    12
    I am also getting this bug. Any news on this?
     
  13. ruiyl

    ruiyl

    Joined:
    Aug 4, 2019
    Posts:
    20
    Carlos9x likes this.
  14. ruiyl

    ruiyl

    Joined:
    Aug 4, 2019
    Posts:
    20
    Update: It is now fixed for 2021.2. Still in the plan for 2019.4, 2020.3., 2021.1.
     
  15. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    To be totally exact it WILL be fixed in the next 2021.2 alpha drop, which will be 2021.2.a13
    The current alpha build 2021.2a12 STILL shows the issue ( just verfied it myself here )

    Really took a long time to fix this. Even more so when considering that the cause was some W10 specific code that wasnt necessary on W7 anyways
     
  16. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Finally it seems that the fix has landed in the most recent alpha build 2021.2.0a13 ( according to the release notes)

    Though the fix is still not backported to the most recent LTS builds ( Unity 2019.4.24f1 and 2020.3.4f1 ) and the tech stream 2021.1.3f1

    I'm currently downloading and installing the alpha build and report back if it fixes my issue
     
  17. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    Okay - fix seems to work for me in Unity 2021.2.0a14
    There is a new warning being logged in the console
    "WindowsVideoMedia error unhandled Color Standard: 0 falling back to default this may result in rendering issues"

    But maybe thats something with my encoding ... anyways... hope we ASAP see the fix land in the officially released versions too ...
     
  18. pandageneration

    pandageneration

    Joined:
    Feb 15, 2016
    Posts:
    2
    I get this too and I have Unity 2021.2.0a9.1276 running

    "WindowsVideoMedia error unhandled Color Standard: 0 falling back to default this may result in rendering issues"
     
  19. KimmoFactor

    KimmoFactor

    Joined:
    Dec 29, 2020
    Posts:
    39
    Getting the same message with a pretty bog-standard H264 video in 2021.2b7 (don't get it in 2021.1).

    "WindowsVideoMedia error unhandled Color Standard: 0 falling back to default this may result in rendering issues"

    Seems to still work, but would be great to have even a tiny clue from the editor about what that actually means to get rid of the message.
     
  20. Bastienre4

    Bastienre4

    Joined:
    Jul 8, 2014
    Posts:
    191
    Some of our players also experience this issue.

    upload_2021-8-19_15-29-56.png

    We're using Unity 2020.3.12f1
     
  21. daniyalnz2

    daniyalnz2

    Joined:
    Aug 6, 2020
    Posts:
    4
    still have the same issue but I found a work around, select your video in the projects panel
    tick transcode
    convert your codec to VP8
     
    mindalvaro and Bastienre4 like this.
  22. ThugLifeCompany

    ThugLifeCompany

    Joined:
    Apr 23, 2019
    Posts:
    5
    but there is a solution!
    still not working on W7... but if you badly need this for now you can extract frames of your video and animation frames like a gif into unity
     
    mindalvaro likes this.
  23. highlyinteractive

    highlyinteractive

    Joined:
    Sep 6, 2012
    Posts:
    116
    As others have mentioned, I'm also getting this warning in 2021.2.0b15:

    WindowsVideoMedia error unhandled Color Standard: 0 falling back to default this may result in rendering issues

    This is the only google result for the issue, so would be great to get some more info. Is it a bug, or do I need to change my encoding?
     
  24. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    Hi. Sorry to be this late. We should have given a little bit of information about WindowsVideoMedia error 0xc00d36b4. 0xc00d36b4 means that the file is invalid, inconsistent, or unsupported. So it is a generic way to say they failed to read it. It is a huge pain to debug because it doesn't specify what failed. Your codec could be unsupported, the bitrate and resolution could be too big or too small for the codec, the audio track sample rate could be unsupported, etc. You can check the format constraint for H264 on their site if you want https://docs.microsoft.com/en-us/windows/win32/medfound/h-264-video-decoder. So even if you get WindowsVideoMedia error 0xc00d36b4 is highly possible that the reason for the error is entirely different from another user. If you get this error and think it shouldn't, I highly recommend filing a bug report. Our VP8 solution doesn't use MediaFoundation, so as a quick fix, you could transcode your video in VP8, and it should work.
    To be transparent, the message warns that MediaFoundation could not provide the color standard of the video clip. So we have to guess what the color standard is. We already got multiple reports that the warning is spamming everyone, and we are currently working to resolve this. So you don't need to file a bug report, and you should not worry about it.
     
    joonan05 and Bastienre4 like this.
  25. sumpfkraut

    sumpfkraut

    Joined:
    Jan 18, 2013
    Posts:
    242
    Code (JavaScript):
    1. WindowsVideoMedia error unhandled Color Standard: 0 falling back to default this may result in rendering issues
    It worked for me after i changed the Transcode settings to "Code = VP8" (Auto or x264 gave me the error)
     
  26. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    After looking into the bug report for the WindowsVideoMedia error unhandled Color Standard: 0, it seems that all files have unknown color primaries set in the file. If you do this command
    and you see this
    It means that the color standard was not set while encoding the video. If you want to stop getting warnings, the best solution is to ensure the color standard is correctly set while encoding your video. If you can't do that for whatever reason, you could reencode with FFmpeg with this command. This command is for an mp4 with H264 so customize it if you use something else.
    Unfortunately, MediaFoundation check only the stream metadata and not the container metadata, so you need to reencode your video. Reencoding your file means that the video quality will decrease. If this is unacceptable to you, then the final solution is to do nothing. We will probably guess the correct color standard, so you don't need to bother. But we know that getting constant warnings is not fun in any way. We are looking to change the way we are reporting warnings across the Editor, so it should not happen in the future, but we don't have ETA yet.
     
  27. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    Few things about this.

    1) In standalone build, it throws a null ref error about once in 100 times. So something is still going on.

    2) Can we not set the color profiles in the import settings? Then Unity doesn't have to throw errors or guess.

    3) If I set it to VP8 + low bitrate the error disappears...even on 4k mp4 files...so something is going on...
     
    Last edited: Dec 9, 2021
  28. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    1) Interesting. What do you mean about null ref error? Is it a WindowsVideoMedia error 0xc00d36b4 or something else?

    2) We have this discussion, and after reaching out to some people, we found out that there is already some work in progress for this kind of issue for all importers. So we are torn between fixing it now and redoing it later or waiting for the new interface. So we decided to go with the latter, but we fixed spamming warnings for the same file. So it should be more manageable, but we understand it is still a pain. If it is too painful, I recommend using the FFmpeg command to set the color standard correctly or check with your recorder on how to set it.

    3) Yeah, it is normal. When you set to VP8, we transcode your video in Webm, and we only support bt601 for Webm. So we don't have to guess anything.
     
  29. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    As for 1) I will try to get you the exact error msg, it was overwritten in the player log.

    2) Good to hear.
    3) The thing is it requires the bitrate to be "LOW", I thought the codec VP8 is preventing this msg, then why is bitrate also having influence? I am probably not educated enough in the videos and codecs so kindly do tell in depth :)

    Lastly, if I set it to VP8, will my clients need VP8 codec installed separately to have the video playback in game? Or is everything handled in engine as long as the source video is transcoded?

    Thanking you in advance,
     
  30. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    Are you sure that changing the bitrate has an influence? Because on my side, when I transcode in VP8 with High or Low bitrate, I get the same warning. But I realize you still get a warning even if you transcode to VP8 because we still need to read the file.

    For your last point, VP8 is a royalty-free video compression and for that reason, we are supporting it on all platforms. So we handled everything as long as the video codec is VP8.
     
  31. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    On checking again, the bitrate seems to have no influence! Thanks for clearing that up!
     
  32. GameMechanics

    GameMechanics

    Joined:
    Jul 15, 2013
    Posts:
    57
    I am trying to import a video file but keep getting this error:

    WindowsVideoMedia error 0xc00d36b4 while reading D:/Climber/ClimberGame/Assets/Video/Splash-1.mp4

    Context: Setting media type for first video stream
    Error details: The data specified for the media type is invalid, inconsistent, or not supported by this object.
    Track types:
    Audio Track, type: %10%16
    Video Track [1920 x 1080], type: H264


    Everything plays the video fine. I have tried converting it with Handbrake but nothing seems to help. Windows plays it. YouTube converts it. I just can't import it into Unity. Suggestions?
     
  33. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    Weird. A video encoded with H264 at 1080p with AAC is definitely supported. There is probably something else in the video file that make the Media Foundation complains. Send me a DM with the video in question, and I will be able to provide more info on the issue.
     
  34. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
  35. GameMechanics

    GameMechanics

    Joined:
    Jul 15, 2013
    Posts:
    57
    Upgraded and that fixed it.

    Now I am getting this warning:

    First video frame not zero: 2 (0.066667s). Result may be out of sync. Please make sure tracks all start at 0 in D:/Climber/ClimberGame/Assets/Video/splash.mp4

    Should I care? Or ignore it? The video plays fine. I exported it from Adobe Premiere and re-exported it using Handbrake and both files get the same error.
     
  36. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    It means if you ask to seek at 1.0s, there could be a 0.066667s error accuracy on your request. If it is not a problem for you, then you can ignore
     
    GameMechanics likes this.
  37. GameMechanics

    GameMechanics

    Joined:
    Jul 15, 2013
    Posts:
    57
    It is not a problem. Thanks.
     
  38. Vuelkaz11

    Vuelkaz11

    Joined:
    May 3, 2022
    Posts:
    3
    Hello, I am an end user (buyer) of two Unity games on Windows 7 , Magia X and Demon Gaze Extra. Both have the same problem described in this topic,the 0xc00d36b4 error : the intro video or any mp4 video simply won't play in-game (it just shows black screen with no sound) even when I could play them outside fine. I've looked up player.log and found the exact same kind of errors demonstrated by OP :

    WindowsVideoMedia error 0xc00d36b4 while reading G:/steam/steamapps/common/Magia X/Magia X_Data/StreamingAssets/assets/assetdata_part_1/video/edel/preview_edel.mp4

    Context: Setting media type for first video stream
    Error details: The data specified for the media type is invalid, inconsistent, or not supported by this object.
    Track types:
    Video Track [1280 x 720], type: H264

    And there would be the same error for every video I tried to play in-game.


    Now, it's to my understanding that Unity had long fixed this issue in their engine for devs side on new version of Unity but in my case both developers of these two games show no sign of updating the game nor offering any kind of supports, both can't even be reached. So after much struggle with google on my issues I've finally arrived at this place. I'm hoping that someone would be kind enough to offer solution for this problem for end users like me who apparently can't just update the game engine on their own. Magia X in particular have many mp4 that are played when you are fighting so being unable to play the mp4 detract a lot from game experience.
     
  39. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    Usually, the simplest way to fix this issue would have been to reencode the file in a webm format. Unfortunately, you can't change the filename from preview_edel.mp4 to preview_edel.webm. As a user, the easiest way to make it work would be to upgrade your Windows to 8.1 or 10. It is probably not the answer you were looking for, but I don't know another way around this issue other than upgrading the editor and recompiling the project. Sorry :(
     
  40. Vuelkaz11

    Vuelkaz11

    Joined:
    May 3, 2022
    Posts:
    3
    Can you please at least tell what's the component that breaks playing mp4 in Unity on windows 7 but not on windows 8,10 ?
     
  41. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    The video rotation is only supported in Windows 8 and above. And on Windows 7, setting it causes the decoder to fail to initialize (even if the video had no rotation in the first place). There is a big gap in how the Media Foundation behaves in Windows 7 versus Windows 8 and 10. Maybe, you could search for MF_MT_VIDEO_ROTATION in the compiled IL and remove the instruction. But I don't know what all this looks like in IL. I wish it answers your question.
     
  42. Vuelkaz11

    Vuelkaz11

    Joined:
    May 3, 2022
    Posts:
    3
    What is compiled IL ? Do I, as enduser, have access to them or do I need special tool to do so ?
     
  43. mindalvaro

    mindalvaro

    Joined:
    Jun 13, 2022
    Posts:
    1
    eso soluciona el problema, excelente aporte.
     
  44. KimmoFactor

    KimmoFactor

    Joined:
    Dec 29, 2020
    Posts:
    39
    Just for future reference, maybe it helps others. I was trying to get rid of the color standard warnings, and noticed that if I used 'Hardware Encoding' in Adobe Media Encoder, it didn't write the color metadata at all (as in 'color_range' etc. was 'unknown'). But if I switched to 'Software Encoding', it started to write the proper metadata.
     
  45. KYL3R

    KYL3R

    Joined:
    Nov 16, 2012
    Posts:
    135
    I exported using Davinci Resolve in mp4/H.264 and the video only played once in Editor or in Build, afterwards it threw errors and was stuck on some frame or just black. (In Build, it looped fine until you reloaded the level. Then it was stuck and I had to restart the game)

    Transcode with "auto" didn't work but now I used "VP8" as suggested here, which works for me. No errors, plays in Editor, works in build even after switch scenes a few times.
     
  46. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    @KYL3R, I can check what is going wrong if you can share the file. You can export a black image with the same export settings if you don't want to share the content or send it in DM to keep it private.
     
  47. KYL3R

    KYL3R

    Joined:
    Nov 16, 2012
    Posts:
    135
    I zipped the mp4 file that I used:
    https://pecker-game.com/unity/tutorialVideo1_v3.zip
     
  48. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    On my side, I don't see any issue with your clip. Did you get a WindowsVideoMedia error 0xc00d36b4 or is it something else? You probably should do a bug report since I can't reproduce it with only the clip.
     
  49. KYL3R

    KYL3R

    Joined:
    Nov 16, 2012
    Posts:
    135
    Yes, same error code 0xc00d36b4. I submitted a bug report: CASE IN-39768
     
  50. FrogioCanani

    FrogioCanani

    Joined:
    Dec 14, 2019
    Posts:
    1
    same error, I'm using video mp4 H.264