Ren'Py Advice Regarding Audiovisual Cinematics

Ankhesenamun

Member
Dec 17, 2017
357
1,175
Hello, let me start by humbly thanking the community for the tireless assistance I've seen provided to initiates of VNs and games. Many of the questions I had have already been privately tended to, or answered to other members with the same issue, in an unusual display of cooperation which I can only hope (and already try) to return.

Regarding this topic - while 3DSM, DAZ and Blender have been relatively easy to learn (and again, much thanks to the aid provided), I have been struggling a lot with Python/Ren'py.

I don't mean for this to be a "explain me the history of Python and how to use every comma of it" thread, so I'll keep making-do with YT tutorials and the like; the matter on audio-visuals is the only one impeding me from progressing.

Cinematic Introduction

Referring to the topic at hand - I have been trying to produce a cinematic introduction to my game. The visuals are done, and I initially tried to use an animated .webp file for the sequence. I learned, then, that Ren'py doesn't run animated .gif or .webp, but reverse engineering on some games revealed that it can play. webm. I have tried to use such format, but Ren'py didn't play it.

I have, then, used actual sequences of images for the introductions (like a car driving down a street). But since the introduction is long, it's messing up my script file.

What do you guys suggest for efficient, clean, legit cinematic visuals?

Thank you for reading, and I apologize I won't be able to tend to this thread until Saturday; but when I come back here, I will address every response individually.
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,490
7,035
Referring to the topic at hand - I have been trying to produce a cinematic introduction to my game. The visuals are done, and I initially tried to use an animated .webp file for the sequence. I learned, then, that Ren'py doesn't run animated .gif or .webp, but reverse engineering on some games revealed that it can play. webm. I have tried to use such format, but Ren'py didn't play it.
One thing you have to be careful about is that "webm" is not a single movie format. "webm" is actually the container format and then there's the codec that encodes (compresses) the movie inside the webm. (If you think about it, a movie file can contain video, audio, subtitles, etc.) Each of those is encoded in a different way, then they're all packaged up in a webm.

It's possible that the reason you couldn't get it to work is that you used a video codec that Ren'py doesn't support. The combination you probably want is webm+vp8 (vp8 is the codec). That combination Ren'py definitely supports - I've embedded such into a number of Ren'py games.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,368
15,282
I learned, then, that Ren'py doesn't run animated .gif or .webp, but reverse engineering on some games revealed that it can play. webm. I have tried to use such format, but Ren'py didn't play it.
Then perhaps that, instead of trying to do reverse engineering, you can just read the doc ?
Like Rich said, all isn't just a question of container, and the list of all the codecs supported by Ren'py is what start .
 
  • Like
Reactions: Ankhesenamun

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,581
2,219
If you already have a video that already plays in say.. ... you can simply convert it.
VLC's convert option (Ctrl+R), that will let you re-code selected files - including VP8 but not VP9.

Though personally, I prefer for re-coding stuff., since it has video options like "Web Optimize" and "Fast Decode". Which may not actually do anything productive... But I like the fact I can tick the boxes and feel like I've made a meaningful choice. Handbrake can and will re-code both the video and audio tracks, though sadly not to VP9.

I mention both because they are pretty user friendly compared with some other options that involve command line tools.
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,692
If you already have a video that already plays in say.. ... you can simply convert it.
VLC's convert option (Ctrl+R), that will let you re-code selected files - including VP8 but not VP9.

Though personally, I prefer for re-coding stuff., since it has video options like "Web Optimize" and "Fast Decode". Which may not actually do anything productive... But I like the fact I can tick the boxes and feel like I've made a meaningful choice. Handbrake can and will re-code both the video and audio tracks, though sadly not to VP9.

I mention both because they are pretty user friendly compared with some other options that involve command line tools.
Another good option is , it's free and support VP9 :)
 
  • Like
Reactions: Ankhesenamun

9thCrux

--Waifu maker--
Game Developer
Oct 22, 2017
844
3,221
I don't remember where I got this info but it was very useful for me:

"I don't know what kind of game engine you use,
but in renpy it's usual to use WEBP for images, WEBM for video (VP9 codec for video and OGG for audio),
and OGG for music and/or sound effects.

As for the format, MP4 (h.264+mp3) or WEBM (VP9+ogg) are the most used (there is a free program,
"Shotcut", which allows you to convert the format if you need to

You can use the free program xnConvert to convert images from PNG to WEBP (since with DAZ the best thing is to generate a lossless PNG);
in terms of compression, you can use "lossless" or if you want them to occupy a bit less, lower the quality to 95%,
the file will occupy less and there will be no appreciable loss of quality.

There are two ways you can display a movie

$ renpy.movie_cutscene("awesome_movie.webm") and make it loop, I can't remember exactly how you make it loop though, but that is the issue anyway when you display a movie like that, hiccups when it loops.

The other way where it won't hiccup is to define the movie as an image.

image name_whatever = Movie(play="awesome_movie.webm")
show name_whatever

That will play the movie looping fine forever until you click on it."
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,692
I don't remember where I got this info but it was very useful for me:

"I don't know what kind of game engine you use,
but in renpy it's usual to use WEBP for images, WEBM for video (VP9 codec for video and OGG for audio),
and OGG for music and/or sound effects.

As for the format, MP4 (h.264+mp3) or WEBM (VP9+ogg) are the most used (there is a free program,
"Shotcut", which allows you to convert the format if you need to

You can use the free program xnConvert to convert images from PNG to WEBP (since with DAZ the best thing is to generate a lossless PNG);
in terms of compression, you can use "lossless" or if you want them to occupy a bit less, lower the quality to 95%,
the file will occupy less and there will be no appreciable loss of quality.

There are two ways you can display a movie

$ renpy.movie_cutscene("awesome_movie.webm") and make it loop, I can't remember exactly how you make it loop though, but that is the issue anyway when you display a movie like that, hiccups when it loops.

The other way where it won't hiccup is to define the movie as an image.

image name_whatever = Movie(play="awesome_movie.webm")
show name_whatever

That will play the movie looping fine forever until you click on it."
This looks familiar :unsure:
https://f95zone.to/threads/compressing-games.42351/#post-2787058
https://f95zone.to/threads/movie-formats-quality-vs-size-vs-compatibility.40638/#post-2666426

:LOL::LOL::LOL:;)
 

Ankhesenamun

Member
Dec 17, 2017
357
1,175

Ankhesenamun

Member
Dec 17, 2017
357
1,175
One thing you have to be careful about is that "webm" is not a single movie format.
I had failed to grasp this, I figured .webm had the optional feature of added sound at maximum, rather than being the "box" where you put in components. Thank you.

If you already have a video that already plays in say.. ... you can simply convert it.
VLC's convert option (Ctrl+R), that will let you re-code selected files - including VP8 but not VP9.

Though personally, I prefer for re-coding stuff., since it has video options like "Web Optimize" and "Fast Decode". Which may not actually do anything productive... But I like the fact I can tick the boxes and feel like I've made a meaningful choice. Handbrake can and will re-code both the video and audio tracks, though sadly not to VP9.

I mention both because they are pretty user friendly compared with some other options that involve command line tools.
I had neither and installed both, I'll get the feel of how I handle both and eventually opt for the one I can communicate with the best. Thank you for your input!

Another good option is , it's free and support VP9 :)
Downloaded, thank you!


I don't remember where I got this info but it was very useful for me:

"I don't know what kind of game engine you use,
but in renpy it's usual to use WEBP for images, WEBM for video (VP9 codec for video and OGG for audio),
and OGG for music and/or sound effects.

As for the format, MP4 (h.264+mp3) or WEBM (VP9+ogg) are the most used (there is a free program,
"Shotcut", which allows you to convert the format if you need to

You can use the free program xnConvert to convert images from PNG to WEBP (since with DAZ the best thing is to generate a lossless PNG);
in terms of compression, you can use "lossless" or if you want them to occupy a bit less, lower the quality to 95%,
the file will occupy less and there will be no appreciable loss of quality.

There are two ways you can display a movie

$ renpy.movie_cutscene("awesome_movie.webm") and make it loop, I can't remember exactly how you make it loop though, but that is the issue anyway when you display a movie like that, hiccups when it loops.

The other way where it won't hiccup is to define the movie as an image.

image name_whatever = Movie(play="awesome_movie.webm")
show name_whatever

That will play the movie looping fine forever until you click on it."
So in the image-to-movie would be, for instance:

image PNGfilename = Movie(play="awesome_movie.webm")
show PNGfilename

Did I get it right?

So handy, thank you!
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,490
7,035
So in the image-to-movie would be, for instance:

image PNGfilename = Movie(play="awesome_movie.webm")
show PNGfilename

Did I get it right?
Yes, pretty much. If it's a full-screen movie and you want to have it serve as your background, you can also use
Code:
scene PNGfilename
instead of "show", since that will clear the previous background image.

One other thing you'll want to consider. It is quite common that, when setting up a movie image, it takes Ren'py a couple of frames to get the video decoder working and content on the screen. Depending on how you show the movie, that can result in a flicker. For example, with the "scene" approach, you'll see a frame or two of empty background. You can get around that with the "start_image" option. If you've rendered the video from frames, save the first frame image and put that in your project, then do
Code:
image PNGfilename = Movie(play="awesome_movie.webm", start_image="first_frame_of_the_video")
What that does is have Ren'py show the image "first_frame_of_the_video" while it's in the process of firing up the movie and doesn't have video data to display yet. Since it's the same image as the first frame in the movie, this will blend seamlessly into the video when the video actually starts playing.
 

Ankhesenamun

Member
Dec 17, 2017
357
1,175
Yes, pretty much. If it's a full-screen movie and you want to have it serve as your background, you can also use
Code:
scene PNGfilename
instead of "show", since that will clear the previous background image.

One other thing you'll want to consider. It is quite common that, when setting up a movie image, it takes Ren'py a couple of frames to get the video decoder working and content on the screen. Depending on how you show the movie, that can result in a flicker. For example, with the "scene" approach, you'll see a frame or two of empty background. You can get around that with the "start_image" option. If you've rendered the video from frames, save the first frame image and put that in your project, then do
Code:
image PNGfilename = Movie(play="awesome_movie.webm", start_image="first_frame_of_the_video")
What that does is have Ren'py show the image "first_frame_of_the_video" while it's in the process of firing up the movie and doesn't have video data to display yet. Since it's the same image as the first frame in the movie, this will blend seamlessly into the video when the video actually starts playing.
It's like those old cars where you used an handle to rev up the engine. That's amazing, thank you so much, I'm going to take this for a spin and let you know how it went!
 

Ankhesenamun

Member
Dec 17, 2017
357
1,175
Yes, pretty much. If it's a full-screen movie and you want to have it serve as your background, you can also use
Code:
scene PNGfilename
instead of "show", since that will clear the previous background image.

One other thing you'll want to consider. It is quite common that, when setting up a movie image, it takes Ren'py a couple of frames to get the video decoder working and content on the screen. Depending on how you show the movie, that can result in a flicker. For example, with the "scene" approach, you'll see a frame or two of empty background. You can get around that with the "start_image" option. If you've rendered the video from frames, save the first frame image and put that in your project, then do
Code:
image PNGfilename = Movie(play="awesome_movie.webm", start_image="first_frame_of_the_video")
What that does is have Ren'py show the image "first_frame_of_the_video" while it's in the process of firing up the movie and doesn't have video data to display yet. Since it's the same image as the first frame in the movie, this will blend seamlessly into the video when the video actually starts playing.

Pardon, it's me again. These lines should be input in the script file, correct? Or do I need a separate file to run these?
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,490
7,035
It doesn't matter. Ren'py doesn't care about file names - it merges together all the .rpy files.

The general convention, although its must a convention, is that you define images either in their own file, or at the top of the file, not mixed into the middle of the script. Obviously, the "show" or "scene" is put in the script where you want the movie to actually show.