• To improve security, we will soon start forcing password resets for any account that uses a weak password on the next login. If you have a weak password or a defunct email, please update it now to prevent future disruption.

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
4,964
7,282
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
4,641
7,648
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.