Ren'Py Renpy videos won't play and I don't know why.

Darkshadow2905

New Member
Jun 3, 2019
11
0
It seems adding 'images/video/file_name.webm' fixed the issue. Despite the fact that standard images don't require you to specify the file location, it seems videos do. Even though the renpy movie page doesn't specify you need to. It's possible that most people don't have to specify the file location and it's just a weird issue for me alone.

Also, for those who do this and still have the same issue, like I did, don't capitalize the folder name. "images/Video/file_name.webm" will not work. Or at least it didn't for me.

You don't need to add a silent audio track. That has been fixed. So don't waste time messing with ffmpeg unless you're using .mov files or whatever and are following the instructions for using side_mask on the documentation.

May as well include a link to the documentation I'm talking about:




******IGNORE THIS*******

The following is evidence on the amount of time I spent on something with a simple solution. fml




I've been trying to get this to work for a while now and I thought I'd ask for help. I'm using the video export mod for koikatsu, and every time I've tried to get the code to work, the video won't play. No crash, no nothing. It's like it doesn't even realize the video exists.

1708077253099.png
Right now, a video called test7 should be playing. But it's not. You can probably guess why it's called test7 but I've gone over double the files. The relevant code I'm using is this:

image test = Movie(play="video/test7.webm")
scene test

Right now the 'test = movie' bit sits right above the 'scene test', but I've also tried putting it before the label and in a different file entirely where all the names are. I've also tried including the size, the framerate, using ' $ renpy.movie_cutscene("test7") ' from a forum post in 2011, putting it in different folders, removing the file location. using show instead of scene and adding 'channel = movie' .

define config.has_sound = True
define config.has_music = True
define config.has_voice = False

I've read that this can cause issues, so I've copied it from my options file, but for most of my tests all of them have been set to true. Test 7 is in images/video in my game folder, in case anyone is wondering.

1708077654369.png

These are the parameters for exporting the file. I've tried MP4 as well as the quality settings 15, 20 and 3. All of which settings copied from screenshots of people who got it working, but no luck. I've tried VP8 and the framerates 60 and 24. I've also tried different lengths of time (10, 5, 3, 2 and 1 seconds) but I doubt that'd matter.

I also heard that having no audio track causes problems but also that it's been fixed. Still, I learnt how to use ffmpeg and put a silent audio track on 97% of my tests. I've tried opus, libopus, vorbis and libvorbis but still nothing.

ffmpeg -i test.webm -f lavfi -i anullsrc -vcodec copy -strict -2 -acodec opus -shortest test7.webm

This was the command line I used for adding silent audio tracks to the files. Just changing the codec, input and output at various points throughout my testing. The strict -2 is just so I can use opus and vorbis as they're experimental. Not needed for libopus and libvorbis

I've also heard that I can play an animation from individual images, but I need the video to play as a scene so it loops in the background while you're reading dialogue. I'd prefer to get the video working, but if someone can tell me how to achieve this with the images instead I'll be eternally grateful.
 
Last edited:

Darkshadow2905

New Member
Jun 3, 2019
11
0
Okay, literally seconds after posting this the video started playing. I feel like the God of Renpy is messing with me. Now instead I have the problem of this flicker of white and grey background before the video starts. The same one from the first image. If someone can tell me how to fix that instead, that'd be great.
 

Winterfire

Forum Fanatic
Respected User
Game Developer
Sep 27, 2018
5,504
8,040
Okay, literally seconds after posting this the video started playing. I feel like the God of Renpy is messing with me. Now instead I have the problem of this flicker of white and grey background before the video starts. The same one from the first image. If someone can tell me how to fix that instead, that'd be great.
If you mean the checkered background, it becomes a pure black screen once you build the game. It's due to loading, proper predicting and enough cache would fix it, but "start_image" is the most common solution:
 
  • Like
Reactions: Darkshadow2905

Darkshadow2905

New Member
Jun 3, 2019
11
0
Adding with fade fixed the flicker. I don't know what's going on, but someone seemed to helped me. The second I ask for help everything works out. I'm going to edit the main post in case anyone has same issue. I'm looking through my code and it seems adding images/ before video seemed to fix it. Despite the fact I tried this before and it didn't work. I'm going to do more tests to see exactly what happened.
 

MissFortune

I Was Once, Possibly, Maybe, Perhaps… A Harem King
Respected User
Game Developer
Aug 17, 2019
5,380
8,652
People tend to overcomplicate this. Defining the animation/video as an image makes life a lot easier. I kind of went over the general process here. Also in the quote below.

Is it an animation? I'll be writing this under the assumption that it is.

1. Video editing software: There's a ton of command line software out there, but I honestly prefer video editing software for GUI. Makes life a lot easier. Openshot is a good free one. So is DaVinci, though I'm not sure if they take image sequences. I personally use Premiere Pro or After Effects, depending on my needs for said animation.

1b. If you're using After Effects/Premiere, then you're going to download Media Encoder. Once you have all those, you'll want to download Fnord. Make sure you install Fnord while AE/PP are closed. Once you have that, you'll open AE/PP.

View attachment 2811254

View attachment 2811255

Select the first image in the sequence (notice all of the images are in order? 0, 1, 2, 3, etc. That's pretty necessary, hence sequence.), and then select the "Image Sequence" box, then click open. This is where Fnord comes into play. Sort of, at least. The rest should be pretty easy to follow via video:


To pull up "Export Settings", just right-click on the black space like I did in the video. After it's exported/rendered, slap it somewhere in your Renpy game directory. What you're going to do after that is define the video as an image, like so:

Code:
image aniname = Movie(play="images/ani/ani1.webm", loop=True, start_image="images/ani/aniname_060.png", image="images/ani/aniname_119.png")
Some notes for the above code. If it's not a looping animation, change loop=True to False. "start_image" should be the first image of the animation and "image=" should be the last. This prevents the black/checkerboard background from appearing. So, now that you have your animation defined as an image, you can play it as if it were a regular render. Like so:

Python:
scene render 3 with dissolve
mc "blah blah blah!"
li "blah blee blah!!"
#animation starts here
scene aniname with dissolve
pause
scene render 4 with dissolve
mc "blahhhh!!!!!!!!"
I think that about covers the process? Could be missing something, but I don't think I am. Openshot should work similarly to AE/PP, sans the need for Fnord. If there's anything that isn't quite clear, I'll try to help if I can.

Edit: Replaced the temporary Streamable link with a YouTube link. More permanent and higher quality.
 

DarkArchon

Newbie
May 9, 2017
35
18
People tend to overcomplicate this. Defining the animation/video as an image makes life a lot easier. I kind of went over the general process here. Also in the quote below.
I searched the forum for Renpy videos not playing and I found this thread. I am not a developer; I just play the games. I was able to see the videos on Renpy games fine on my current computer, but suddenly I can no longer see the videos on any Renpy games. This includes both older games like Dreams of Desire (the updated version with video), and newer games like Straitened Times. When the video is supposed to play, I can see the dialogue, but screen is blank. Once I move passed where the video is supposed to play, I can see images fine, but not the video. Have you heard of this happening, and do you know any solutions? If I extract the videos using unren, I can play the easily using a variety of video players, but they won't during the game. The videos in RPGM and Unity games play fine. It is only Renpy games that are a problem, and this just started recently.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,611
2,258
I was able to see the videos on Renpy games fine on my current computer, but suddenly I can no longer see the videos on any Renpy games. This includes both older games like Dreams of Desire (the updated version with video), and newer games like Straitened Times.

If it's consistent across multiple RenPy games, it's almost certainly the graphics driver or the video codecs.

Assuming you're talking about a Windows PC, running Windows 10 or 11...

The graphics driver is easy. Just update to the latest graphics driver for your video card from the manufacturer's website. More often then not, that's going to be , or .

The codecs. Codecs are the video/audio encoders and decoders. For example, if you have an MPG file file, chances are that it'll be using an h264 or h265 codec for video (or another one, there are lots). Nobody ever thinks about them, because "they just work". I'm only mentioning it to explain that codec (h264) isn't the same as file format (MPG).

If those are broken, then it's usually because you've installed or updated some software recently. A video editor? A graphics editor? A sound file editor? An "optimize your system" program? A new (non RenPy) game? Or something similar. It's all a "behind the scenes" type thing for most people, so don't worry too much about it.

My suggestion would be to download and install a codec pack.
Standard pack :
... and yes, this falls into the category of an "optimize your system" solution. There is a chance it could break something (unlikely, as the k-lite pack is usually flawless).

There is a " " which contains more codecs, but the vast majority of people won't need them. In fact, you might be able to get away with just the " ".

Updated drivers + updated codecs... I'd be very surprised if that didn't fix it.
If it had just been one or two games, I'd blame RenPy. But the majority of them, that's your PC.
 
Last edited:
  • Like
Reactions: DarkArchon

DarkArchon

Newbie
May 9, 2017
35
18
If it's consistent across multiple RenPy games, it's almost certainly the graphics driver or the video codecs.

Assuming you're talking about a Windows PC, running Windows 10 or 11...

The graphics driver is easy. Just update to the latest graphics driver for your video card from the manufacturer's website. More often then not, that's going to be , or .

The codecs. Codecs are the video/audio encoders and decoders. For example, if you have an MPG file file, chances are that it'll be using an h264 or h265 codec for video (or another one, there are lots). Nobody ever thinks about them, because "they just work". I'm only mentioning it to explain that codec (h264) isn't the same as file format (MPG).

If those are broken, then it's usually because you've installed or updated some software recently. A video editor? A graphics editor? A sound file editor? An "optimize your system" program? A new (non RenPy) game? Or something similar. It's all a "behind the scenes" type thing for most people, so don't worry too much about it.

My suggestion would be to download and install a codec pack.
Standard pack :
... and yes, this falls into the category of an "optimize your system" solution. There is a chance it could break something (unlikely, as the k-lite pack is usually flawless).

There is a " " which contains more codecs, but the vast majority of people won't need them. In fact, you might be able to get away with just the " ".

Updated drivers + updated codecs... I'd be very surprised if that didn't fix it.
If it had just been one or two games, I'd blame RenPy. But the majority of them, that's your PC.
Thanks!
 

DarkArchon

Newbie
May 9, 2017
35
18
If it's consistent across multiple RenPy games, it's almost certainly the graphics driver or the video codecs.

Assuming you're talking about a Windows PC, running Windows 10 or 11...

The graphics driver is easy. Just update to the latest graphics driver for your video card from the manufacturer's website. More often then not, that's going to be , or .

The codecs. Codecs are the video/audio encoders and decoders. For example, if you have an MPG file file, chances are that it'll be using an h264 or h265 codec for video (or another one, there are lots). Nobody ever thinks about them, because "they just work". I'm only mentioning it to explain that codec (h264) isn't the same as file format (MPG).

If those are broken, then it's usually because you've installed or updated some software recently. A video editor? A graphics editor? A sound file editor? An "optimize your system" program? A new (non RenPy) game? Or something similar. It's all a "behind the scenes" type thing for most people, so don't worry too much about it.

My suggestion would be to download and install a codec pack.
Standard pack :
... and yes, this falls into the category of an "optimize your system" solution. There is a chance it could break something (unlikely, as the k-lite pack is usually flawless).

There is a " " which contains more codecs, but the vast majority of people won't need them. In fact, you might be able to get away with just the " ".

Updated drivers + updated codecs... I'd be very surprised if that didn't fix it.
If it had just been one or two games, I'd blame RenPy. But the majority of them, that's your PC.
Updating the video drivers worked! Thanks again.