[BUG] Video keeps freezing randomly at begin of MapLoad

User: Skodone/Ben
Bug: Video keeps freezing randomly at begin of MapLoad
How to Replicate the Bug:
  • When one puts an event with a videocall (WEBM) at the beginning of a map, so it is triggered as soon as possible via player touch, the video is very likely to freeze after a small amount of frames
  • I provided a fully stripped project based on the area of the game the bug happens almost 90% of the time.
  • The 5MB limit is exceeded (5.2mb ZIP) due to the video that causes the problem. I included exactly the video we had the most problems with and it has 3.5mb. The other videos we used are less likely to cause the problem but sometimes do. With this video the bug was best to reproduce.
  • How to trigger: Start the game and immediately push right so the actor would touch the event as soon as possible. The video will start playing and most likely be stuck. Touch the event only once. If the video is stuck touching the even again is more likely to start the video functioning.
  • DOWNLOAD: path-out.net/test/pathout.zip
Other:
We have a fully working build of the game on Steam since a year and no reports of this behavior from the steam version.
We recently decided to localize the game to reach a broader market and encountered the bug after adding subtitles to the videos in game.
What i tried so far:
- I started a complete new project with no plugins and inserted a single event with the video: video freezes after some frames
- i stripped our original project from all plugins one after the other to see if one of the plugins was the fault.
- i tried to alter the core.js to not start the video before the data is loaded, unsuccessfully

My thoughts on the problem:
either the video is indeed started before it is fully loaded or decoded and therefore crashes on play
or it is a chromium problem since the update, where a user interaction is required for videos to start playing.

I would greatly appreciate if you could have a look into this problem and hope that you are better at finding a solution
than I am...
Thanks a lot in advance 🙂 and all the best,
Ben from the PathOut team
So, I'm not going to lie, I'm not the most knowledgeable when it comes to things like this. But I was curious and downloaded the project. Running in Microsoft Edge, I do not encounter problems with the video, the best I can tell. It seems to run the whole thing (ends with him saying something about cliches?).

However, in Chrome, I get an error message that says Failed to load: data/Actors.json, even though that file is in the folder.

I dunno what is happening, but I'd maybe first post in MV Support just to see if there is a solution and that this is not necessarily a bug. It will probably take a while for Archeia to look at this thread for approval, so it couldn't hurt to try.
So, I'm not going to lie, I'm not the most knowledgeable when it comes to things like this. But I was curious and downloaded the project. Running in Microsoft Edge, I do not encounter problems with the video, the best I can tell. It seems to run the whole thing (ends with him saying something about cliches?).

However, in Chrome, I get an error message that says Failed to load: data/Actors.json, even though that file is in the folder.

I dunno what is happening, but I'd maybe first post in MV Support just to see if there is a solution and that this is not necessarily a bug. It will probably take a while for Archeia to look at this thread for approval, so it couldn't hurt to try.

Ok I will repost this thread in the rpgmaker mv tech support.
Thank you very much 🙂
Did this happen to you when you deployed the project for web and then opened it in chrome?
I actually made a thread for the Failed to load issue, to focus on that since it probably affects ALL projects.

https://forums.rpgmakerweb.com/index.php?threads/chrome-and-mv.102550/
This is a little old but I have actually just encountered this issue and got a fix for it.
The problem seems to be from it lagging out while trying to load frames. If the video is preloaded via a plugin it would probably work.
But this is not necessary if it is encoded with "-lag-in-frames 25" lag in frames is 0 to 25.
I am guessing that means it will not start playing the video until it has loaded 25 frames so is not likely to lag out and stall.

I encoded my video using ffmpeg using settings I hunted down for a higher quality webm video.

ffmpeg -r 24 -f image2 -i %05d.png -y -vb 384k -ab 96k -bt 64k -maxrate 900k -ar 44100 -ac 2 -r 20 -async 1 -vcodec libvpx -acodec vorbis -strict experimental -g 120 -level 216 -profile 0 -qmax 42 -qmin 0 -slices 4 -threads 6 -lag-in-frames 25 out.webm

This will take a folder full of images named like 00001.png 00002.png... and make them into a webm at 24 frames per second. Change the -r # to make it a difforent frame rate. Change -maxrate 900k to make it higher or lower quality.
If you want to change a video instead of -i %05d.png it would be something like -i nameOfMyVideo.avi

If you just run it with fewer settings then I got a video of 0.4 mb instead of 9 mb.
ffmpeg -r 24 -f image2 -i %05d.png -vcodec libvpx -acodec vorbis -lag-in-frames 25 out2.webm
This is a little old but I have actually just encountered this issue and got a fix for it.
The problem seems to be from it lagging out while trying to load frames. If the video is preloaded via a plugin it would probably work.
But this is not necessary if it is encoded with "-lag-in-frames 25" lag in frames is 0 to 25.
I am guessing that means it will not start playing the video until it has loaded 25 frames so is not likely to lag out and stall.

I encoded my video using ffmpeg using settings I hunted down for a higher quality webm video.

ffmpeg -r 24 -f image2 -i %05d.png -y -vb 384k -ab 96k -bt 64k -maxrate 900k -ar 44100 -ac 2 -r 20 -async 1 -vcodec libvpx -acodec vorbis -strict experimental -g 120 -level 216 -profile 0 -qmax 42 -qmin 0 -slices 4 -threads 6 -lag-in-frames 25 out.webm

This will take a folder full of images named like 00001.png 00002.png... and make them into a webm at 24 frames per second. Change the -r # to make it a difforent frame rate. Change -maxrate 900k to make it higher or lower quality.
If you want to change a video instead of -i %05d.png it would be something like -i nameOfMyVideo.avi

If you just run it with fewer settings then I got a video of 0.4 mb instead of 9 mb.
ffmpeg -r 24 -f image2 -i %05d.png -vcodec libvpx -acodec vorbis -lag-in-frames 25 out2.webm

that sounds interesting! I will definitely try this and thank you a lot for still replying to this old thread it could make all the difference!
Im happy to say Audos solution did the trick for me too! I reconverted all my vids with his settings and no more stuttering so far!

Thanks so very much!!
Hey guys, I've ran into the same issue. How do I use those settings? I put them into the custom settings of the Adobe Media Encoder for webm format but it changes absolutely nothing. They get ignored. And I can't seem to get ffmpeg to work with Encoder. What's the simplest way to do this?
I second this question.

My webm video playbacks also stop playing after the first few frames and preloading them with YSP didn´t solve the problem.

I´m also stuck at the exact same point with Encoder or Premiere, the custom settings box seems to do nothing.


Hey guys, I've ran into the same issue. How do I use those settings? I put them into the custom settings of the Adobe Media Encoder for webm format but it changes absolutely nothing. They get ignored. And I can't seem to get ffmpeg to work with Encoder. What's the simplest way to do this?
What I did with a 4 second video that always got stuck the first time, I used the YSP_VideoPlayer plugin and repeated the scrip ysp.VideoPlayer.loadVideo ('filename') several times.
I repeated it 6 times to test, one below the other, and it no longer gets stuck.

You would have to try longer videos to see if it works.
@Arise501 your trick does something for sure. I had some videos with 100% repro on freezing and it did help. However, they still do randomly freeze, even though I've set preloading before each of them...

Still happy to hear how to use that custom encoding. @audo? @skodone?
I split my big videos into 30 second chuncks and play them after another. Works for me.
That is just a bandaid for the problem, Ventus. On some other pc it will not be enough. My videos are 5 seconds long and they can still freeze sometimes.
1602684381009.png
original video was 205mb. I was able to recrete the bug exactly how the OP describes. I could not get the newly converted videos to freeze. Perhapse VP9 is the culprit. VP9 may be newer than what node wants to read with this version of RPG Maker.
Yeah I found that out too. VP9 wont work AT ALL.
But even with VP8 and YSP_VideoPlayer my movies over a minute in length get stuck if I don´t lower the bitrate from 4000 to 1024!

I hate it and I don´t know what do to but to live with suboptimal video quality.
I just quit using videos for MV. I paid money for this program and this hasn't been fixed since release.
Videos do not work period. They freeze randomly instead. :LZSsad:

Original thread: https://forums.rpgmakerweb.com/threads/bug-video-keeps-freezing-randomly-at-begin-of-mapload.102393/