Ren'Py Movies not working or stop working, 90% of the time

seamanq

Well-Known Member
Game Developer
Aug 28, 2018
1,888
2,859
I have built my game in the latest version of Ren'py and I am having a situation where I put videos in, but the game won't play them. Sometimes (a minimum of the time) it will, with no code changes. I found a way to get around this was to create a new project and move everything over, which sometimes (rarely) works, but mostly does not work. All of this is with the same code. The current code I am using is this:

Code:
    $ renpy.movie_cutscene("images/CDWR_15fps.webm", delay=None, loops=-1)
I have tried all kinds of iterations of this, but no love. I have hit Control-D and listed the contents of the folders, and the movies are in the images file, and the game is seeing them. Has anyone run into this problem? It is becoming a huge nuisance because I am trying to release a new version, but I can't get the one movie in my VN to play.

I have tried all of the approaches in this post:



but none of them are working. Does anyone else have experience with this, and what did you do to overcome it?

FYI, I am using webm movies encoded with the V9 codec. These same movies are working in my current alpha release bookmarked below. So, I don't believe it is anything wrong with the movies, and the code hasn't changed either. Suggestions?
 

seamanq

Well-Known Member
Game Developer
Aug 28, 2018
1,888
2,859
You are 16 different kinds of awesome, Silly Rabbit. I bow in your presence and am not worthy. That is exactly the problem and it fixed things. Thank you a dozen times.
 
  • Like
Reactions: Papa Ernie

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,486
7,005
Go to your option.rpy and set define config.has_sound = True
Renpy requires sound for video even if your webm file is silent.
Absolutely the correct fix. For those that are nitpickers (me) Ren'py's media architecture uses channels to manage media. Movies, by default, are managed by the same channel that is used for playing "sounds" (as distinct from playing "music"), even if the movie doesn't contain any sound. If you don't define the config variable, the channel doesn't get initialized properly.

At one point, Ren'py would fail to play videos if they didn't have an audio track. I think that's been fixed, but not 100% sure. I always include a (silent) audio track just to be sure.
 

f95zoneuser463

Member
Game Developer
Aug 14, 2017
219
1,019
At one point, Ren'py would fail to play videos if they didn't have an audio track. I think that's been fixed, but not 100% sure.
I can confirm this is fixed. There is no need for a silent audio track anymore. :)

Test with two videos: webm container, VP9 video, one with opus audio
Ren'Py 7.1.3.1092, Windows 10 x64 build 1709
Code:
video with audio | config.has_sound = .. | plays ?
-----------------+-----------------------+---------
NO               |  True                 | YES
NO               |  False                | YES/NO*
YES              |  True                 | YES
YES              |  False                | YES/NO*
* = I expected this to fail and it did still play fine for me. So I checked what happens if I set ALL audio-flags to False:

BAD:
Code:
define config.has_sound = False
define config.has_music = False
define config.has_voice = False
Now it skipped the video silently without an error or exception. I've not checked the log very careful though.

GOOD:
I found out it will play if only one audio-flag is set to True. No matter which one.

Now I'm scratching my head wondering why someone would disable all audio-flags? Aren't these True by default? No offense, I'm just curious since I find it very "hard" to run into this issue in the first place. :unsure: Maybe I'm missing something. Old Ren'Py version? Deleted 'options.rpy' or modified it a lot?
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,486
7,005
Now I'm scratching my head wondering why someone would disable all audio-flags? Aren't these True by default? No offense, I'm just curious since I find it very "hard" to run into this issue in the first place. :unsure: Maybe I'm missing something. Old Ren'Py version? Deleted 'options.rpy' or modified it a lot?
Wow, thanks for the detailed experimentation.

As to why someone might disable all the audio flags, if you don't have audio in your game, there is no need for the "Preferences" sliders to control the audio volume. When you turn one of the "config" variables to False, it hides the corresponding slider on the default Preferences screen. So setting all those flags to False would look appropriate for a sound-less game, at least from that perspective.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,299
15,167
So setting all those flags to False would look appropriate for a sound-less game, at least from that perspective.
It's also easier than having to edit the "preference" screen itself. At any time you can change your mind and add some sound in your game, by just changing a configuration value. This while the obligation to have a sound channel open to play movie force you to comment the "preference" screen, and so imply more works when you change your mind.
This said, with this in mind the best way to do is to keep the voice channel opened for movies. It's the less likely to be used, so you can comment its bar in the "preference" screen without remorse. In the end, you have movies, you don't have useless configuration inputs, and you can add music/fx at anytime by just changing a configuration value.