Hello all, I have problem that I’d REALLY like to solve at some point sooner rather than later.
During my RPGMaker game, I play movies because I have cutscenes I want to play. Unfortunately, and rarely, the videos completely freeze up. No advancing the dialogue, no entering the menu, nothing can be done. It’s fully stuck. You have to close the game entirely.
Is there ANY way to mitigate this? Even if it happens rarely, that’s still WAY too often for my liking.
I’ll admit that my project is ambitious. These are not small videos, these are high quality, 1280x720 cutscenes. If that is the problem, I’ll be devastated because I want NOTHING more than to keep the videos high quality and still prevent any chance of freezing.
Any plugins, any tweaks, any advice is helpful. Thanks!
From my understanding, Play Movie in MV holds the event until the video reports that it reached the end. If the video stalls partway, the event just keeps waiting, and since the event never finishes, the menu and dialogue can’t move either. I’m wondering if that’s what’s happening when it locks up.
When it happens, does the picture stop mid video, or does the video finish and then the game stays stuck? It would also help to know if it’s always the same video and if it happens in a deployed build on other PCs. If you can catch it in a playtest, F8 opens the console and any red errors there could point right at it.
If it’s freezing mid video, I’d probably try re encoding one of the problem videos at a lower bitrate while keeping it 1280x720. I don’t think you’d have to give up the resolution, and it could show whether the file itself is what’s stalling. A skip plugin like LTN Games’ Skip Video might also work as a safety net so players can get out, though I haven’t tested it on a stalled video.
If it’s the video finishing and then the screen staying frozen, there’s a known MV bug that causes random graphics freezes. Tamschi has a fix for it, and their Freeze Fix page points to MAC_High_Hz_Fixes as the one to use now.
Yes, it stops mid-video, and usually a second or 2 in.
It’s not consistent, and it seems to be possible on any video I play. I have about 16 short intro cutscene clips that play not too far from each other, basically after a short convo with each NPC.
Yes, the behavior described is right. If there’s background music playing or sound effects going, they will continue playing. The video is just caught.
I confirmed it happened in a deploy with another PC.
I just encountered it again to pull up the F8 menu, and this is the only red message:
To my knowledge, I don’t have a file like that anywhere in my project. It also seemed to occur on a repeat playtest without the freeze, so I doubt it’s related?
I’d hate to lower the quality of the video to any degree to avoid this fix, but if it’s the only way. What’s a bitrate you recommend for that size of a video?
I have the Skip Video from LTN Games plugin, and I can confirm that trying to skip the video mid-freeze doesn’t work. Nothing pops up.
I’ve also attempted this while running MAC_High_Hz_Fixes and have hit the freeze. Sadly, this doesn’t seem to be the solution I need…
I’ll try with lower bitrates in the meantime. Thanks for the advice, and let me know if this further clarifies anything
Since it stops a second or two in on any video while the music keeps going, I’m wondering if the video itself is stalling and Play Movie is just waiting on it forever. Next time it freezes in a playtest, could you open F8 and try these one at a time:
Run the first line twice, a few seconds apart. If the number stays the same, the video is stuck. The second line nudges it forward a little. If that gets it playing again, a plugin could maybe do the same thing on its own without skipping your cutscene. The last line is what MV runs when a video finishes. If the game picks back up after it, then a small plugin that ends a stuck video could work as the safety net.
When triacontane looked into a project with this same random video freeze, the video played fine in Chrome but froze in the game, which made it look like MV’s NW.js could be the cause (GitHub issue). MV ships with an older NW.js, and there’s a guide on updating it. I haven’t tried that for this freeze myself, so I’d follow the guide’s backup steps first.
For bitrate I don’t have a magic number. YouTube’s upload guide lists about 5 Mbps for 720p at 30fps, so I’d maybe start one video there and play it a bunch of times. If it never freezes, you could step it back up and see where it starts again.
I agree the Actor1 1.png error is probably unrelated, since it shows up on runs that don’t freeze.
Hit the freeze, and the video stayed the same with the currentTime. So I tried this command and it worked! The video resumed, and the game continued as normal afterwards! I think this could be worth trying as a plugin.
How would a plugin with this fix work? What would it look like?
The plugin does what you did in the console, just on its own. While a movie is showing, it checks the video’s time every quarter second. If the time hasn’t moved for a full second, it pushes it forward 0.1 like your command did. If it’s still stuck after 5 nudges in a row, it ends the movie the same way MV does when a movie finishes, so the event can keep going instead of locking up.
Save this as VideoStallFix.js in your js/plugins folder (the file name has to match exactly), then turn it on in the Plugin Manager:
/*:
* @plugindesc Nudges a stuck movie forward so Play Movie doesn't freeze the game.
* @author Baz
*
* @param Stall Time
* @desc Milliseconds the movie can sit on the same frame before it gets nudged.
* @type number
* @min 250
* @default 1000
*
* @param Nudge Amount
* @desc Seconds to push the movie forward each nudge.
* @type number
* @decimals 2
* @min 0.01
* @default 0.1
*
* @param Max Nudges
* @desc Nudges in a row before the movie is ended so the event can continue. 0 never ends it.
* @type number
* @min 0
* @default 5
*
* @help
* While a movie from Play Movie is showing, this checks every quarter second
* whether the movie's time is moving. If it gets stuck, the plugin pushes it
* forward a little. If it stays stuck after Max Nudges tries, the movie is
* ended so the event can keep going.
*/
(function() {
var params = PluginManager.parameters('VideoStallFix');
var stallTime = Number(params['Stall Time'] || 1000);
var nudgeAmount = Number(params['Nudge Amount'] || 0.1);
var maxNudges = Number(params['Max Nudges'] || 5);
var lastTime = -1;
var lastChange = 0;
var nudges = 0;
setInterval(function() {
var video = Graphics._video;
if (!video || !Graphics._isVideoVisible() || video.paused || video.ended) {
lastTime = -1;
nudges = 0;
return;
}
var now = performance.now();
if (video.currentTime !== lastTime) {
lastTime = video.currentTime;
lastChange = now;
nudges = 0;
return;
}
if (now - lastChange < stallTime) return;
if (maxNudges > 0 && nudges >= maxNudges) {
video.pause();
Graphics._onVideoEnd();
return;
}
video.currentTime += nudgeAmount;
lastTime = video.currentTime;
lastChange = now;
nudges++;
}, 250);
})();
All three numbers are plugin parameters if you want to tweak them.
It looks like it worked! I kept the variables as-is and re-ran. I quickly saw a video freeze, but it unfroze itself not long after! I’ll tinker with the vars a bit more to see if I can catch it sooner and make it seem more seamless.
I can’t express enough how grateful I am for this. This genuinely might’ve saved this project. Thanks so much!