0
\$\begingroup\$

I'm using Unity's Video Player component to play a short intro video before the main menu.

The problem is that its resolution is 2560x1440, and on Windows 7 or earlier operating systems it says:

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 [2560 x 1440], type: H264
      Resolution exceeds the Microsoft Media Foundation  decoder limit of 1920 x 1088 on Windows 7 and below.

Is there a way to check whether it's supported or not? Because then I could change the played video to a lower resolution version. And if that's not supported as well, I would just skip the intro all-together.

I would be happy with other solutions as well.

EDIT: What I'm trying now is:

  • subscribing to errorReceived,

  • and if currently it's the 1440p version, I switch back to the 1080p version and play it.

  • If errorReceived is fired again (so the current version is 1080p), I just skip the whole intro phase.

     videoPlayer.errorReceived += OnErrorReceived;
    
     ...
    
     private void OnErrorReceived(VideoPlayer videoPlayer, string message)
     {
         if (videoPlayer.clip == Intro1440p)
         {
             OnIntroFinished(videoPlayer);
             videoPlayer.clip = Intro1080p;
             videoPlayer.Play();
         }
         else
         {
             OnIntroFinished(videoPlayer);
         }
     }
    

Now the intro is skipped if no suitable format is found, which is good, but for some reason even the 1080p version is unsupported:

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

I've now added an 1080p wmv version, after all that's a Windows format, it must be supported by Windows 7.

But it's still unsupported:

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: a%01
   Video Track [1440 x 1080], type: WMV3
\$\endgroup\$
2
  • \$\begingroup\$ Want to share your current solution as an Answer? You can always edit/delete the answer later if you find it's not suitable. \$\endgroup\$ Commented May 25, 2021 at 21:38
  • \$\begingroup\$ Sadly no. I tried improving it further, but it's still not good. At least now it's skipped if the video isn't supported, but I still can't figure out the supported format for Windows 7. \$\endgroup\$ Commented May 26, 2021 at 9:24

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.