Bizarre VideoPlayer errors - 0x8007000e, Unexpected error code (10), Cannot read file, Ran out of memory

After loading videoclips(either the same videoclip; or a couple different clips) and displaying it/them on different VideoPlayers, I get this consistent pattern of errors:

VideoPlayer cannot play clip : Filepath/clip.m4v

Cannot read file.

VideoPlayer cannot play clip : Filepath/clip.m4v

Unexpected error code (10).

WindowsVideoMedia error 0x8007000e while reading C:/ProjectPath/Library/Artifacts/b5/b572d41ffa4e038f6a075a2a0bca64ea

Context: IMFSourceReader::WaitForSample in StepAllStreams
Error details: Ran out of memory

Track types:
Unreadable Track

The only thread that I found that was similar to my issues is this one: WindowsVideoMedia Error 0X8007000e Wat dis do? - Questions & Answers - Unity Discussions

However, implementing any sort of “wait for load” method that I tried does not seem to help. Ie.

    IEnumerator LoadClip()
    {
            videoPlayer.Prepare();
            while (!videoPlayer.isPrepared)
            {
                yield return new WaitForSeconds(0.2f);
            }
            videoPlayer.Play();
    }

None of the “preparation” solutions I’ve come up with seem to work. I’ve tried a couple of variants, like WaitUntil(), trying to load the clip through Resources.Load(), etc. but the outcome is the same - the first few videoplayers work fine and, at about 5, more videoplayers just break and start displaying those errors and refusing to play the clips.

I’ve tried this on a variety of video files, so I don’t think it’s a problem with any single video file.

I can’t imagine it’s possible that Unity’s VideoPlayer actually runs out of memory if you’re playing a literal handful of video clips of tiny videos, so what’s going on? What am I missing here?

Had the same problem. Playing maybe 5-15 videos and 1-5 audio sources at a time.


Problems started when, after multiple different videos (repeating videos didn’t cause it), some videos would not be able to play after some time, while others were.

I was first building the game using 2021.3.11f. After finding some bug trackers, I updated to 2021.3.22f. This did not fix the problem, but even added a new problem which periodically crashed the game. When it crashed, nothing was logged but Sentry reported “Fatal Error: EXCEPTION_ACCESS_VIOLATION_READ” and then some stuff about a memory issue.

Transcoding all videos got rid of both problems for me. While these were just the first settings I tried, I used:

  • sRGB on
  • Dimensions: original
  • Codec: VP8 (see this post)
  • Bitrate Mode: high
  • Spatial Quality: high spatial quality
  • Deinterlace: off

Original videos were .mov files that we converted into .webm (for videos with transparency) and .mp4 (for videos without transparency) files using ffmpeg.


After this, we saw a different error:
“AudioSampleProvider buffer overflow. XXX frames discarded”

The symptom for this was the audio cutting out.

After finding this post, I went through and changed anything that used player.frame=0 into player.Stop(). I did the same for audio, where I found that I used source.time=0 to reset the audio.
This didn’t seem to help.

Then, because I cannot disable importing audio for video for whatever reason, I did this for every video player:

player.audioOutputMode = VideoAudioOutputMode.None;
for (ushort i = 0; i < player.audioTrackCount; i++)
	player.EnableAudioTrack(i, false);

After all this, the issues seem to be gone.