Ren'Py Issues with movies/cutscenes

DV FiSTer

Newbie
Game Developer
Jun 12, 2023
50
117
43
I'm trying to add some animations to my project, and can't get them to work... The method I've used, thus far, is creating string of jpg files with Daz Studio, then using ffmpeg to convert into a video file. I've tried as both an mp4 and as webm, as well as with and without adding a silent audio track...

The videos themselves work just fine using a video player... but when I try to put them up in the game I get nothing...
if using
$ renpy.movie_cutscene "/video/bikinitoss.webm" It just jumps straight to the next line of code (no errors or anything, just as if nothing is there)...

if I instead define it...

image bikinitoss = Movie(size=(1920,1080), channel="movie_dp", play="/video/bikinitoss.webm") ###Note: i've used just "movie" also as the channel....somewhere I read that _dp makes it displayable so that you can put text over it,so that is how it's in at this moment...

and then...
scene bikinitoss (or show bikinitoss)
The mouse cursor disappears as if the movie is playing for the time that it would be going (5 seconds)....unless of course I click, which jumps ahead... but it doesn't actually show anything...

As another test, I pulled a file from a few other games I've played (both webm and mp4 formats were tried) and though I see the movies fine when playing someone else's game, when I try to use in mine, nothing shows up...

I even started a blank test project that only consists of...

Code:
image bikinitoss=Movie(size=(1920, 1080), channel="movie",play="/video/bikinitoss.mp4")
 
label start:
    "vid test"
    $ renpy.movie_cutscene("/video/bikinitoss.mp4")
    "did it work?" 
    
    "how about now?"
    scene bikinitoss
    "well?"
    return
And it didn't work there either (using either my video or one pulled out of another game).



Anyone have any ideas or suggestions I might try?
 

DV FiSTer

Newbie
Game Developer
Jun 12, 2023
50
117
43
For this particular one, I can get away with doing
scene bikinitoss001
pause 0.05
scene bikinitoss002

and so on (that would get me 20 FPS)... but in the long run, I want to be able to have video going while text is going on as well, so definitely want to get this figured out soon
 

Winterfire

Conversation Conqueror
Respected User
Game Developer
Sep 27, 2018
6,396
9,169
800
First of all, the way you're doing it is unnecessarily complex, just this would be fine:

Python:
image videoName = Movie(play="videp/videoname.webm")

scene videoName
This is the way I did it in my game back when I used Ren'Py and it didn't have any issues with text or anything like that.

Also, make sure the current Ren'Py you're using is okay. Other games may be using a different version, and yours might have codec issues, or other bugs (either newly introduced, or recently fixed if outdated).

I've excluded other things I thought of due to the fact you mentioned you tried a new project, as well as other people's videos... Try these solutions first.

-Edit-
Also, make sure it's not a path issue/typo.

-Edit 2-
You could also use start_image to see if that at least displays:
Potentially, at least for testing, you could put the image on the same path to see if the path itself is the issue (such as being inside of images, which you didn't put, or just a typo).
 
Last edited:

DV FiSTer

Newbie
Game Developer
Jun 12, 2023
50
117
43
I guess I could have added that I'm using Ren'Py 8.4.1 (I'll look to see if I can figure a way to roll back a few versions in case it is related to a bug with a newer update)....

I tried changing to your simplified code to no avail... then i added ... ,image="video/mbr_bath_showerview2.jpg") nothing showed up (That is if it can't find the video)...then added start image with a different pic, and... that did show up (put in the same folder as the video file, so yeah,the path is good, and i double checked spelling, etc. to make sure nothing else wrong with my video name)...

Really frustrating that something that seems so simple is giving me so much difficulty!
 

DV FiSTer

Newbie
Game Developer
Jun 12, 2023
50
117
43
And this is the code I use in ffmpeg to create the video - if that helps anyone narrow down where the issue may lie...

ffmpeg -framerate 30 -i bikinitoss%04d.jpg -c:v libx264 -r 30 -pix_fmt yuv420p bikinitoss.webm
 
  • Like
Reactions: taffynic

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
12,772
20,994
1,026
as if the movie is playing for the time that it would be going (5 seconds)....unless of course I click, which jumps ahead... but it doesn't actually show anything...
What is the normal behavior, except obviously the part where nothing is shown.



As another test, I pulled a file from a few other games I've played (both webm and mp4 formats were tried) and though I see the movies fine when playing someone else's game, when I try to use in mine, nothing shows up...
So, it's not a hardware issue, nor an OS one. And it's also not due to the lack of speakers.

It fully come from the configuration of your game. Did you mute the sounds? What have you changed in terms of configuration?


I guess I could have added that I'm using Ren'Py 8.4.1
The configuration file do not correspond to this version, but I just tested and I had no problem to play a movie with the 8.4.1
 

DV FiSTer

Newbie
Game Developer
Jun 12, 2023
50
117
43
Well dip me in shit and call me a popsicle... I just deleted the script file and then recreated it (within the test project) and now it works... so.... no clue what the issue was, but something must have been there... now to figure out where the issue lies within the actual game I'm trying to make!!!
 

AllNatural939

I am the bad guy?
Game Developer
Apr 3, 2024
872
1,080
229
Just for reference, this is what I do and I’ve never had any problem with it:

Code:
image emmavideo8 = Movie(play="images/Video/d1_p3_648ani.webm", loop=True, start_image="images/Video/d1_p3_648ani.jpg", image="images/Video/d1_p3_648ani00029.jpg")
Then, when needed, the video is shown using "scene emmavideo8"... as simple as that.
 
  • Like
Reactions: DV FiSTer

Mattock

Member
May 27, 2018
125
111
73
slight addition: kick "cutscene" to the bin! please work with (class) Movie() on todays RenPy!
(and registering a new "channel" like e.g. "movie_dp" may be a good idea!.. but you need to read the SDK-doc)
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
12,772
20,994
1,026
(and registering a new "channel" like e.g. "movie_dp" may be a good idea!.. but you need to read the SDK-doc)
And add a volume slider for it in the preference screen.
Muting all sounds can totally disable movies in some versions of Ren'Py, so many players have the habit to just put all sliders to 0. And there's nothing worse than a movie that suddenly blast sound.
 

DV FiSTer

Newbie
Game Developer
Jun 12, 2023
50
117
43
The file is now working in both my actual project and in test... no clue what the issue was, but apparently just asking for assistance was enough to fix it!!!!
 

Winterfire

Conversation Conqueror
Respected User
Game Developer
Sep 27, 2018
6,396
9,169
800
And this is the code I use in ffmpeg to create the video - if that helps anyone narrow down where the issue may lie...

ffmpeg -framerate 30 -i bikinitoss%04d.jpg -c:v libx264 -r 30 -pix_fmt yuv420p bikinitoss.webm
I thought H264 codec wasn't supported on Ren'Py? anne O'nymous can you confirm?
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
12,772
20,994
1,026
I thought H264 codec wasn't supported on Ren'Py? anne O'nymous can you confirm?
It's the recommended format for WebRen'Py.

I haven't tested my self, and will not starts to encode a video just for this. But since OP said that now the video works, I guess that its support have been added at some point to the desktop version; at least to avoid some "hey, but the doc say..."/"yeah, but it's for the web only" talks.
 
  • Like
Reactions: Winterfire

Turning Tricks

Rendering Fantasies
Game Developer
Apr 9, 2022
1,965
3,653
353
H264 is pretty much the most widely used codec for MP4 containers. I wish H265 would gain more traction though as it's way smaller (I get most of my torrented movies as H265 and they can be as small as 350MB for a full 1080p movie, while an H264 one is usually 1.5-2GB)

Just a recommendation for webm... the best codec to use to make webm's in FFMPEG is the VP9 one, so instead of using -c:v libx264 like DV FiSTer recommended above, I would actually suggest you use -c:v libvpx-vp9 instead. Also, it's a terrible idea to convert jpg's to webm as you are basically compressing an already compressed format. Either make the webp's before hand (using Photoshop or some other tool) or convert from a lossless format like PNG or TIF.

Here's the command line I use the most, when making my animations...

ffmpeg -framerate 24 -f image2 -i frame_%03d.png -c:v libvpx-vp9 -pix_fmt yuva420p output.webm

Just change the frame_%03d.png to match your input files. The %03d part tels FFMPEG to process a numerical 3 digit sequence, so change that to 2 if you only have two digit runs (ex: frame_002.png, frame_003.png, etc). You can also change the file extension to whatever and FFMPEG can handle that. So, for example, changing that section to frame_%03d.webp will process webp images instead.

Just for reference, in case anyone is interested...

-framerate 24 Sets the framerate to 24 fps (I'm using that lately since I am taking an animation course and 24fps is the industry standard still)

-pix_fmt yuva420p is the pixel format. yuva420p is an older format that includes an Alpha channel. Best to stick with this as the newer version of pixel formating can cause issues with some players.

-i frame_%03d.png is the input filename in the format of "frame_XXX.png" where XXX is a sequence in 3 digits that FFMPEG will process in order (Note: has to be continuous, so don't skip any)

output.webm is the output file name. You can name it pretty much anything but if you change the output file type, these settings might not work best for that.
 

DV FiSTer

Newbie
Game Developer
Jun 12, 2023
50
117
43
H264 is pretty much the most widely used codec for MP4 containers. I wish H265 would gain more traction though as it's way smaller (I get most of my torrented movies as H265 and they can be as small as 350MB for a full 1080p movie, while an H264 one is usually 1.5-2GB)

Just a recommendation for webm... the best codec to use to make webm's in FFMPEG is the VP9 one, so instead of using -c:v libx264 like DV FiSTer recommended above, I would actually suggest you use -c:v libvpx-vp9 instead. Also, it's a terrible idea to convert jpg's to webm as you are basically compressing an already compressed format. Either make the webp's before hand (using Photoshop or some other tool) or convert from a lossless format like PNG or TIF.

Here's the command line I use the most, when making my animations...

ffmpeg -framerate 24 -f image2 -i frame_%03d.png -c:v libvpx-vp9 -pix_fmt yuva420p output.webm

Just change the frame_%03d.png to match your input files. The %03d part tels FFMPEG to process a numerical 3 digit sequence, so change that to 2 if you only have two digit runs (ex: frame_002.png, frame_003.png, etc). You can also change the file extension to whatever and FFMPEG can handle that. So, for example, changing that section to frame_%03d.webp will process webp images instead.

Just for reference, in case anyone is interested...

-framerate 24 Sets the framerate to 24 fps (I'm using that lately since I am taking an animation course and 24fps is the industry standard still)

-pix_fmt yuva420p is the pixel format. yuva420p is an older format that includes an Alpha channel. Best to stick with this as the newer version of pixel formating can cause issues with some players.

-i frame_%03d.png is the input filename in the format of "frame_XXX.png" where XXX is a sequence in 3 digits that FFMPEG will process in order (Note: has to be continuous, so don't skip any)

output.webm is the output file name. You can name it pretty much anything but if you change the output file type, these settings might not work best for that.
Thanks for the info - I wasn't aware that jpg was compressed vs. png (though I guess it sort of makes sense that they are smaller files for that reason!.... going forward I'll use .png

As for the codec stuff - I was just using what I found online as the way to do it, if others work better, I have zero attachment to the way I was doing it.
 

DV FiSTer

Newbie
Game Developer
Jun 12, 2023
50
117
43
slight addition: kick "cutscene" to the bin! please work with (class) Movie() on todays RenPy!
(and registering a new "channel" like e.g. "movie_dp" may be a good idea!.. but you need to read the SDK-doc)
Good to know... I just saw cutscene as being a way to play a video (and from what I had found the easiest way) so I was up for trying it
 

Mattock

Member
May 27, 2018
125
111
73
thx@ Winterfire, anne O'nymous , Turning Tricks for the additional info on animations!
(marked as important to myself!-)

I would consider "cutscene" obsolated...(but RenPy does NOT.., afaik(!)
especially with android you may encounter weird problems with "cutscene"...
Movie() is powerful and even intimidating, but by 98,9% it will stay.
Familiarsize yourself with it (step by step!), it will not go lost!(imho;)

P.S. *.png is compressed too...BUT it's a "lossless" compression!
I would consider *.jpg a "lossfull" compression
---the difference is: from a *.png you can create a BITMAP(*.bmp) exactly like the origin!
---from a *.jpg( and any NOT "lossless" ) you will always get reduced quality!